Your star helps keep this collection updated with fresh interview questions. Follow for notifications on new resources that could help you land your dream tech job.
🚨 NEW: Check out System Design Interview Guide and Most Recently Asked FAANG Questions including OpenAI and Tesla! 🚨
A curated collection of coding and system design questions asked at top tech companies. Helping you ace your next interview!
- Top 75 LeetCode Questions to Crack The Coding Interviews
- Python Programming Language Resources to Learn
- Most Recently Asked Questions at FAANG and other top companies
- System Design Interview Guide
- LLM Papers Cheatsheet for Beginners and Experts - Essential Research Papers for LLMs
- Complete Machine Learning Interview Preparation Guide for Beginners to Experts
SNo. | Contents |
---|---|
1. | FAANG Must Do Problems |
2. | Amazon |
3. | Microsoft |
4. | |
5. | Google Top 50 |
6. | |
7. | |
8. | Flipkart |
9. | Netflix |
10. | Machine Learning & AI Resources |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Two Sum | Easy | O(n) | O(n) |
2 | Longest Substring Without Repeating Characters | Medium | O(n) | O(min(m,n)) |
3 | Longest Palindromic Substring | Medium | O(n²) | O(1) |
4 | Container With Most Water | Medium | O(n) | O(1) |
5 | 3Sum | Medium | O(n²) | O(1) |
6 | Remove Nth Node From End of List | Medium | O(n) | O(1) |
7 | Valid Parentheses | Easy | O(n) | O(n) |
8 | Merge Two Sorted Lists | Easy | O(n+m) | O(1) |
9 | Merge k Sorted Lists | Hard | O(n log k) | O(1) |
10 | Search in Rotated Sorted Array | Medium | O(log n) | O(1) |
11 | Combination Sum | Medium | O(2ⁿ) | O(n) |
12 | Rotate Image | Medium | O(n²) | O(1) |
13 | Group Anagrams | Medium | O(n k log k) | O(n k) |
14 | Maximum Subarray | Easy | O(n) | O(1) |
15 | Spiral Matrix | Medium | O(m×n) | O(1) |
16 | Jump Game | Medium | O(n) | O(1) |
17 | Merge Intervals | Medium | O(n log n) | O(n) |
18 | Insert Interval | Medium | O(n) | O(n) |
19 | Unique Paths | Medium | O(m×n) | O(m×n) |
20 | Climbing Stairs | Easy | O(n) | O(1) |
21 | Set Matrix Zeroes | Medium | O(m×n) | O(1) |
22 | Minimum Window Substring | Hard | O(n) | O(k) |
23 | Word Search | Medium | O(m×n×4ᵏ) | O(k) |
24 | Decode Ways | Medium | O(n) | O(n) |
25 | Validate Binary Search Tree | Medium | O(n) | O(h) |
26 | Same Tree | Easy | O(n) | O(h) |
27 | Binary Tree Level Order Traversal | Medium | O(n) | O(n) |
28 | Maximum Depth of Binary Tree | Easy | O(n) | O(h) |
29 | Construct Binary Tree from Preorder and Inorder Traversal | Medium | O(n) | O(n) |
30 | Best Time to Buy and Sell Stock | Easy | O(n) | O(1) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Two Sum | Easy | O(n) | O(n) |
2 | Add Two Numbers | Medium | O(max(m,n)) | O(max(m,n)) |
3 | Longest Substring Without Repeating Characters | Medium | O(n) | O(min(m,n)) |
4 | Median of Two Sorted Arrays | Hard | O(log(min(m,n))) | O(1) |
5 | Longest Palindromic Substring | Medium | O(n²) | O(1) |
6 | ZigZag Conversion | Medium | O(n) | O(n) |
7 | String to Integer (atoi) | Medium | O(n) | O(1) |
8 | 3Sum | Medium | O(n²) | O(1) or O(n) |
9 | Letter Combinations of a Phone Number | Medium | O(4ⁿ) | O(n) |
10 | Valid Parentheses | Easy | O(n) | O(n) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Two Sum | Easy | O(n) | O(n) |
2 | Add Two Numbers | Medium | O(max(m,n)) | O(max(m,n)) |
3 | Median of Two Sorted Arrays | Hard | O(log(min(m,n))) | O(1) |
4 | Longest Palindromic Substring | Medium | O(n²) | O(1) |
5 | String to Integer (atoi) | Medium | O(n) | O(1) |
6 | Roman to Integer | Easy | O(n) | O(1) |
7 | 3Sum | Medium | O(n²) | O(1) or O(n) |
8 | Valid Parentheses | Easy | O(n) | O(n) |
9 | Merge Two Sorted Lists | Easy | O(n+m) | O(1) |
10 | Merge k Sorted Lists | Hard | O(n log k) | O(1) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Regular Expression Matching | Hard | O(m×n) | O(m×n) |
2 | Roman to Integer | Easy | O(n) | O(1) |
3 | 3Sum | Medium | O(n²) | O(1) or O(n) |
4 | Letter Combinations of a Phone Number | Medium | O(4ⁿ) | O(n) |
5 | Valid Parentheses | Easy | O(n) | O(n) |
6 | Merge k Sorted Lists | Hard | O(n log k) | O(1) |
7 | Reverse Nodes in k-Group | Hard | O(n) | O(1) |
8 | Remove Duplicates from Sorted Array | Easy | O(n) | O(1) |
9 | Implement strStr() | Easy | O(n×m) | O(1) |
10 | Search in Rotated Sorted Array | Medium | O(log n) | O(1) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Two Sum | Easy | O(n) | O(n) |
2 | Insert Interval | Medium | O(n) | O(n) |
3 | Text Justification | Hard | O(n) | O(n) |
4 | Minimum Window Substring | Hard | O(n) | O(k) |
5 | Maximal Rectangle | Hard | O(m×n) | O(n) |
6 | The Skyline Problem | Hard | O(n log n) | O(n) |
7 | Maximal Square | Medium | O(m×n) | O(m×n) |
8 | Find Median from Data Stream | Hard | O(log n) insert, O(1) find | O(n) |
9 | Bulls and Cows | Medium | O(n) | O(1) |
10 | Count of Smaller Numbers After Self | Hard | O(n log n) | O(n) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Two Sum | Easy | O(n) | O(n) |
2 | Insert Interval | Medium | O(n) | O(n) |
3 | Text Justification | Hard | O(n) | O(n) |
4 | Minimum Window Substring | Hard | O(n) | O(k) |
5 | Maximal Rectangle | Hard | O(m×n) | O(n) |
6 | The Skyline Problem | Hard | O(n log n) | O(n) |
7 | Maximal Square | Medium | O(m×n) | O(m×n) |
8 | Find Median from Data Stream | Hard | O(log n) insert, O(1) find | O(n) |
9 | Bulls and Cows | Medium | O(n) | O(1) |
10 | Count of Smaller Numbers After Self | Hard | O(n log n) | O(n) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Nested List Weight Sum II | Medium | O(n) | O(n) |
2 | Shortest Word Distance II | Medium | O(n) | O(n) |
3 | Closest Binary Search Tree Value II | Medium | O(n) | O(n) |
4 | Two Sum III - Data structure design | Easy | O(n) | O(n) |
5 | Nested List Weight Sum | Medium | O(n) | O(n) |
6 | Max Stack | Medium | O(n) | O(n) |
7 | Find Leaves of Binary Tree | Medium | O(n) | O(n) |
8 | All O'one Data Structure | Hard | O(1) for each operation | O(n) |
9 | Can Place Flowers | Easy | O(n) | O(1) |
10 | Factor Combinations | Medium | O(2ⁿ) | O(n) |
11 | Paint House | Medium | O(n) | O(1) |
12 | Paint House II | Hard | O(n×k) | O(n) |
13 | Evaluate Reverse Polish Notation | Medium | O(n) | O(n) |
14 | Shortest Word Distance | Easy | O(n) | O(1) |
15 | Text Justification | Hard | O(n) | O(n) |
16 | Count Different Palindromic Subsequences | Hard | O(n²) | O(n²) |
17 | Binary Tree Upside Down | Medium | O(n) | O(n) |
18 | Max Points on a Line | Hard | O(n²) | O(n) |
19 | Partition to K Equal Sum Subsets | Hard | O(n×2^n) | O(n) |
20 | Insert Delete GetRandom O(1) | Medium | O(1) for each operation | O(n) |
21 | Number of Islands | Medium | O(m×n) | O(m×n) |
22 | Exclusive Time of Functions | Medium | O(n) | O(n) |
23 | Valid Triangle Number | Medium | O(n²) | O(1) |
24 | Valid Number | Medium | O(n) | O(1) |
25 | Repeated DNA Sequences | Medium | O(n) | O(n) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | Add Two Numbers | Medium | O(max(m,n)) | O(max(m,n)) |
View Problems
No. | Problem | Difficulty | Time Complexity | Space Complexity |
---|---|---|---|---|
1 | LRU Cache | Medium | O(1) for each operation | O(n) |
2 | Department Top Three Salaries | Hard | O(n log k) | O(n) |
A curated list of coding questions asked in FAANG, OpenAI, Tesla, and other top tech company interviews. This repository aims to help you prepare effectively for technical interviews.
Looking for system design interview questions? Check out our comprehensive guide:
System Design Interview Guide - A curated list of the top 25 must-do system design problems for tech interviews with complexity ratings and company-specific information.
Contributions are welcome! Please feel free to submit a pull request.
If you found this repository helpful, please consider following me:
- GitHub: @ombharatiya
- Twitter: @ombharatiya
- LinkedIn: ombharatiya
I regularly share tech interview preparation resources, coding tips, and career advice for developers aiming for top tech companies. Your support means a lot! ⭐
This project is licensed under the GPL-3.0 license - see the LICENSE file for details.