Day 14 — Mock: 3 problems, 45 minutes

mock day · strings · sliding window · Python

Tonight's goal: run one short interview-style set, talk aloud before every solution, and state time and space complexity before writing code.

Tonight's protocol

Use the mock-day protocol, adapted to one strict 45-minute block:

  1. 0:00–3:00: answer the warm-up MCQs below. If you miss one, read only its invariant quote and move on.
  2. 3:00–4:00: open one blank file and the three LeetCode tabs. Do not open notes, saved code, hints, or solution text.
  3. 4:00–16:00: solve Problem 1. Before typing, say the pattern, brute force, better approach, time, and space out loud.
  4. 16:00–31:00: solve Problem 2. If stuck after eight minutes, reread only the pattern name in the menu and restart your explanation.
  5. 31:00–45:00: solve Problem 3. Same rule: explain aloud first, complexity before code, no solution text during the timer.
  6. 45:00: stop coding. Compare after the timer, then write one note per miss: invariant, bug, or edge case.

The problem menu

TimeProblemPattern nameSay before code
12 min Valid Anagram Frequency Counting Histogram equality; O(n) time, O(1) space for 26 letters.
15 min Longest Substring Without Repeating Characters Sliding Window I: The Shrinking Rule Grow right, shrink until unique; O(n) time, O(n) space.
14 min Longest Palindromic Substring Expand Around Center Try odd and even centers; O(n^2) time, O(1) space.

The first four minutes are for warm-up and setup. The remaining forty-one minutes are the timed mock.

Warm-up MCQs

1. Which invariant identifies anagrams?

2. Which invariant handles cleaned palindrome validation?

3. A solution records best before removing a duplicate. What broke?

4. What validity rule belongs to replacement budget?

5. Which action order finds the smallest covering substring?

6. Which invariant starts palindrome search?

Self-check gate

Pass tonight if all three are true

Failure path: add every failed problem to the next revision list with WA: <root cause>. Re-solve it later from a blank file with no hints.