Interview questions
Find a company or topic. Read the sources, then practice.
Loading the question library…
Find a company or topic. Read the sources, then practice.
Loading the question library…
Showing 1–25
Design a hit counter that records timestamps of hits and returns the number of hits in the past 5 minutes (300 seconds). The challenge is…
Companies: Adyen, Apple, Cisco, Databricks +5
Array · Binary Search · Data Stream · Design
Last reported Nov 2026
Design an in-memory hierarchical file system that supports path parsing and operations like mkdir, ls, addContentToFile (append/create), and readContentFromFile, requiring you…
Companies: Anchorage Digital, Capital One, Coupang, Datadog +5
Design · Hash Table · Sorting · String
Last reported Nov 2026
Implement an LFU cache with O(1) average-time get and put operations that evicts the least-frequently-used key when capacity is exceeded, breaking ties by least-recently-used…
Companies: Amazon, Apple, Cisco, Goldman Sachs +3
Design · Doubly-Linked List · Hash Table · Linked List
Last reported Nov 2026
Implement an LRUCache that supports O(1) average-time get(key) returning the value or -1 and put(key, value) which inserts or updates a key and, if capacity…
Companies: Adobe, Amazon, Anthropic, Apple +29
Data Structure Design · Design · Doubly-Linked List · Hash Table
Last reported Oct 2026
Design a data structure that supports incrementing and decrementing string counts (removing keys when their count drops to zero) and can return any key with…
Companies: Atlassian, LinkedIn, Meta, Microsoft +2
Design · Doubly-Linked List · Hash Table · Linked List
Last reported Oct 2026
Design a stack data structure that supports standard push, pop, and top operations, along with a getMax operation that retrieves (but does not remove) the…
Companies: Confluent, Everpure, LinkedIn, Walmart Labs
Design · Doubly-Linked List · Linked List · Ordered Set
Last reported Oct 2026
Given a list of words, design a class that can answer repeated queries returning the minimum index distance between two given words; optimize for many…
Companies: LinkedIn
Array · Design · Hash Table · String
Last reported Oct 2026
Design a data structure supporting insert(val), remove(val), and getRandom() — which returns a uniformly random existing element — with each operation in average O(1) time…
Companies: Amazon, Apple, Bloomberg, Citadel +7
Array · Design · Hash Table · Math
Last reported Sep 2026
Implement a logger that decides whether to print a message at a given timestamp: return true if the message hasn't been printed in the last…
Companies: Amazon, Bloomberg, Google, Microsoft +3
Data Stream · Design · Hash Table
Last reported Sep 2026
Design a data structure for a multiset that supports insert(val) (adding even duplicate occurrences), remove(val) (removing a single occurrence), and getRandom() (returning an…
Companies: CrowdStrike, LinkedIn, Okta
Array · Design · Hash Table · Math
Last reported Sep 2026
Design a spreadsheet supporting set/get and sum operations where sum formulas can reference individual cells and rectangular ranges; the core challenge is maintaining a…
Companies: Airbnb, Discord
Array · Design · Graph Theory · Hash Table
Last reported Sep 2026
Implement a HashMap for integer keys/values without using built-in hash table libraries that supports put, get, and remove operations. The core challenge is to design…
Companies: Anduril, Canva, Chewy, Goldman Sachs +2
Array · Design · Hash Function · Hash Table
Last reported Sep 2026
Design a Spreadsheet class with 26 columns and a specified number of rows that supports setCell and resetCell operations and stores integer values (unset cells…
Companies: Citadel, Discord
Array · Design · Hash Table · Matrix
Last reported Sep 2026
Design a versioned array that supports point updates, taking snapshots (returning increasing snap_ids), and querying the value at an index for a given snap_id. The…
Companies: Amazon, Anduril, Apple, MongoDB
Array · Binary Search · Design · Hash Table
Last reported Sep 2026
Maintain a data structure that supports adding integers from a stream and returning the current median efficiently for many interleaved addNum and findMedian calls. The…
Companies: Adobe, Amazon, D. E. Shaw, Intuit +4
Data Stream · Design · Heap (Priority Queue) · Sorting
Last reported Aug 2026
Given a nested list where elements may be integers or sublists, implement a NestedIterator with next() and hasNext() that returns all integers in depth‑first, left‑to‑right…
Companies: Adobe, LinkedIn
Depth-First Search · Design · Iterator · Queue
Last reported Aug 2026
Design a time-based key-value store that records multiple values per key with timestamps and returns the value whose timestamp is the largest <= the queried…
Companies: Amazon, Anthropic, Apple, Citadel +8
Binary Search · Design · Hash Table · String
Last reported Aug 2026
Design an allocator for n memory units that supports allocating the leftmost contiguous block of a given size and freeing all units with a given…
Companies: Apple, OpenAI, Roblox
Array · Design · Hash Table · Simulation
Last reported Jul 2026
Design a stack supporting push, pop, top, and getMin operations all in O(1) time. The core challenge is to maintain and update the current minimum…
Companies: Expedia, Snowflake
Design · Stack
Last reported Jun 2026
Design a data structure that, given an initial list and a stream of added numbers, returns the first integer that appears exactly once at any…
Companies: Uber
Array · Data Stream · Design · Hash Table
Last reported Jun 2026
Design an online autocomplete system that processes characters one-by-one, returning the top 3 historically most frequent sentences that match the current prefix (ranked by…
Companies: Google, Netflix, Pinterest, Vercel
Data Stream · Depth-First Search · Design · Heap (Priority Queue)
Last reported May 2026
Maintain an evolving rooted family tree (king as root) that supports adding a child and marking a person dead, and return the current inheritance order…
Companies: Apple, Snowflake
Depth-First Search · Design · Hash Table · Tree
Last reported May 2026
Implement a BrowserHistory class that supports visiting URLs (which clears any forward history), moving back or forward up to a specified number of steps, and…
Companies: Amazon, Bloomberg, Chime
Array · Data Stream · Design · Doubly-Linked List
Last reported Apr 2026
Design a data structure that, given a continuous stream of numbers and a fixed window size k, returns the moving average of the last k…
Companies: Box, Google, Meta, Spotify
Array · Data Stream · Design · Queue
Last reported Mar 2026
Design a class that stores an integer array and supports reset (returning the original configuration) and shuffle (returning a uniformly random permutation so that all…
Companies: Microsoft, Uber
Array · Design · Math · Randomized
Last reported Feb 2026