Design a rate limiter
Limit each client (API key, user, or IP) to N requests per window, per endpoint or tier. Return 429 Too Many Requests with Retry-After and X-RateLimit-Remaining headers. Rules change without a deploy (per-customer ove...
Real interview questions from OpenAI, Anthropic, Google DeepMind and more. Answers endorsed by curators, ranked by the engineers who passed, and yours to remix.
Every solution is a living document. Remix one into your own private copy, rework it with the AI coach, and publish it back with its lineage intact.
Limit each client (API key, user, or IP) to N requests per window, per endpoint or tier. Return 429 Too Many Requests with Retry-After and X-RateLimit-Remaining headers. Rules change without a deploy (per-customer ove...
Users chat with a model in conversations; responses stream token by token. Conversations persist and can be resumed on any device. Users can stop generation, regenerate, and edit an earlier message (branching). Time t...
Limit each client (API key, user, or IP) to N requests per window, per endpoint or tier. Return 429 Too Many Requests with Retry-After and X-RateLimit-Remaining headers. Rules change without a deploy (per-customer ove...
Functional Sandbox lifecycle and execution: create a sandbox from a base image (language runtime + repo checkout), run commands with streamed stdout/stderr, exit codes and per-command timeouts, snapshot/resume between...
Keep a hash map from key to node, and a doubly linked list ordered by recency (most recent at the head). get moves the node to the head; put inserts at the head and evicts from the tail when over capacity. Both are O(...
Employees ask questions in natural language and get answers grounded in internal docs, with citations. Respect document permissions: never show content a user can't open in the source system. Docs from Drive, Confluen...