RoadmapDay 75 / 80
Interview PrepMonth 4 · Week 15

Day 75: Mock Interview 4: Dynamic Problem Solving

Practice adapting when a familiar-looking DSA problem turns out to need a different pattern than your first instinct — the realistic interview experience.

Mark this day complete

Study

Concepts

Real interviews rarely match a memorized pattern exactly

Weeks 3-4 and 13 taught you named patterns (two pointers, sliding window, DP shapes) as if problems announce which one applies — real interview problems are often DELIBERATELY a slight variation that breaks your first assumption, specifically to see whether you recognize the mismatch and adapt, rather than force-fitting a memorized template that does not actually work. Practicing recovery from a wrong first instinct is the actual skill this mock builds.

A strong recovery pattern: state your first approach and its complexity out loud, start implementing, and if you notice partway through that an assumption is violated (the array isn't sorted, values can be negative, the "window" isn't actually contiguous), SAY SO explicitly ("wait — this breaks the two-pointer assumption because X, let me reconsider") rather than silently backtracking or pushing through a broken approach hoping it works. Interviewers explicitly value visible self-correction over a lucky first guess.

See It

Visualizations

Visualization

The recovery loop when your first pattern guess is wrong

State first-instinct pattern + complexity out loud
Start implementing
Notice a broken assumption

say it out loud immediately, don't hide it

Re-derive from the broken constraint

what pattern actually fits now?

Build It

Code Examples

Three problems, each a deliberate near-miss on a pattern you know — attempt cold, timed 20 min each

text
1. "Find two numbers in an UNSORTED array that sum to a target."
   First instinct: two pointers (needs sorted!). Correct pattern once
   you notice the array isn't sorted: hash map (Day 11), OR sort first
   then two-pointer — state the complexity tradeoff between both.

2. "Find the longest substring with AT MOST 2 distinct characters,
   where 'distinct' should be case-insensitive."
   Looks like standard sliding window (Day 13) but the case-insensitive
   rule changes what goes into your frequency map's keys — a subtle
   trap that breaks a copy-pasted solution.

3. "Given intervals, find the MINIMUM number of intervals to remove
   so none overlap — but intervals can have EQUAL start times."
   Looks like Day 62's merge-intervals sort-by-start, but a tie-break
   rule is needed for equal starts, and sorting by END time (not start)
   is actually required for the greedy removal strategy to be correct
   here — notice which sort key the greedy proof actually depends on.

-> For each: state your first-instinct pattern OUT LOUD, then explicitly
   flag the moment you notice the mismatch, then adapt.

Remember

Key Takeaways

  • Real problems are often deliberate near-misses on a memorized pattern — practicing the mismatch, not just the pattern, is the point of this mock.
  • State your first-instinct approach and its complexity out loud before implementing — this makes a later correction visible and credible, not evasive.
  • Explicitly voice a broken assumption the moment you notice it ("wait, this isn't sorted") rather than silently backtracking.
  • Interviewers value visible self-correction highly — it is a stronger signal than an immediately-correct first guess with no reasoning shown.
  • After each mock, name specifically which ASSUMPTION broke your first instinct — that is more useful to record than "I got it wrong".

Do It

Practice

  1. 1Attempt all three problems above cold, timed to 20 minutes each, narrating your first instinct and the moment you catch the mismatch.
  2. 2For one problem you've already solved earlier in this roadmap, write a deliberately modified version that breaks its original pattern, and solve your own variant.
  3. 3Keep a running list titled "assumptions that broke my first instinct" and review it before your next DSA-focused mock.