57Here are 30 examples where our prompt gets the wrong answer. Improve it, show me the eval before and after, and do not overfit to the 30.▼hardNewAnthropicOpenAI2 replies◆ premiumThis is the live practical several labs run, and it is scored on protocol more than on the prompt you end with. Read all thirty before editing, cluster them, hold some out, change one thing at a time, and report with intervals, because 24 of 30 fixed is somewhere between 63% and 91%.Open full answer →
08Build a wc-lite: count lines, words, and characters in text, with flags, factored for extension▼easyAnthropicRetoolOpenAI1 repliesunlockedAnthropic-style screens open with deceptively simple builds like this, then extend them three times. The grade isn't the counting; it's whether your first version survives the extensions without a rewrite.Open full answer →
17Parse server logs and report the top-K users by error count per hour, handling malformed lines▼mediumPalantirAnthropicRetool1 replies○ sign inThe quintessential FDE practical: messy real-world input, grouping, ranking, and a hidden rubric line for how you treat malformed data. Most candidates parse happily and lose the round on the lines that don't parse.Open full answer →
18Sessionize a support-event stream: a gap over 30 minutes starts a new session; dedupe events▼mediumGleanScaleRetool1 replies○ sign inSessionization is the analytics primitive behind every 'how do users actually behave' question, and a favorite practical screen. The algorithm is easy; out-of-order events and duplicates are where the round is actually scored.Open full answer →
19Build a CSV diff tool: report added, removed, and changed rows between two files, with composite keys▼mediumPalantirRetoolScale1 replies○ sign inEvery data migration at every customer site needs this exact tool, which is why Palantir and Retool keep asking it. The diff is a dict comparison; the grade hides in keys, duplicates, and column drift.Open full answer →
20Build a versioned key-value store: put/get, plus get(key, timestamp) for historical reads▼mediumOpenAIGleanScale1 replies○ sign inA multi-part favorite at OpenAI-style screens: simple store, then time travel, then deletes that don't actually delete. The append-only insight plus one bisect call solves the whole thing, if you set up the invariant correctly.Open full answer →
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 →
22You're given a small repo with failing tests and a vague bug report: fix the bugs, then add a feature▼mediumRetoolAnthropicOpenAI1 replies◆ premiumThe format that filters out LeetCode-only candidates: unfamiliar code, failing tests, 45 minutes. There's a repeatable protocol for it, and a reason the first five minutes decide the round.Open full answer →
23Write a document chunker for embeddings: max token budget, sentence boundaries, configurable overlap, with tests▼mediumScaleAnthropicOpenAI1 replies◆ premiumThe coding question that doubles as a RAG-fundamentals check. Greedy packing is easy; the oversized-sentence case, the overlap-progress trap, and the tests you write unprompted are what AI-lab interviewers actually score.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 →
25Fuzzy-match entities across two customer lists: normalization, edit distance, and scaling past O(n×m)▼hardPalantirScaleGlean1 replies◆ premiumPalantir's bread and butter: 'Acme Corp.' and 'ACME Corporation, Inc.' are the same customer; prove it in code. Normalization does more work than the clever algorithm, and blocking is what makes it run before the heat death of the universe.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 →
33Implement cd(current_dir, new_dir) returning the absolute path, then add symbolic links▼mediumOpenAI1 replies◆ premiumcd('/foo/bar', 'baz') is easy. cd('/foo/../', './baz') is where the OpenAI screen actually starts, and the symlink follow-up is where it ends. The stack solution plus the loop-guard most candidates forget.Open full answer →
34Build a time-based KV store, write three real unit tests for it, then defend a locking strategy▼hardOpenAI1 replies◆ premiumThe OpenAI variant where the data structure is the warm-up: the round is graded on whether your tests control time and whether you can argue global vs per-key vs optimistic locking with actual reasons. Most candidates ace part one and lose the round in parts two and three.Open full answer →
35Build a system to manage GPU credits across companies with wildly different usage patterns▼hardOpenAI1 replies◆ premiumA reported OpenAI build that looks like billing and is actually a data-structure question in disguise: credit grants that expire, usage that must burn the right grant first, and balance queries at arbitrary times. The earliest-expiry-first invariant carries the whole problem.Open full answer →
36Serialize a key-value store to disk when keys and values can contain any character, including your delimiter▼mediumOpenAI1 replies◆ premiumNo JSON libraries allowed, and the test data contains commas, newlines, and your escape character itself. Length-prefix encoding solves it in fifteen lines, and knowing why it beats escaping is the actual interview.Open full answer →
37Convert sampling-profiler stack samples into a trace of start and end events▼hardAnthropic1 replies◆ premiumA confirmed Anthropic live-coding question that looks exotic and reduces to one operation: diff consecutive call stacks against their common prefix. The recursion edge case is where strong candidates separate from finished-but-wrong ones.Open full answer →
38Extend an LRU cache to key on *args and **kwargs, then make it persistent across restarts▼hardAnthropic1 replies◆ premiumAnthropic's reported twist on the LRU staple: the cache is a decorator, the keys are arbitrary call signatures, and the follow-up writes it to disk. The kwargs-ordering and unhashable-argument traps are the whole interview.Open full answer →
39Implement a multithreaded web crawler with a thread pool, then survive the GIL and asyncio follow-ups▼hardAnthropic2 replies◆ premiumThe reported Anthropic concurrency round: the crawler is twenty minutes, the follow-ups are the interview. Why threads work despite the GIL, what asyncio buys you, and where the semaphore goes. The answers, with the race condition graders plant.Open full answer →
40You're handed docs for an API you've never seen: use it to find the shortest path between two nodes▼mediumPalantir1 replies◆ premiumPalantir's signature coding genre isn't an algorithm; it's working from unfamiliar documentation: a graph API, a custom serialization spec, a mini query language. The behaviors graders score, plus the BFS-over-an-opaque-client worked example.Open full answer →
41Given a file-system hierarchy and timestamped permission changes, can user X access file F at time T?▼mediumElevenLabs1 replies◆ premiumThe reported ElevenLabs live round, written in a shared Google Doc, no execution, no autocomplete. Inherited folder permissions plus permission-change timestamps, and the two-axis resolution rule that keeps the code to thirty lines.Open full answer →
43Build a rules engine: evaluate boolean expressions like `age > 18 and country in ["US","CA"]` over a record▼hardPalantirRetoolOpenAI2 replies◆ premiumThe build behind every access policy and routing rule a customer wants to edit without a deploy. The trap is operator precedence: candidates who tokenize fine still get `a or b and c` wrong, and that's the whole grade.Open full answer →
44Build a circuit breaker: closed/open/half-open with a failure window, cooldown, and a single half-open probe▼hardAnthropicOpenAIStripe1 replies◆ premiumThe retry loop's grown-up sibling. Retries protect one call; a breaker protects the whole dependency from a retry storm. The grade is in the half-open state, where letting through one probe instead of all of them is the difference between recovery and re-killing the server.Open full answer →
45Build a streaming deduplicator: drop duplicate events within a sliding time window, bounded memory, late events▼hardScaleGleanAnthropic1 replies◆ premiumAt-least-once delivery means duplicates are guaranteed, not hypothetical. Anyone can use a set; the round is whether your set grows forever, and what you do with an event that arrives after its window closed.Open full answer →
46Build a feature-flag engine: deterministic percentage rollouts, targeting rules, and monotonic ramp-up▼hardRetoolStripeOpenAI1 replies◆ premiumA 10% rollout where the same user flips on and off between requests is worse than no rollout. The whole problem is determinism: hash the user into a stable bucket so ramping 10% to 25% only ever adds users, never reshuffles them.Open full answer →
47Build a tiny query planner: choose index vs full scan, push down predicates, estimate cost▼hardPalantirDatabricksSnowflake1 replies◆ premiumExecuting a query is the easy half; deciding HOW to execute it is the staff-level half. The interesting failure is choosing an index that returns 90% of the table, where a full scan is faster, and a planner that knows that beats one that always uses the index.Open full answer →
48Build a quota manager: per-key token buckets with lazy refill, reservations, and refund on failure▼hardOpenAIAnthropicStripe1 replies◆ premiumSliding-window limiters count requests; an API that bills by tokens needs to reserve a variable cost up front and refund it if the call fails. The trick is lazy refill: never run a timer, compute the current balance from elapsed time on each check.Open full answer →
89A streaming chat UI in React drops tokens, shows garbled characters, and lags on long replies. Find the three bugs and fix them.▼mediumNewSierraDecagonHarvey2 replies◆ premiumThis is the shape of the TypeScript debugging round at the agent companies: a forty-line stream handler that mostly works. Each bug has a one-line demonstration, and none of them is in the model. One is a stale closure, one is a decoder splitting a multibyte character, and one is a render per token.Open full answer →