top of page
Search
Jump Game II
Jump Game II is a classic follow-up to the original Jump Game problem. It’s not just about whether you can reach the end... now you have to do it in the fewest jumps possible! That small change turns a simple reachability problem into one that tests how well you can optimize greedy strategies or dynamic programming under pressure.
Jun 176 min read
Longest Repeating Character Replacement
The "Longest Repeating Character Replacement" question is one of those string manipulation problems that sneak up on you. At first glance, it seems like a counting or brute-force challenge, but the optimal solution leans heavily on sliding window and frequency analysis. It’s a fantastic warm-up for mastering problems involving substrings and character frequency tracking, common themes in many real-world parsing and formatting systems.
Jun 125 min read
Maximum Subarray - Kadane's Algorithm
Maximum Subarray - Kadane's Algorithm is is a classic problem that introduces one of the most elegant uses of dynamic programming. It teaches you how to keep track of optimal sub-solutions and make decisions based on current and previous results. Once you’ve got this down, it opens the door to more complex dynamic programming challenges.
May 305 min read
4Sum
This is a great follow-up to 2Sum and 3Sum. It challenges you to apply the same two-pointer strategy but adds complexity by requiring a quadruplet instead of a pair or triplet. This kind of problem comes up when you're working on systems that require combinatorial sum checks, like budgeting scenarios, fraud detection with transaction records, or even algorithmic trading strategies. The key here is optimization over brute-force enumeration.
May 275 min read
3Sum Closest
This is a great warm-up for array and two-pointer problems. It’s similar to the classic 3Sum, but instead of finding a triplet that adds to a specific number, we need the closest possible sum. This introduces an optimization twist that requires careful comparison and pointer movement, making it an excellent real-world scenario—think of situations where you need to get as close as possible to a threshold value without hitting it exactly, such as budget planning or resource all
May 264 min read
3Sum
Finding triplets that sum to zero is a foundational exercise in two-pointer techniques, sorting, and careful duplicate handling. The “3Sum” problem tests your ability to combine sorting with pointer sweeps to achieve O(n²) performance.
May 256 min read
Word Search
Searching for patterns in a grid under movement constraints shows up in puzzles, pathfinding, and game logic. The “Word Search” problem...
May 205 min read
Add and Search Word
Designing a data structure that supports both exact and wildcard searches is crucial in auto-complete, spell-checkers, and dictionary...
May 194 min read
Task Scheduler with Cooling Interval
Scheduling tasks under cooling constraints is a common challenge in operating systems, rate-limited APIs, and real-time pipelines. The “Task Scheduler with Cooling Interval” problem exercises frequency counting, greedy scheduling, and heap-based prioritization to minimize idle time.
May 166 min read
K Closest Points to Origin
Finding the nearest neighbors to a reference point is fundamental in recommendation engines, spatial queries, and clustering. The “K Closest Points to Origin” problem is a classic warm-up for Top-K selection using heaps or sorting optimizations.
May 154 min read
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 145 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 125 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 115 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 94 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 94 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 64 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 64 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 54 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 24 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 174 min read
bottom of page

