Interview Questions
Practice the exact questions companies are asking right now.
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...
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 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...
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) ...
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 ...
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...
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...
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...
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...
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 constrained cache and secure string validator
Part A — Constrained cache (LRU-like) Design an in-memory cache that supports the following operations: - get(key) -> value | null - put(key, value) -...
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...
Implement an in-memory file system
Implement an in-memory file system supporting basic directory and file operations. You must support the following methods (names are illustrative; any...
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...
Join tables to map userId to name
Problem You are given three tables represented as 2D string arrays (each row is a record, no headers). You need to produce a mapping from userId → cus...
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 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...
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...
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: ...