21Build a rate limiter: fixed window, then sliding window, then per-customer tiers▼medium★ EssentialOpenAIAnthropicGlean2 replies◆ premiumA verbatim-reported multi-part at OpenAI and Anthropic. Each level breaks the previous design on purpose: the burst-at-the-boundary flaw is planted, and naming it before the interviewer does is how you win the round.Open full answer →
24Build a client for a flaky API: retries with exponential backoff and jitter, timeouts, and idempotency▼hardAnthropicOpenAIRetool2 replies◆ premiumThe question where production scars are the rubric. Anyone can write a retry loop; the grade lives in which errors you DON'T retry, why jitter exists, and what an idempotency key actually protects you from.Open full answer →
26Build a template engine: {{user.name}} from nested dicts, then conditionals, then loops▼hardAnthropicRetoolOpenAI1 replies◆ premiumA three-level build that quietly tests whether your L1 design survives L3. Regex substitution wins level one and loses the round; here's the token-based structure that carries through conditionals and loops.Open full answer →
27Build an in-memory pub/sub system: subscribe, publish, then topic wildcards, then delivery guarantees▼hardOpenAIxAIRetool1 replies◆ premiumExact-match pub/sub is a dict of lists. The round is decided at level two (wildcard matching on hierarchical topics) and at level three, when the interviewer asks what happens when a subscriber's callback throws.Open full answer →
28Build a task scheduler: dependencies (topo sort), then priorities, then a concurrency limit▼hardxAIPalantirOpenAI1 replies◆ premiumKahn's algorithm gets you level one. The round is won at level three, where 'run up to K tasks at once' breaks naive topo sort, and the indegree bookkeeping you chose at L1 either saves you or sinks you.Open full answer →
29Build a mini spreadsheet: cells hold ints or formulas like =A1+B2, evaluate them and detect cycles▼hardAnthropicOpenAIRetool1 replies◆ premiumThe practical build that's secretly a graph problem: formulas are a dependency DAG, evaluation is DFS with memoization, and the three-color cycle trick decides whether A1=B1, B1=A1 crashes you or earns the offer.Open full answer →
30Build an in-memory database: set/get/delete → field operations and prefix scan → TTL → backup and restore at timestamps▼hardOpenAIScalexAI2 replies◆ premiumThe OpenAI FDE signature question, reported near-verbatim for two years: four levels in ~60 minutes, where L4 silently breaks every naive L3 implementation. The lazy-expiry design that survives all four levels, with the pacing plan.Open full answer →
31Build an in-memory SQL-like table: schema and select → WHERE → combined && / || clauses → ORDER BY▼hardOpenAI1 replies◆ premiumThe other OpenAI signature build, reported in four parts for two years. Part C silently punishes anyone who hardcoded single-condition filtering in part B; here's the predicate-compiler design that absorbs all four parts.Open full answer →
32Implement a resumable iterator with getState() and setState(), then make it span multiple files▼hardOpenAI1 replies◆ premiumAn OpenAI bank regular: next() over a list, then save/restore position, then resume across multiple JSON files where some are empty. The whole question is one decision (what counts as state) and most candidates get it wrong on part one.Open full answer →