DAY 29 / 30 · WEEK 4

Mock Interview Day

Goal of the day

Concept

Every pattern in this course has been taught untimed, one at a time, with the day's title already telling you the answer. A real interview gives you none of that — a problem, a blank editor, and a clock that's usually somewhere between 20 and 45 minutes for a single question, onsite rounds sometimes tighter. The skill this builds isn't new algorithm knowledge; it's calibrating how much time each phase of solving actually takes when someone is watching and the clock is real.

Use each timer exactly like a real interview: press Start, then say your plan out loud (even alone, actually say it) before typing anything. If the buzzer hits zero before you're done, that's useful data, not a failure — note which phase ate the time (usually either clarifying too long, or debugging code that skipped the "trace it by hand first" step) and keep going anyway. The full solution and walkthrough are available any time via the reveal buttons, timer running or not.

Diagram: how to spend a 25-minute clock

A 25-minute problem, budgeted by phase 2m 3m 5m 10m 5m Clarify the problem and constraints out loud State a brute-force approach and its complexity Identify the actual pattern, name it, explain why Write the code Trace a test case by hand, check edge cases Scale this to whatever time you're actually given — the ratios matter more than the minutes.

4 timed mock-interview problems

Press Start, then work the problem for real before revealing anything. All 4 are Medium — the typical difficulty of a real onsite round.

1. Longest Palindromic Substring (Medium — LeetCode: Longest Palindromic Substring)

Given a string, return its longest palindromic substring. Suggested time: 20 minutes.

20:00

Press Start when you begin working the problem.

2. Merge Intervals (Medium — LeetCode: Merge Intervals)

Given a list of intervals, merge all overlapping intervals and return the merged list. Suggested time: 20 minutes.

20:00

Press Start when you begin working the problem.

3. Rotting Oranges (Medium — LeetCode: Rotting Oranges)

Given a grid where each cell is empty (0), a fresh orange (1), or a rotten orange (2), and every minute a rotten orange rots its fresh orange neighbors, return the minimum minutes until no fresh orange remains, or -1 if that's impossible. Suggested time: 20 minutes.

20:00

Press Start when you begin working the problem.

4. Longest Common Subsequence (Medium — LeetCode: Longest Common Subsequence)

Given two strings, return the length of their longest common subsequence (not necessarily contiguous in either string, but in the same relative order in both). Suggested time: 25 minutes — the first 2D DP table in the course, budget extra time to set up the grid correctly.

25:00

Press Start when you begin working the problem.

Complexity — all 4 problems

ProblemTimeSpacePattern
Longest Palindromic SubstringO(n²)O(1)Expand around center (two-pointer variant)
Merge IntervalsO(n log n)O(n)Sort + one linear pass
Rotting OrangesO(rows × cols)O(rows × cols)Multi-source BFS
Longest Common SubsequenceO(m × n)O(m × n)2D Dynamic Programming

Interview corner

Quiz

1. What's the recommended first move when a timer starts on a new problem?

2. Why state a brute-force approach out loud even if you're not going to code it?

3. If the countdown timer hits zero and you're not done, what should you do?

4. If you finish a problem with time remaining, what's the best use of the rest of the clock?

5. Why does repeating timed mock interviews matter more than one long untimed practice session?