Courses / DSA Patterns for Working Engineers / Chapter 39
Module 12 · Mock interview · Chapter 39 of 39
Mock Interview: Five Timed Problems With Model Answers
Builds on The Coding Interview: How the Round Runs and How to Prepare, Sliding Windows: Fixed and Variable Ranges Over Sequences, Heaps and Two Heaps: Running Medians and Priority Scheduling, Dynamic Programming: States, Transitions and Tables, Tree Depth-First Search: Recursion That Returns Answers Upward and Mixed Practice: Pick the Pattern Under Time.
Part 1 · How to run the mock
Setting up the room
This chapter is five rehearsals, each a problem you have not seen, a time box, a model answer and a rubric. The problems are original and each draws on patterns from earlier chapters without naming them. Treat each as a real round: one sitting, a timer, a shared file open, and your thinking said aloud.
You need a timer and either a recording or a partner. The partner reads the prompt, answers the questions listed under "What to ask", stays silent about the solution, and scores you on the rubric below. If you are alone, record yourself, and score the recording the next day. Read only the prompt of a lesson, start the timer, and cover the model answer until the time box ends.
Work in the order of the method from the interview chapter: restate and ask, work two examples by hand, write the brute force with tests, name the bottleneck, apply a pattern and state its cost, then stress test against the brute force. Each model answer is written in that order so that you can compare your own sequence with it. Every file uses the layout of the mixed practice chapter: a function, a test file with node:test, and a seeded generator from rng.ts where a stress run is shown. Code blocks follow the convention set out in the first chapter.