Prep · Design

Practical Questions

Most modern screens don’t ask you to invert a binary tree. They hand you an underspecified prompt — “build a package manager, think npm but not nearly as good” — and then keep adding requirements. The ambiguity is the graded material: you choose the API, you choose the data model, and the choice you make in phase one decides whether phase three is a five-line method or a rewrite.

This lane trains that format directly: registries, caches, documents, limiters, queues, emitters, debounced async search, usage rollups, the app discovery service that pulls all of it into one screen, and the tiny test runner you write before everything else. Work each phase before reading its solution — reading ahead destroys the only thing this set trains.

Before You Type

Write the assert helper first

Three lines before any design. Every requirement sentence becomes a real assertion instead of a console.log you read with your eyes — and test through the public API, never by mutating internals.

Read the prompt like a spec

Every qualifier is deliberate. “Immediate dependencies” means transitive is coming. “First task” means there are more. “No duplicates” is a hint to pick a set-shaped container instead of writing dedup code.

Have an opinion, say why

Most escalations have two defensible answers. Naming the trade-off out loud — what it costs, when you’d choose the other one — is the difference between a correct answer and a senior one.