Timed Coding Prompts
Printable practice resource: Timed Coding Prompts.
How to use this resource
Use each prompt as a 35-minute interview rehearsal. Spend 3 minutes clarifying, 22 minutes implementing, 7 minutes testing, and 3 minutes explaining complexity and trade-offs.
| Prompt | Senior signal to show |
|---|---|
| Merge overlapping availability windows and return the minimal set of available ranges. | Constraint analysis, edge cases, readable implementation. |
| Given event logs, return the top K users by active days within a rolling window. | Hash maps, ordering, complexity explanation. |
| Validate whether a dependency graph can be deployed without cycles. | Graph modeling, failure cases, clear traversal. |
| Implement a rate limiter for a single process. | State modeling, tests, trade-offs. |
| Find stale feature flags from usage records and creation dates. | Data shaping, boundary conditions, practical judgment. |
| Return the shortest transformation path between two valid configuration states. | Graph state, visited timing, reconstruction. |
| Maintain the median latency while values arrive and old values expire. | Data-structure choice, deletion strategy, invariants. |
| Parse a stream of nested begin/end events and report malformed spans. | Stack modeling, error contracts, test design. |
| Compute per-tenant concurrency peaks from start and finish events. | Sweep-line ordering, equal timestamps, data ownership. |
| Implement an expiring key-value cache with a bounded capacity. | API contract, time control, eviction trade-offs, tests. |
| Reconcile two snapshots and emit safe create, update, and delete actions. | Identity, ordering, idempotency, operational safety. |
After each prompt, record one bug, one missing clarification, and one test you should have written earlier.
Required run sheet
Before coding, write the contract, representation, and invariant. At the midpoint, decide whether to finish, simplify, or correct the model. Reserve the final seven minutes for tests derived from risks rather than replaying examples.
Score four dimensions from 1 to 4: framing, invariant and implementation, validation, and explanation. A correct result with hidden reasoning is not a complete rehearsal. A failed result with a precise diagnosis and recovery rule may be more useful than another familiar success.
Retest a weakness on a different prompt after at least one practice interval. Do not repeat the same input until recognition feels like mastery.