Coding
The coding round, as AI teams actually run it
No puzzle algorithms: small, realistic builds you’d write on the job, with a time box, tests that run in your browser, and the follow-up questions interviewers ask once it works. Python standard library only.
- Warm-upToken-bucket rate limiter~15 min · backend, rate limitsImplement a per-key token bucket: `capacity` tokens, refilled continuously at `rate` tokens per second. `allow(key, now, cost=1)` returns True and spends tokens if enou…
- Warm-upRetries with backoff, jitter and Retry-After~15 min · backend, reliabilityWrite `call_with_retries(fn, max_attempts, base, cap, sleep, rand)` that calls `fn()` and retries on `TransientError` with full-jitter exponential backoff: delay = rand…
- MediumMarkdown chunker that respects structure~30 min · RAG, chunkingWrite `chunk(md, max_tokens)` that splits a markdown document into chunks. Rules: split at headings (`#`, `##`, `###`) first; each chunk records its section path like `…
- MediumHybrid retrieval: cosine top-k + reciprocal rank fusion~25 min · RAG, retrievalImplement `cosine(a, b)`, `dense_top_k(query_vec, docs, k)` returning doc ids sorted by cosine (ties by id), and `rrf(rankings, k=60, top=5)` that fuses several ranked …
- MediumPack evidence into a token budget~25 min · context, RAGWrite `pack(chunks, budget)` where `chunks` is a list of `{"id", "text", "score"}`. Take chunks in descending score; skip a chunk whose word set has Jaccard similarity …
- MediumParse a Server-Sent Events stream~25 min · streaming, backendImplement `SSEParser.feed(chunk: str) -> list[dict]`. Chunks arrive in arbitrary pieces (a line can be split across chunks). Events are separated by a blank line. Field…
- MediumExtract and validate model JSON~25 min · structured output, validationModels wrap JSON in prose and code fences. Write `parse_model_json(text, schema)` that finds the first JSON object in `text` (it may sit inside ```json fences or after …
- HardA safe tool dispatcher~35 min · agents, securityBuild `Dispatcher` with `register(name, fn, schema, owner_check=None, irreversible=False)` and `call(user, name, args, idem_key=None)`. Rules: unknown tool → error; arg…
- HardAn agent loop with stop conditions~35 min · agentsWrite `run_agent(model, tools, task, max_steps=8)`. `model(messages)` returns either `{"tool": name, "args": {...}}` or `{"answer": str}`. Append the model’s turn and e…
- HardBounded async fan-out with timeouts~30 min · async, backendWrite `async def fan_out(coros_factories, limit, timeout)` that runs a list of zero-argument functions returning coroutines, at most `limit` at a time, each with its ow…
- Warm-upPII redaction before logging~20 min · security, privacyWrite `redact(text)` that replaces emails with `[EMAIL]`, phone numbers (a `+` or digit followed by 9–14 more digits, spaces or dashes allowed between) with `[PHONE]`, …
- Warm-upRetrieval metrics: recall@k, MRR, nDCG~20 min · evals, RAGGiven `results` (query id → ranked list of doc ids) and `relevant` (query id → set of relevant doc ids), implement `recall_at_k`, `mrr` and `ndcg_at_k` averaged over th…
Python runs with Pyodide (CPython compiled to WebAssembly) in a background worker, so a runaway loop can be stopped. The first run downloads the runtime (~10 MB) from this site; after that it’s cached. See also what the AI coding round tests.