Before you start
This lesson simulates a real 45-minute design interview slot. Read the problem. Set a timer. Design. Implement. Test.
Why timed
Real interviews are timed. Every hour has a shape:
- First 5 min — clarify. Take notes.
- Next 10 min — sketch entities, name patterns.
- Next 25 min — write real code.
- Last 5 min — walk through your design with the interviewer.
Untimed practice teaches design thinking. Timed practice teaches design UNDER PRESSURE. Different muscle.
How to actually time yourself
- Read the problem once, briefly.
- Set a timer for 45 minutes.
- Start.
- When it goes off — STOP whatever you're doing. Note where you are.
- THEN keep going to finish (untimed).
That "stop and note" moment is where the learning is. Did you finish? Did you spend all your time in design? Did you rush the implementation? Different failure modes, different fixes.
The problem's design signals
Music Playlist has two patterns worth naming:
- Strategy for playback order — sequential vs shuffle. Different algorithms, same "give me the next song" question.
- State for playback — idle / playing / paused. But three states with a single field is defensible compared to full State classes. Argue both.
Whether you use them, don't use them, or use them in combination — pin your reasoning.
The rules discipline (last time in this course)
Three rules matter:
- Playlists hold only known songs. Enforced at
add_to_playlistby checking the song exists in the catalog. - Playback position is always valid after next/prev. Enforced by modular arithmetic — you can't overshoot.
- Users only touch their own playlists. Enforced by... actually, we didn't say this in the requirements. You have a choice: enforce it and add tests, or say in Trade-offs that you skipped it for scope.
That third one is a real interview trap. Requirements are often INCOMPLETE. Do you enforce authorization or note the gap? The strong answer is "I noticed the requirements were silent on multi-user isolation; for MVP I skipped it, would add an owner check on each mutation for production."
Do NOT do these
- Skip design.md to save time. It's graded. Skipping it means a 0.
- Copy the shape of a module-4 lesson blindly. This is a NEW problem — Strategy + State signal, not "just Strategy" like Rate Limiter.
- Panic when the timer's running low. Ship the smallest version that passes tests, then iterate.
After you're done
Whether you finished on time or ran over, review honestly:
- Which section ate the most time? (Usually implementation.)
- What would you cut to have finished in time?
- Did your design.md hold up after you coded, or did you learn something that would change your answer?
- Would the AI Code Review find issues you missed?
Interview readiness comes from the REVIEW cycle, not the first attempt.