top of page
Search
Find the Median from a Data Stream
Computing running medians on a stream of numbers pops up in real-time analytics, financial tickers, and sensor dashboards. You need to support two operations—adding a number and retrieving the current median—both in sublinear time.
May 15, 20255 min read
Design an LRU Cache
Caching is critical in systems design, from web browsers to database engines. An LRU (Least Recently Used) cache evicts the least recently used entry when full, ensuring hot data stays accessible. Implementing one in code tests your mastery of linked lists, hash maps, and constant-time operations.
May 12, 20255 min read
Merge k Sorted Lists
Combining multiple sorted streams into one sorted output is a classic challenge faced in database merge operations, log file aggregation, and external sorting. The “merge K sorted lists” problem tests your ability to coordinate multiple pointers, leverage priority data structures, and keep everything running in optimal time.
May 12, 20255 min read
Contains Duplicate Within K Distance
Checking for nearby repeated events in a log or sensor stream is a common task in monitoring, fraud detection, and real‑time analytics....
May 9, 20254 min read
Longest Consecutive Sequence
Finding the longest run of consecutive days, IDs, or timestamps in a dataset comes up in analytics, event processing, and scheduling systems. This “Longest Consecutive Sequence” problem is a great way to exercise hashing, set membership, and thinking about how to avoid redundant work.
May 9, 20254 min read
Subarray Sum Equals K
Finding how many contiguous stretches of transactions sum to a target turns up in budgeting tools, analytics dashboards, and real‑time...
May 6, 20254 min read
Group Anagrams
Clustering words that are anagrams of each other is a classic interview problem and mirrors real‑world tasks like building search indexes...
May 6, 20254 min read
Design a Circular Queue
Circular queues (ring buffers) come up in real‑world systems like streaming data buffers, IO scheduling, and task schedulers. They let...
May 5, 20254 min read
Flatten a Multilevel Doubly Linked List
Flattening a multilevel doubly linked list pops up in real‑world scenarios like expanding nested comment threads or unfolding embedded...
May 2, 20254 min read
Deriving KMP in Real Time
I’m staring at my whiteboard, fresh off writing the brute‑force substring search: two nested loops, compare needle at every haystack...
Apr 17, 20254 min read
bottom of page