Roadmap
Pick where you want to go. Then walk there.
Different companies ask different kinds of questions. Everyone needs the shared core. After that, each kind of company gets its own list and its own plan. Tick problems off as you go; your progress stays in this browser.
The shared core
Everyone does these first.
Eighteen problems that teach the tricks every interview leans on: two fingers, sliding windows, the waiting line, asking your children, and writing answers in a chart.
In every interview
- Say the problem back in your own words, and ask about strange inputs.
- Work one small example by hand before you write code.
- Say the simple way first and how slow it is. Then find the clever way.
- Write the code while you talk. Then walk your example through it.
- Say the time and the extra room it needs, and one way to do better.
- 01Kadanes AlgoArray · Kadane running sum
- 02Find all pairs on integer array whose sum is equal to given numberArray · Hash map counting
- 03Merge IntervalsArray · Greedy by sorting
- 04Next PermutationArray · Two pointers
- 05Trapping Rain water problemArray · Two pointers
- 06Find the smallest window in a string containing all characters of another stringString · Sliding window
- 07Search in a rotated sorted arraySearching & Sorting · Binary search
- 08Write a Program to reverse the Linked List (Both Iterative and recursive)Linked List · Pointer flipping
- 09Write a program to Detect loop in a linked listLinked List · Fast and slow pointers
- 10Find the next Greater elementStacks & Queues · Monotonic stack
- 11Level order traversalBinary Trees · Breadth first search with a queue
- 12Find LCA in a Binary treeBinary Trees · Depth first search
- 13Check if a tree is a BST or notBinary Search Trees · Depth first search with bounds
- 14k largest element in an arrayHeap · Heap of size k
- 15Find the no. of IslandsGraph · Depth first search
- 16Implement Topological SortGraph · Topological sort
- 17Longest Common SubsequenceDynamic Programming · 2D dynamic programming
- 18Coin Change ProblemDynamic Programming · Unbounded knapsack
Quant and trading firms
The math olympiad of interviews.
Jane Street, Hudson River Trading, Citadel, Two Sigma, DRW, Optiver, IMC, SIG, XTX, Tower, Virtu, AQR, Radix, WorldQuant
Hard problems under a tight clock, often with a math or probability twist. They watch how you think out loud and whether your code is right the first time. Expect follow ups that change one rule and ask how your answer changes.
Topics to lean on
A plan
- Weeks 1 to 2: the shared core below, timed, with no hints.
- Weeks 3 to 4: dynamic programming, every must do problem, plus binary search on the answer.
- Weeks 5 to 6: bit tricks, greedy proofs (say why the greedy choice is safe), backtracking with pruning.
- Every week: mental math and probability puzzles outside this site, and two mock interviews where you explain while you type.
- 01Count InversionArray · Divide and conquer
- 02Aggressive cowsSearching & Sorting · Binary search on the answer
- 03Book Allocation ProblemSearching & Sorting · Binary search on the answer
- 04K-th Element of Two Sorted ArraysSearching & Sorting · Binary search on the answer
- 05Find the two non-repeating elements in an array of repeating elementsBit Manipulation · XOR tricks
- 06Count total set bits in all numbers from 1 to nBit Manipulation · Bit column counting
- 07Divide two integers without using multiplication, division and mod operatorBit Manipulation · Shift and subtract
- 08Power SetBit Manipulation · Bitmask enumeration
- 09Optimal Strategy for a GameDynamic Programming · Interval dynamic programming
- 10Maximum profit by buying and selling a share at most k timesDynamic Programming · 2D dynamic programming
- 11Boolean Parenthesization ProblemDynamic Programming · Interval dynamic programming
- 12Count Derangements (Permutation such that no element appears in its original position)Dynamic Programming · 1D dynamic programming
- 13Program for nth Catalan NumberDynamic Programming · 1D dynamic programming
- 14Egg Dropping ProblemDynamic Programming · 2D dynamic programming
- 15Maximum sum rectangle in a 2D matrixDynamic Programming · Kadane on column strips
- 16Job Sequencing ProblemGreedy · Greedy by sorting
- 17Fractional Knapsack ProblemGreedy · Greedy by sorting
- 18Detect Negative cycle in a graphGraph · Bellman-Ford
- 19Minimise the cashflow among a given set of friends who have borrowed money from each otherGraph · Greedy
- 20Partition of a set into K subsets with equal sumBacktracking · Backtracking with bitmask memo
AI labs and elite product teams
Build a small thing that really works.
Anthropic, OpenAI, Nvidia, Netflix, Roblox and similar teams
Practical coding: build a cache, a parser, a scheduler or a search box, then extend it when the interviewer adds a rule. Clean, tested code matters as much as the trick. Graphs, heaps, tries and careful design of small classes come up a lot.
Topics to lean on
A plan
- Weeks 1 to 2: the shared core below, written as clean classes with small tests.
- Weeks 3 to 4: design style problems: LRU cache, min stack, circular queue, phone directory with a trie.
- Weeks 5 to 6: graphs and heaps: task ordering, merging many sorted streams, spanning trees.
- Every week: one long problem where you keep adding features for an hour, the way these rounds work.
- 01LRU Cache ImplementationStacks & Queues · Hash map plus doubly linked list
- 02Design a Stack that supports getMin() in O(1) time and O(1) extra spaceStacks & Queues · Stack with an encoded minimum
- 03Implement a Circular queueStacks & Queues · Circular array with modulo
- 04Arithmetic Expression evaluationStacks & Queues · Two stacks for operators and numbers
- 05Implement a Phone DirectoryTrie · Trie
- 06Construct a trie from scratchTrie · Trie
- 07Find whether it is possible to finish all tasks or not from given dependenciesGraph · Topological sort
- 08Implement Kruskals AlgorithmGraph · Union find
- 09Clone a graphGraph · Hash map from old to new
- 10Merge K sorted arraysHeap · K way merge with a heap
- 11Smallest range in K ListsHeap · K way merge with a heap
- 12Median in a stream of IntegersHeap · Two heaps
- 13KMP AlgoString · Prefix function (KMP)
- 14Rabin Karp AlgoString · Rolling hash
- 15Huffman CodingGreedy · Greedy with a min heap
- 16Weighted Job SchedulingDynamic Programming · 1D dynamic programming
- 17Construct Binary Tree from String with Bracket RepresentationBinary Trees · Recursive parsing
Big tech
The classic exam, medium to hard.
Google, Meta, Microsoft, Apple, Amazon, Uber, Airbnb, Tesla, DoorDash, Coinbase, Block, PayPal
Two or three coding rounds of 45 minutes, usually one medium and one hard problem each. Trees, graphs, sliding windows, heaps and dynamic programming carry most of the weight. You must state the complexity and handle edge cases without being asked.
Topics to lean on
A plan
- Weeks 1 to 2: arrays, strings and the shared core below.
- Weeks 3 to 4: trees, BSTs and heaps, every must do problem.
- Weeks 5 to 6: graphs and dynamic programming, then backtracking.
- Weeks 7 to 8: mixed timed sets of two problems in 45 minutes, and mock interviews.
- 01Median of 2 sorted arrays of different sizeArray · Binary search on the answer
- 02Largest rectangular Area in HistogramStacks & Queues · Monotonic stack
- 03Maximum of all subarrays of size kHeap · Monotonic deque
- 04Merge K Sorted Linked ListsHeap · K way merge with a heap
- 05Dijkstra algoGraph · Dijkstra
- 06Given a sorted Dictionary of an Alien Language, find order of charactersGraph · Topological sort
- 07Count Strongly connected Components (Kosaraju Algo)Graph · Depth first search, two passes
- 08Cheapest Flights Within K StopsGraph · Bellman-Ford with limited rounds
- 09Word LadderGraph · Breadth first search
- 10Construct Binary tree from Inorder and preorder traversalBinary Trees · Divide and conquer
- 11Find all Duplicate subtrees in a Binary treeBinary Trees · Hash map of subtree shapes
- 12Diameter of a treeBinary Trees · Depth first search
- 13Largest BST in a Binary TreeBinary Search Trees · Postorder with return info
- 14Edit DistanceDynamic Programming · 2D dynamic programming
- 15Longest Palindromic SubstringDynamic Programming · Expand around center
- 16Longest Increasing SubsequenceDynamic Programming · Binary search on tails
- 17Word Break ProblemDynamic Programming · 1D dynamic programming
- 18Matrix Chain MultiplicationDynamic Programming · Interval dynamic programming
- 19Printing all solutions in N-Queen ProblemBacktracking · Backtracking
- 20Sudoku SolverBacktracking · Backtracking
Product companies
Solid mediums, explained clearly.
LinkedIn, Spotify, Dropbox, Pinterest, Notion, Figma, Discord, Plaid, Datadog, Asana, Cloudflare, Atlassian, Salesforce, Adobe, Oracle, eBay, Lyft, GitHub
Mostly medium problems on arrays, strings, hash maps, trees and breadth first search, often wrapped in a story about their product. Communication and working code count more than rare tricks.
Topics to lean on
A plan
- Weeks 1 to 2: arrays, strings, hash maps, and the shared core below.
- Weeks 3 to 4: stacks, queues, trees and breadth first search.
- Weeks 5 to 6: heaps, simple graphs, the easier dynamic programming problems, and mocks.
- 01Find longest consecutive subsequenceArray · Hash set lookups
- 02Find if there is any subarray with sum equal to 0Array · Prefix sum with a hash set
- 03Given a sequence of words, print all anagrams togetherString · Hash map grouping
- 04Longest Common PrefixString · Column by column scan
- 05LRU Cache ImplementationStacks & Queues · Hash map plus doubly linked list
- 06Minimum time required to rot all orangesStacks & Queues · Breadth first search with a queue
- 07Right View of TreeBinary Trees · Depth first search
- 08Zig-Zag traversal of a binary treeBinary Trees · Two stacks
- 09Find Kth smallest element in a BSTBinary Search Trees · Inorder traversal
- 10Merge K Sorted Linked ListsHeap · K way merge with a heap
- 11Implement BFS algorithmGraph · Breadth first search
- 12Clone a graphGraph · Hash map from old to new
- 13Longest Increasing SubsequenceDynamic Programming · Binary search on tails
- 14Word Break ProblemDynamic Programming · 1D dynamic programming
- 15Construct a trie from scratchTrie · Trie
Banks, finance and enterprise
Get the basics perfectly right.
JPMorgan, Goldman Sachs, Morgan Stanley, Capital One, Citi, Wells Fargo, Bank of America, BlackRock, IBM, Intel, Booking, Walmart, and IT services firms
Easier to medium problems, often on an online test first. Arrays, strings, linked lists, stacks, sorting and simple recursion. Clean code and correct edge cases beat fancy tricks.
Topics to lean on
A plan
- Week 1: arrays and strings.
- Week 2: linked lists, stacks and queues.
- Week 3: sorting, binary search and matrices.
- Week 4: trees basics, a few dynamic programming classics, and timed online test practice.
- 01Reverse the arrayArray · Two pointers
- 02Find the maximum and minimum element in an arrayArray · Compare in pairs
- 03Given an array which consists of only 0, 1 and 2. Sort the array without using any sorting algoArray · Three pointers
- 04Best time to buy and Sell stockArray · Running minimum
- 05Check whether a String is Palindrome or notString · Two pointers
- 06Balanced Parenthesis problemString · Stack
- 07Find Duplicate characters in a stringString · Hash map counting
- 08Find the middle Element of a linked listLinked List · Fast and slow pointers
- 09Remove Duplicates in a sorted Linked ListLinked List · Single pointer skip
- 10Implement Queue using StackStacks & Queues · Two stacks, lazy transfer
- 11Evaluation of Postfix expressionStacks & Queues · Stack evaluation
- 12Find first and last positions of an element in a sorted arraySearching & Sorting · Binary search
- 13Spiral traversal on a MatrixMatrix · Matrix simulation
- 14Height of a treeBinary Trees · Depth first search
- 15Find a value in a BSTBinary Search Trees · BST search
- 16Knapsack ProblemDynamic Programming · 2D dynamic programming