Limited time: AI code review, hints, mock interviews, whiteboard analysis, and all Pro features are unlocked. Enroll
⏱️ 8 min read

Quick-Fire 50 - Interview Cheatsheet

The 50 problems that show up most in FAANG + Indian tech interviews (Amazon, Google, Meta, PhonePe, Flipkart, Uber). Bookmark this page and review before every interview.

Which list should I use?

  • 1 week of prep? β†’ You’re here. Quick-Fire 50.
  • 4 weeks of prep? β†’ The Blind 75 (includes all 50 + 25 more)
  • 8 weeks of prep? β†’ NeetCode 150 (most comprehensive)
  • Already confident on the patterns? β†’ The Hard List (hard-only, all 20 patterns)

πŸ’‘ How to use: Scan the β€œApproach” column. If you can’t explain it in 10 seconds, that’s the one to practice.


Arrays & Hashing

# Problem Approach Time Space
1 Two Sum HashMap: store complement, lookup on each element O(n) O(n)
2 Best Time to Buy/Sell Stock Track min price so far, compute profit at each step O(n) O(1)
3 Contains Duplicate HashSet - add and check O(n) O(n)
4 Product of Array Except Self Left-pass prefix product + right-pass suffix product O(n) O(1)*
5 Maximum Subarray (Kadane) Track currentMax = max(num, currentMax + num) O(n) O(1)
6 Group Anagrams Sort each word β†’ use as HashMap key O(nΒ·k log k) O(nΒ·k)
7 Top K Frequent Elements HashMap count + min-heap of size K (or bucket sort) O(n log k) O(n)
8 Encode/Decode Strings Length-prefix each string: "4#word" O(n) O(1)

Two Pointers

# Problem Approach Time Space
9 Valid Palindrome Left/right pointers, skip non-alphanumeric, compare O(n) O(1)
10 3Sum Sort + fix one, two-pointer on rest. Skip duplicates. O(nΒ²) O(1)
11 Container With Most Water Left/right, move the shorter side inward O(n) O(1)
12 Trapping Rain Water Two pointers with leftMax/rightMax tracking O(n) O(1)

Sliding Window

# Problem Approach Time Space
13 Longest Substring Without Repeating Window + HashMap (last seen index), jump left on conflict O(n) O(128)
14 Minimum Window Substring Expand right until valid, shrink left to minimize O(n) O(128)
15 Longest Repeating Character Replacement Window where len - maxFreq <= k O(n) O(26)
16 Sliding Window Maximum Monotonic decreasing deque O(n) O(k)

Stack

# Problem Approach Time Space
17 Valid Parentheses Push open, pop on close, check match O(n) O(n)
18 Daily Temperatures Monotonic stack: pop when current > top O(n) O(n)
19 Largest Rectangle in Histogram Monotonic stack for next-smaller on both sides O(n) O(n)
20 Min Stack Two stacks: values + running minimum O(1) all ops O(n)
# Problem Approach Time Space
21 Search in Rotated Sorted Array Binary search - check which half is sorted O(log n) O(1)
22 Find Minimum in Rotated Array Binary search - shrink toward the unsorted half O(log n) O(1)
23 Koko Eating Bananas Binary search on answer (speed), check feasibility O(n log m) O(1)
24 Median of Two Sorted Arrays Binary search on partition of smaller array O(log min(m,n)) O(1)

Linked List

# Problem Approach Time Space
25 Reverse Linked List Iterative: prev/curr/next pointers O(n) O(1)
26 Linked List Cycle Fast/slow pointers (Floyd’s) O(n) O(1)
27 Merge Two Sorted Lists Dummy head, compare and advance O(n+m) O(1)
28 LRU Cache HashMap + doubly-linked list (or LinkedHashMap) O(1) all ops O(cap)

Trees

# Problem Approach Time Space
29 Invert Binary Tree Recursive: swap left/right children O(n) O(h)
30 Maximum Depth of Binary Tree DFS: 1 + max(left, right) O(n) O(h)
31 Lowest Common Ancestor If both in left β†’ go left. Both right β†’ go right. Else current. O(n) O(h)
32 Validate BST DFS with (min, max) bounds O(n) O(h)
33 Level Order Traversal BFS with queue, process level-by-level O(n) O(n)
34 Serialize/Deserialize Binary Tree Preorder with nulls marked as β€œ#” O(n) O(n)

Graphs

