DSA Interview Guide

Learn how strong engineers approach algorithmic problems — and how to recognize good and bad problem-solving strategies.

Only have 10 minutes?

Three questions that expose how someone thinks. Read the strong answer, then check yourself against the flags.

Q1 — Recognizing the approach from an array and a target

“Given an array and a target, how would you determine which algorithmic approach to use?”

Tests
  • · Whether the candidate interrogates the input before reaching for an algorithm.
  • · Whether they can map concrete properties (sorted, bounded, positive-only) to concrete techniques.
  • · Whether they use constraints (n) to decide which complexity is acceptable.
  • · Whether they think in terms of a decision procedure rather than recalling one memorized problem.
Q2 — Deciding whether O(n²) can be improved

“Your first solution is O(n²). How would you determine whether it can be improved?”

Tests
  • · Whether the candidate has a repeatable optimization procedure rather than a bag of tricks.
  • · Whether they can locate the bottleneck (the inner loop) and characterize what it computes.
  • · Whether they know lower-bound reasoning: some problems are genuinely quadratic in output size.
  • · Whether they reason about redundant work: recomputation, repeated scans, repeated lookups.
Q3 — Choosing between BFS, DFS, Dijkstra and DP

“How do you decide between BFS, DFS, Dijkstra, and Dynamic Programming?”

Tests
  • · Whether the candidate sees these as answers to different questions rather than interchangeable tools.
  • · Whether they know the precise precondition of each (unweighted, non-negative weights, acyclic subproblem graph).
  • · Whether they can recognize that DP is shortest path on a DAG, and BFS is Dijkstra with unit weights.
  • · Whether they can state complexity in terms of V and E.

The central loop

Every question, problem and assessment here rewards this process — not memorized names.

  1. Problem
  2. Clarify
  3. Constraints
  4. Brute Force
  5. Bottleneck
  6. Pattern
  7. Algorithm
  8. Complexity
  9. Code
  10. Test
  11. Improve
What we reward
Asking good questions, understanding constraints, identifying patterns, comparing solutions, explaining tradeoffs, debugging systematically, recognizing edge cases, communicating clearly.
What we don't punish
Syntax mistakes, forgetting an obscure algorithm's name, a different implementation style. Reasoning ability matters more than recall.

Skill levels

Click a level to see expected knowledge, example questions, required patterns, typical mistakes and what to learn next.

IntermediateRecognizes the common patterns on sight, explains complexity, and turns a brute force into an optimized solution.
Typical signals
  • Recognizes common patterns from problem phrasing: contiguous subarray → sliding window, sorted pairs → two pointers, nearest greater → monotonic stack.
  • Comfortable with binary search, two pointers, sliding window, BFS/DFS, heaps, and basic 1D/2D DP.
  • Explains time and space complexity, including recursion stack and the cost of auxiliary structures.
  • Optimizes a brute force by naming the redundant work and replacing it with the right structure.
  • Handles edge cases systematically rather than on request: empty, single, all equal, extremes.
Expected knowledge
  • The two binary-search templates and binary search on the answer with a monotonic feasibility check.
  • Sliding window invariants and why negative numbers break sum-based windows.
  • BFS for shortest paths on unweighted graphs; DFS for reachability, components, and cycle detection.
  • Heap operations, top-K with a size-K min-heap, and the O(n log k) bound.
  • Prefix sums and the prefix-plus-hash-map idiom for subarray sum problems.
  • Memoization versus tabulation, and defining the state before writing a transition.
  • Sorting complexities and stability; when sorting unlocks two pointers.
  • Amortized analysis for dynamic arrays and monotonic stacks.
Typical mistakes
  • Applies a pattern by resemblance without checking its precondition (unsorted two pointers, non-monotone window).
  • Uses DFS for shortest paths or Dijkstra for unweighted graphs.
  • Defines a DP transition without a clear meaning for the state.
  • Reports O(n) for a monotonic stack "because it is usually fast" instead of the push/pop argument.
  • Optimizes constants when the asymptotic bound is the problem, or vice versa.

Tier 1 — Fundamentals

Questions that test whether someone understands the basic mechanics of algorithms and data structures.

All 7 →

Tier 2 — Algorithmic Pattern Recognition

These questions test whether someone can recognize the underlying structure of a problem instead of blindly trying algorithms.

All 9 →

Tier 3 — Advanced Algorithms & Systematic Reasoning

Deeper understanding: branching decisions, DP state design, greedy vs DP, correctness.

All 6 →

Green flags · Red flags

The lens used across the entire guide.

Green flags
  • Clarifies requirements before solving
  • Checks constraints and derives an acceptable complexity
  • Starts with brute force, then names the bottleneck
  • Derives the optimization instead of recalling it
  • Explains time and space complexity
  • Discusses tradeoffs and alternatives
  • Tests edge cases deliberately
  • Explains why the algorithm is correct
Red flags
  • Immediately writes code
  • Memorizes an algorithm without explaining why it applies
  • Ignores constraints
  • Says "this is the fastest" without analysis
  • Cannot explain complexity or correctness
  • Uses advanced structures unnecessarily
  • Optimizes before understanding the problem
  • Ignores edge cases
Full red-flag reference →

Practice modes

The interview flow

Mock interviews walk you through these stages and highlight where you are.

  1. 1Problem
  2. 2Clarifying Questions
  3. 3Constraints
  4. 4Brute Force
  5. 5Complexity Analysis
  6. 6Pattern Recognition
  7. 7Optimized Solution
  8. 8Implementation
  9. 9Testing
  10. 10Follow-Up
  11. 11Evaluation

Your readiness

Full dashboard →
No signals yet. Run a mock interview, an assessment or the quick-fire quiz to start building your readiness profile.