Interview questions
Coding quant interview questions
27 interview-style coding problems, ordered from easy to hard.
Coding questions in quant interviews focus on clean, efficient solutions to problems with a mathematical flavour: simulations, dynamic programming, combinatorial search, numerical methods and data manipulation. Quant developer and research candidates are expected to reason about time and space complexity and to verify results against an analytical answer where one exists. This topic collects interview-style coding and algorithm problems written as original QuantSolve content, from warm-ups to harder optimisation problems. Free problems include hints and worked solutions describing the algorithm and why it is correct. Use them alongside the probability and expected value sections, since many coding rounds ask you to simulate or compute a quantity you could also derive by hand, then compare the two answers.
Practice Coding interactivelyEasy (15)
- Worst-Case Binary Search Comparisons · Search
- Binary Search Comparisons for 1024 Elements · Search
- Time Complexity of Merge Sort · Sorting
- Two-Sum With a Hash Set · Hashing
- Solving T(n) = T(n/2) + 1 · Recurrences
- Solving T(n) = T(n-1) + 1 · Recurrences
- Maximum Nodes in a Binary Tree of Bounded Depth · Trees
- Binary Heap Insertion Complexity · Heaps
- Shortest Paths in an Unweighted Graph · Graph Traversal
- Edge Weight Requirement for Dijkstra's Algorithm · Shortest Paths
- Existence of a Topological Ordering · Graph Theory
- Guaranteed Repeats by the Pigeonhole Principle · Combinatorial Reasoning
- Expected Hash Table Lookup Complexity · Hashing
- Maximum Edges in a Simple Graph · Graph Theory
- Identifying a Tree by Edge Count · Graph Theory
Medium (9)
- Coin Flips Needed to Simulate a Fair Die · Randomness
- Probability of No Hash Collisions · Hashing
- Streaming kth Largest Element · Heaps
- Complexity of Floyd's Cycle Detection · Linked Lists
- Why Random Swaps Do Not Uniformly Shuffle · Randomized Algorithms
- Solving T(n) = 2T(n/2) + n · Recurrences
- Leaves and Internal Nodes in a Full Binary Tree · Trees
- Simulating a Five-Sided Die With Coin Flips · Randomness
- Finding a Majority Element · Arrays