Coding interview prep

Interview Problems

Classic problems asked by big tech companies, each solved the easy way: understand the problem, try brute force, spot the pattern, then write the clean solution in Python.

51 problems 20 patterns

New to DSA? Learn the patterns first ❯

Solved # Problem Pattern Difficulty Often asked at
1 Two Sum Hashing Easy Amazon, Google, Meta, Microsoft, Apple, Adobe
2 Contains Duplicate Hashing Easy Amazon, Apple, Microsoft, Adobe, Yahoo
3 Valid Anagram Hashing Easy Amazon, Google, Microsoft, Bloomberg, Uber
4 Group Anagrams Hashing Medium Amazon, Meta, Google, Microsoft, Uber, Goldman Sachs
5 Top K Frequent Elements Heap Medium Amazon, Meta, Google, Microsoft, Yelp, Oracle
6 Product of Array Except Self Prefix Sum Medium Amazon, Meta, Microsoft, Apple, Asana, Lyft
7 Longest Consecutive Sequence Hashing Medium Google, Amazon, Meta, Microsoft, Spotify
8 Valid Palindrome Two Pointers Easy Meta, Amazon, Microsoft, Apple, Spotify
9 Container With Most Water Two Pointers Medium Amazon, Google, Meta, Microsoft, Goldman Sachs, Adobe
10 3Sum Two Pointers Medium Meta, Amazon, Google, Microsoft, Apple, Adobe, Bloomberg
11 Trapping Rain Water Two Pointers Hard Amazon, Google, Goldman Sachs, Meta, Microsoft, Apple, Bloomberg
12 Best Time to Buy and Sell Stock Greedy Easy Amazon, Meta, Microsoft, Google, Goldman Sachs, Bloomberg, Uber
13 Longest Substring Without Repeating Characters Sliding Window Medium Amazon, Google, Meta, Microsoft, Bloomberg, Adobe, Apple
14 Minimum Window Substring Sliding Window Hard Meta, Google, Amazon, LinkedIn, Uber, Airbnb, Microsoft
15 Subarray Sum Equals K Prefix Sum Medium Meta, Google, Amazon, Microsoft, Goldman Sachs, Twitter
16 Maximum Subarray Kadane Medium Amazon, Microsoft, Apple, LinkedIn, Google, Bloomberg, Cisco
17 Binary Search Binary Search Easy Google, Amazon, Microsoft, Apple, Meta, Adobe
18 Search in Rotated Sorted Array Binary Search Medium Meta, Amazon, Microsoft, Google, LinkedIn, Bloomberg, Uber
19 Koko Eating Bananas Binary Search Medium Google, Amazon, Meta, Airbnb, DoorDash
20 Valid Parentheses Stack Easy Amazon, Google, Meta, Microsoft, Bloomberg, LinkedIn, Spotify
21 Min Stack Stack Medium Amazon, Bloomberg, Microsoft, Google, Oracle
22 Daily Temperatures Monotonic Stack Medium Amazon, Google, Meta, Microsoft, Uber, Bloomberg
23 Largest Rectangle in Histogram Monotonic Stack Hard Google, Amazon, Microsoft, Meta, Uber, Goldman Sachs
24 Reverse Linked List Linked List Easy Amazon, Microsoft, Apple, Google, Meta, Adobe, Yahoo
25 Merge Two Sorted Lists Linked List Easy Amazon, Microsoft, Apple, Google, Meta, Adobe, Bloomberg
26 Linked List Cycle Fast & Slow Pointers Easy Amazon, Microsoft, Bloomberg, Goldman Sachs, Oracle, Yahoo
27 LRU Cache Hashing Medium Amazon, Microsoft, Meta, Google, Apple, Oracle, Uber, Salesforce
28 Maximum Depth of Binary Tree Trees Easy Amazon, LinkedIn, Microsoft, Google, Apple, Adobe
29 Invert Binary Tree Trees Easy Google, Amazon, Meta, Microsoft, Apple
30 Binary Tree Level Order Traversal Trees Medium Amazon, Meta, Microsoft, LinkedIn, Bloomberg, Apple
31 Validate Binary Search Tree BST Medium Amazon, Meta, Microsoft, Bloomberg, Google, Apple
32 Lowest Common Ancestor of a Binary Tree Trees Medium Meta, Amazon, Microsoft, LinkedIn, Google, Apple
33 Kth Largest Element in an Array Heap Medium Meta, Amazon, Microsoft, Google, LinkedIn, Spotify
34 Merge k Sorted Lists Heap Hard Amazon, Meta, Google, Microsoft, Uber, LinkedIn, Airbnb
35 Number of Islands Grids Medium Amazon, Google, Microsoft, Meta, Uber, Bloomberg, Apple, Oracle
36 Rotting Oranges Grids Medium Amazon, Microsoft, Google, Meta, Bloomberg
37 Course Schedule Topological Sort Medium Amazon, Google, Meta, Microsoft, Uber, Apple, Airbnb
38 Network Delay Time Graphs Medium Google, Amazon, Microsoft, Uber, Akamai
39 Word Ladder Graphs Hard Amazon, Meta, Google, LinkedIn, Microsoft, Snapchat
40 Subsets Backtracking Medium Meta, Amazon, Google, Microsoft, Bloomberg, Uber
41 Permutations Backtracking Medium Microsoft, Amazon, Meta, Google, LinkedIn, Bloomberg
42 Combination Sum Backtracking Medium Amazon, Airbnb, Meta, Microsoft, Uber, Snapchat
43 Climbing Stairs Dynamic Programming Easy Amazon, Google, Adobe, Apple, Microsoft, Uber
44 House Robber Dynamic Programming Medium Amazon, Google, Microsoft, Cisco, Airbnb, Apple
45 Coin Change Dynamic Programming Medium Amazon, Google, Microsoft, Goldman Sachs, Apple, Bloomberg, Paytm
46 Longest Increasing Subsequence Dynamic Programming Medium Microsoft, Amazon, Google, Meta, Apple, Samsung
47 Longest Common Subsequence Dynamic Programming Medium Amazon, Google, Microsoft, Meta, Bloomberg, Adobe
48 Edit Distance Dynamic Programming Hard Google, Amazon, Microsoft, Meta, Bloomberg, Grammarly
49 Merge Intervals Intervals Medium Google, Meta, Amazon, Microsoft, Bloomberg, LinkedIn, Salesforce
50 Meeting Rooms II Intervals Medium Google, Amazon, Meta, Microsoft, Uber, Bloomberg, Oracle
51 Jump Game Greedy Medium Amazon, Microsoft, Google, Meta, Apple, Adobe

Company names show where a problem is commonly reported in interviews. Questions vary by team and year, so learn the pattern rather than memorising answers.