Note: While the term "FAANG" (Meta, Amazon, Apple, Netflix, Google) is still widely recognized, the tech world in 2025 often refers to the "Magnificent Seven" (Apple, Microsoft, Alphabet, Amazon, Nvidia, Meta, Tesla) as the dominant group of companies shaping the industry and interview trends. This repository keeps the FAANG name for legacy and recognition, but covers all major tech interview patterns.
Welcome! This repository is a comprehensive collection of solutions, explanations, and resources for mastering coding interviews at top tech companies. Whether you're preparing for interviews at FAANG, the Magnificent Seven, or any leading tech firm, you'll find:
- Original, well-commented solutions to hundreds of classic and trending problems
- Intuitive explanations and step-by-step approaches
- Curated resources for Data Structures, Algorithms, System Design, and OOP
- Company-specific and topic-specific question lists
Tech interviews are evolving, but the fundamentals remain the same. The problems here are the backbone of interviews at companies like Apple, Google, Amazon, Meta, Microsoft, Netflix, Nvidia, and more. Mastering these will prepare you for both traditional and modern interview formats.
- Complexities & Big O Explained
- Resources & Training Material
- Data Structures & Algorithm Problems
- Contests
- System Design
- OOPS Design
- Important Links
- How to Use This Repo
- How to Contribute
- When to Contribute
Understanding time and space complexity is crucial for writing efficient code and acing interviews. Here’s a high-level overview:
Complexity Type | Notation | Example Algorithm | Typical Use Case |
---|---|---|---|
Constant | O(1) | Hash table lookup | Accessing array element |
Logarithmic | O(log n) | Binary search | Searching in sorted array |
Linearithmic | O(n log n) | Merge sort, Heap sort | Efficient sorting |
Quadratic | O(n^2) | Bubble sort, Selection sort | Simple nested loops |
Cubic | O(n^3) | Floyd-Warshall, 3-nested loops | Some DP, matrix operations |
Factorial | O(n!) | Traveling Salesman, permutations | Brute-force combinatorics |
- Always clarify which case you’re analyzing in interviews.
- Amortized analysis (e.g., dynamic array resizing) is also common. Why Big O? Big O notation helps you compare algorithms and predict performance as input size grows. Interviewers expect you to:
- Optimize when possible
- Justify trade-offs
Further Reading:
Data Structures & Algorithms
- Elements of Programming Interviews in Java (Beginner & Intermediate): In-depth problems and solutions. PDF
- Grokking the Coding Interview (Beginner & Intermediate): Pattern-based approach to common questions. Link
- Cracking the Coding Interview (Beginner & Intermediate): The classic interview prep book. PDF
- Coursera:
Object Oriented Design
- Grokking the Object-Oriented Design Interview: Real-world OOD patterns and problems. Link
System Design
Explore by Topic:
Sharpen your skills and benchmark yourself with real contest problems:
- Leetcode Contests (Biweekly & Weekly)
- Hackerrank Contests
- Google Kickstart (2020, 2021)
General Design Questions:
- Design Library Management System
- Design Parking Lot
- Design Call Center
- Design Hit Counter
- Design Linux Find Command
- Design ATM
- Design Movie Ticket System
- Design Pharmacy Shop
TODO:
- Browse by topic or company to find relevant problems.
- Read the code and comments for intuition and step-by-step logic.
- Practice by re-implementing solutions and timing yourself.
- Use the resources to fill knowledge gaps.
- Try contest problems for real-world speed and pressure.
- Fork the repository
- Do the desired changes (add/delete/modify)
- Make a pull request
- If there is no solution to a problem.
- If your solution is asymptotically faster than the one in the main branch.
- If your algorithm is of the same time complexity but with reduced code size, comment out the original solution and make a pull request with your solution.
All code in this repository is original and provided for educational purposes. Good luck with your interviews!