# Problem Approach Time Space
35 Number of Islands BFS/DFS from each β€˜1’, mark visited O(mΓ—n) O(mΓ—n)
36 Clone Graph BFS/DFS + HashMap (old node β†’ new node) O(V+E) O(V)
37 Course Schedule Topological sort (BFS Kahn’s or DFS cycle detection) O(V+E) O(V+E)
38 Word Ladder BFS level-by-level, change one char at a time O(nΒ·26Β·L) O(nΒ·L)
39 Dijkstra’s Shortest Path Min-heap + relaxation O((V+E) log V) O(V)

Dynamic Programming

# Problem Approach Time Space
40 Climbing Stairs dp[i] = dp[i-1] + dp[i-2] (Fibonacci) O(n) O(1)
41 Coin Change dp[i] = min(dp[i-coin]+1) for each coin O(amountΓ—coins) O(amount)
42 Longest Increasing Subsequence DP: O(nΒ²) or patience sort with binary search: O(n log n) O(n log n) O(n)
43 Word Break dp[i] = any dp[j] && s[j:i] in dict O(nΒ²Β·L) O(n)
44 House Robber dp[i] = max(dp[i-1], dp[i-2] + nums[i]) O(n) O(1)
45 Edit Distance 2D DP: insert/delete/replace at each (i,j) O(mΓ—n) O(mΓ—n)

Greedy / Intervals

# Problem Approach Time Space
46 Merge Intervals Sort by start, extend end if overlapping O(n log n) O(n)
47 Meeting Rooms II Sort starts + ends separately, sweep with counter O(n log n) O(n)
48 Jump Game Track farthest reachable index O(n) O(1)
49 Non-Overlapping Intervals Sort by end, greedily keep earliest-ending O(n log n) O(1)
50 Task Scheduler Count max-freq task, compute idle slots O(n) O(26)

Pattern Recognition Cheatsheet

If you see… Try this pattern
β€œSorted array + find pair/target” Two Pointers
β€œContiguous subarray/substring with constraint” Sliding Window
β€œFind minimum/maximum that satisfies condition” Binary Search on Answer
β€œShortest path in unweighted graph” BFS
β€œAll combinations/permutations” Backtracking (DFS)
β€œOverlapping subproblems + optimal substructure” Dynamic Programming
β€œNext greater/smaller element” Monotonic Stack
β€œConnected components / merge groups” Union-Find
β€œTask dependencies / ordering” Topological Sort
β€œPrefix matching / dictionary” Trie
β€œIntervals overlap/merge” Sort by start + sweep
β€œTop K / Kth largest” Heap (Priority Queue)

Complexity Quick Reference

Structure Access Search Insert Delete
Array O(1) O(n) O(n) O(n)
HashMap - O(1) avg O(1) avg O(1) avg
BST (balanced) - O(log n) O(log n) O(log n)
Heap O(1) peek O(n) O(log n) O(log n)
Stack/Queue O(1) top O(n) O(1) O(1)
Sort Best Average Worst Stable?
Merge Sort O(n log n) O(n log n) O(n log n) Yes
Quick Sort O(n log n) O(n log n) O(nΒ²) No
Heap Sort O(n log n) O(n log n) O(n log n) No
Tim Sort (Java/Python default) O(n) O(n log n) O(n log n) Yes

The 10 β€œMust-Solve-First” Problems

If you only have 3 days, solve these - they cover the most patterns with the least problems:

  1. Two Sum (HashMap)
  2. Best Time to Buy/Sell Stock (Greedy/Kadane)
  3. Longest Substring Without Repeating (Sliding Window)
  4. 3Sum (Two Pointers + Sort)
  5. Merge Intervals (Sort + Sweep)
  6. Number of Islands (BFS/DFS)
  7. Coin Change (DP)
  8. LRU Cache (HashMap + DLL)
  9. Course Schedule (Topological Sort)
  10. Valid Parentheses (Stack)

Bookmark this page. Review it 30 minutes before every coding interview.

Want detailed solutions? Check the DSA problems section.

Free system design + DSA prep. If it helped you crack an interview, consider supporting.

SensAI SensAI
Beta
Listening...
Tap mic to stop voice mode

Shape what we build next

Every piece of feedback is read by the team and directly influences our roadmap.

What type of feedback?

Install SystemCraft

Add to your home screen for instant access, offline reading, and a distraction-free experience.

Offline reading Faster loads No browser tabs App-like feel

Unlock AI Features

One click to activate - no payment, no credit card. Just sign in and you're in.

AI code review and hints
SensAI chat assistant
AI mock interviews
Whiteboard analysis
100% free during early access