Interview Questions
Practice the exact questions companies are asking right now.
Design a coffee ordering system
System Design: Coffee Ordering System Design a system for a coffee shop (or chain) that supports ordering drinks. Core use cases - Customer browses me...
Implement an in-memory database with TTL and backup
In-Memory Database (Levels 1–4: TTL and Backup/Restore) Implement an in-memory database that stores records identified by a string key. Each record co...
Design a single-node persistent in-memory cache
Scenario Design a single-machine cache used by a web service to handle read/write requests. The cache should: - Store key/value pairs in memory (fast ...
Compute ads revenue by geography in SQL
You have ad delivery logs for a shop-ads system. Tables ad_impressions - impression_id STRING (PK) - ts TIMESTAMP (UTC) - user_id STRING - shop_id STR...
Design a sandboxed cloud IDE
System design: Sandboxed cloud IDE (Colab-like) Design a multi-tenant, browser-based cloud IDE/notebook that lets users run code in an isolated sandbo...
Explain KV cache in Transformer inference
Question In Transformer-based language model inference, what is a key-value (KV) cache? Explain: - What gets cached (tensors, shapes at a high level) ...
Implement multi-level task manager APIs
You are implementing an in-memory task management system with a set of APIs that evolve over 4 levels. All APIs receive a timestamp: int parameter. Un...
Implement an in-memory SQL-like table
Problem Implement a simple in-memory database for one table. All values are strings. Each row is identified by a rowKey (string). Each row contains co...
Implement a memory allocator with malloc/free
Problem You are implementing a simplified memory allocator over a contiguous memory region. Initialize the allocator with a fixed total size: - alloca...
How to evaluate similar-listing notifications feature
Case study (Marketplace product analytics) Context: Circle is a US marketplace app for buying and selling second‑hand products. On a product listing p...
Dedupe titles in per-shelf viewport
You are rendering a streaming app home page. - The home page consists of shelves displayed from top to bottom. - Each shelf contains a list of titleId...
Implement credit ledger with out-of-order timestamps
Problem You are implementing a GPU credit ledger that supports adding credits, charging credits, and querying balances. Requests can arrive in any tim...
Design a RAG system with evaluation
Scenario You are asked to design a Retrieval-Augmented Generation (RAG) system that answers user questions using a private corpus (e.g., internal docs...
Design an ads audience targeting system
Problem Design an ads audience targeting system that allows advertisers to upload large user lists and then target (or exclude) those users when servi...
Design a distributed crossword fill solver
Scenario You are building a service that fills a crossword-like grid with words. - The board size is not specified; assume a medium board around 50×50...
Design centralized log ingestion and query system
Problem Design a system to collect, transmit, store, and query application/data logs from many services/hosts into a central data center database. Req...
Design a fraud detection system
Scenario You are designing an end-to-end fraud detection system for an online platform (e.g., e-commerce marketplace, payments, account signup, or ad ...
Implement toy-language types and generic substitution
Problem: Toy Language Type System (Printing + Generic Resolution) You are implementing a small type system for a custom “Toy Language”. Types can be: ...
Find path in implicit Fibonacci tree
You are given a special family of binary trees called Fibonacci trees. The k‑th order Fibonacci tree T(k) is defined recursively: - T(1) is a single n...
Compute probability an account is fake
A platform uses an automated classifier to flag potentially fake accounts. Assume: - Base rate: 2% of accounts are fake. - The classifier flags a fake...