Before you start
The whole course has been leading here. 37 lessons of hand-holding are behind you. Now you fly solo.
Why this lesson exists
The real interview has no template. The interviewer says "design X" and hands you a whiteboard. You:
- Ask clarifying questions
- Find the classes
- Pick patterns and defend them
- Write real code
- Test the important cases
- Walk through the design
Every lesson in module 4 gave you the requirements. This lesson makes YOU write them. That's the missing muscle.
What an interviewer is really judging (silently)
- Did you scope well? Under-scoping is safe but boring; over-scoping means you don't finish. Middle ground is interview gold.
- Did the design follow from the requirements? Reverse-engineering ("I used X because it's cool") gets caught in 30 seconds.
- Are patterns justified? Or just reflex?
- Do tests cover the rules, not just happy paths?
- Can you defend every choice? — the "walk me through your design" phase.
The design.md you produce here rehearses every one
of these.
What good looks like
Say you picked "note-taking app". A strong design.md:
Requirements:
- Users have notes. Notes have title, body, tags, created_at.
- Operations: create, update, delete, search-by-tag, search-by-text (substring in body).
- Rules: notes can never be modified after deletion; every note has at least one tag (empty defaults to "misc").
Entities:
Note— data class +matches(query)helperNoteStore— main class, holds the notes dict, offers CRUD + search
Patterns:
- No GoF pattern fits. Search is a plain method; only one algorithm (substring). If we added ranking or fuzzy match, Strategy would fit — but for MVP, plain code is right.
Trade-offs:
- Store notes in a
dict[note_id -> Note]for O(1) CRUD. Search is O(N) full-scan. For MVP that's fine; if we needed sub-linear tag search, I'd add an inverted indexdict[tag -> set[note_id]].
Rules:
- Deleted notes can't be modified. Enforced by the
check in
update()that the note is still in the active dict. - Every note has ≥1 tag. Enforced by
create()defaulting empty tag lists to["misc"].
That's a design an interviewer would sign off on. Yours will look different — same shape.
Scope discipline
Cut features aggressively. A working 3-operation system beats a broken 10-operation one. Common pitfalls:
- "Also I'll add user authentication." — NO. Out of scope.
- "It should have a REST API." — NO. Out of scope.
- "Let me also model the database schema." — NO.
Anything you cut is fair to mention in Trade-offs. "I deliberately cut authentication for MVP scope; would add an AuthMiddleware later."
The tests-are-yours part
Writing tests for your own design is a real skill. Include:
- Happy path per operation. Basic add / read / search works.
- Invalid input. Duplicate creation, missing key, bad data.
- Rules. One test per rule you named in design.md. If you said "notes can't be modified after deletion", write a test that PROVES it.
- Interactions. Two operations in sequence exercise more than one op alone.
Aim for 5-10 tests. Not 50. Quality over quantity.
What the AI Code Review will notice
After you pass, click "Ask Claude for a code review". Claude reads all three files and comments on:
- Whether your patterns match your reasoning
- Whether your rules are actually enforced (or just claimed)
- Whether your tests cover the rules (or just happy paths)
- Whether your requirements section pins scope well
- Any obvious over-engineering
Take that feedback seriously. It's the closest thing to an interviewer's follow-up you'll get in a solo drill.