Coding interview questions and answers
276 Coding questions asked in campus placements and backend job interviews. The model answer for every question, including fresher, is part of Pro.
- View
Check if a string is a palindrome (ignore case, alphanumeric)
Easy · Coding, Strings, Java 17+
- View
Validate balanced parentheses using a stack
Easy · Coding, Strings, Java 17+
- View
Reverse word order in a sentence in-place style
Easy · Coding, Strings, Java 17+
- View
Longest substring without repeating characters
Medium · Coding, Strings, Java 17+
- View
Compress string with run-length encoding
Medium · Coding, Strings, Java 17+
- View
Count vowels and consonants in a string
Easy · Coding, Strings, Java 17+
- View
Check if s2 is a rotation of s1
Easy · Coding, Strings, Java 17+
- View
Find longest common prefix among strings
Easy · Coding, Strings, Java 17+
- View
Remove all adjacent duplicate characters recursively
Medium · Coding, Strings, Java 17+
- View
Implement atoi string to integer with overflow handling
Hard · Coding, Strings, Java 17+
- View
Two Sum using HashMap
Easy · Coding, Arrays, Java 17+
- View
Rotate array to the right by k steps
Medium · Coding, Arrays, Java 17+
- View
Find missing number in 1..n array
Easy · Coding, Arrays, Java 17+
- View
Find duplicate in array of n+1 integers
Medium · Coding, Arrays, Java 17+
- View
Merge two sorted arrays into one sorted array
Easy · Coding, Arrays, Java 17+
- View
Move all zeros to end while preserving order
Easy · Coding, Arrays, Java 17+
- View
Product of array except self without division
Medium · Coding, Arrays, Java 17+
- View
Maximum subarray sum (Kadane's algorithm)
Medium · Coding, Arrays, Java 17+
- View
Binary search on sorted array
Easy · Coding, Arrays, Java 17+
- View
Intersection of two integer arrays
Easy · Coding, Arrays, Java 17+
- View
Find pair with given sum in unsorted array
Easy · Coding, Arrays, Java 17+
- View
Search insert position in sorted array
Easy · Coding, Arrays, Java 17+
- View
Reverse a String using Streams.
Easy · Coding, Streams, Java 17+
- View
Check if two strings are anagrams using Streams.
Easy · Coding, Streams, Fresher
- View
Find the first non-repeating character in a String using Java 8 Streams.
Medium · Coding, Streams, Senior
- View
Find the frequency of each character in a string using HashMap and Streams.
Easy · Coding, Streams, Fresher
- View
Count occurrences of each word in a sentence (word frequency map).
Easy · Coding, Streams, Fresher
- View
Find duplicate elements in a list using Streams.
Easy · Coding, Streams, Fresher
- View
Remove duplicates from a list using Java 8.
Easy · Coding, Streams, Fresher
- View
Check if a list contains only unique elements using Streams.
Easy · Coding, Streams, Fresher
- View
Find the maximum and minimum element in a list.
Easy · Coding, Streams, Fresher
- View
Find the second highest/lowest element in a list.
Easy · Coding, Streams, Fresher
- View
Find the top N elements in a list using Streams.
Easy · Coding, Streams, Fresher
- View
Sort a Map by values using Streams.
Easy · Coding, Streams, Fresher
- View
Find common elements between two lists using Streams.
Easy · Coding, Streams, Fresher
- View
Flatten a list of lists using flatMap.
Easy · Coding, Streams, Fresher
- View
Merge multiple lists into one using Streams.
Easy · Coding, Streams, Fresher
- View
Convert List<Integer> to comma-separated String using Collectors.
Easy · Coding, Streams, Fresher
- View
Partition numbers into even/odd using Collectors.partitioningBy.
Easy · Coding, Streams, Fresher
- View
Group employees by department using Collectors.groupingBy.
Medium · Coding, Streams, Senior
- View
Find the average salary of employees using Streams.
Easy · Coding, Streams, Fresher
- View
Find the longest string in a list using reduce().
Easy · Coding, Streams, Fresher
- View
Count the number of words in a file using parallelStream().
Medium · Coding, Streams, Concurrency
- View
Convert a list into a Map using Collectors.toMap().
Medium · Coding, Streams, Senior
- View
Custom sort an Employee list by salary and then by name.
Medium · Coding, Collections, Java 8+
- View
Implement a custom Comparator with multiple fields (department, salary descending, name).
Medium · Coding, Collections, Java 8+
- View
Implement an LRU Cache using LinkedHashMap.
Hard · Coding, Collections, Architect
- View
Design a bounded blocking queue from scratch.
Hard · Coding, Collections, Concurrency
- View
Sort map entries by frequency descending.
Medium · Coding, Collections, Senior
- View
Top K frequent elements using PriorityQueue.
Medium · Coding, Collections, Senior
- View
Range query on TreeMap using subMap.
Medium · Coding, Collections, Senior
- View
Create a defensive immutable copy of a list (Java 17+).
Easy · Coding, Collections, Java 17+
- View
Deque-based sliding window maximum.
Hard · Coding, Collections, Staff
- View
Thread-safe iteration with CopyOnWriteArrayList demo.
Medium · Coding, Collections, Concurrency
- View
Implement a stack using an array.
Easy · Coding, Data Structures, Stack
- View
Implement a queue using two stacks.
Medium · Coding, Data Structures, Queue
- View
Reverse a singly linked list iteratively.
Easy · Coding, Data Structures, Linked List
- View
Detect a cycle in a linked list (Floyd's algorithm).
Medium · Coding, Data Structures, Linked List
- View
Merge two sorted linked lists.
Medium · Coding, Data Structures, Linked List
- View
Validate a binary search tree.
Medium · Coding, Data Structures, Binary Tree
- View
Binary tree level-order traversal (BFS).
Medium · Coding, Data Structures, Binary Tree
- View
Invert a binary tree recursively.
Easy · Coding, Data Structures, Binary Tree
- View
Find the kth largest element using a min-heap.
Medium · Coding, Data Structures, Heap
- View
Design a HashMap with separate chaining.
Hard · Coding, Data Structures, HashMap
- View
Compute Fibonacci numbers with memoization.
Easy · Coding, Recursion, DP
- View
Compute factorial iteratively and recursively.
Easy · Coding, Recursion, Fresher
- View
Generate all permutations of an array.
Medium · Coding, Recursion, Backtracking
- View
Generate the power set via backtracking.
Medium · Coding, Recursion, Backtracking
- View
Solve the Tower of Hanoi puzzle.
Medium · Coding, Recursion, Senior
- View
Climbing stairs — count distinct ways (DP).
Easy · Coding, Recursion, DP
- View
Coin change — minimum number of coins (DP).
Hard · Coding, Recursion, DP
- View
N-Queens — count the number of solutions.
Hard · Coding, Recursion, Backtracking
- View
Implement merge sort (divide and conquer).
Medium · Coding, Algorithms, Sorting
- View
Implement quicksort with Lomuto partition.
Medium · Coding, Algorithms, Sorting
- View
Sliding window maximum.
Hard · Coding, Algorithms, Deque
- View
Longest increasing subsequence length in O(n log n).
Hard · Coding, Algorithms, DP
- View
Topological sort using Kahn's algorithm.
Hard · Coding, Algorithms, Graph
- View
BFS shortest path in an unweighted graph.
Medium · Coding, Algorithms, Graph
- View
DFS cycle detection in a directed graph.
Medium · Coding, Algorithms, Graph
- View
Sort colors — Dutch national flag algorithm.
Medium · Coding, Algorithms, Array
- View
Implement a producer-consumer pattern using BlockingQueue.
Medium · Coding, Concurrency, Collections
- View
Print odd and even numbers alternately using two threads.
Medium · Coding, Concurrency, Senior
- View
Demonstrate asynchronous computation using CompletableFuture.
Medium · Coding, Concurrency, Java 8+
- View
Implement a thread-safe Singleton using Bill Pugh and Double-Checked Locking patterns.
Hard · Coding, Concurrency, Design Principles
- View
Implement a barrier for 3 threads using CyclicBarrier.
Hard · Coding, Concurrency, Staff
- View
Write a program where 3 threads print A, B, C in sequence repeatedly.
Hard · Coding, Concurrency, Staff
- View
Implement a multithreaded word counter using ConcurrentHashMap.
Hard · Coding, Concurrency, Collections
- View
ExecutorService fixed thread pool task submission.
Medium · Coding, Concurrency, Senior
- View
ReadWriteLock for cache read-heavy workload.
Hard · Coding, Concurrency, Architect
- View
CountDownLatch service startup coordinator.
Medium · Coding, Concurrency, Senior
- View
Semaphore-based rate limiter.
Hard · Coding, Concurrency, Architect
- View
Virtual threads (Java 21) for concurrent HTTP-style tasks.
Medium · Coding, Concurrency, Java 21
- View
Builder pattern for an immutable object.
Medium · Coding, OOP & Patterns, Builder
- View
Strategy pattern for sorting comparators.
Medium · Coding, OOP & Patterns, Strategy
- View
Factory method pattern.
Medium · Coding, OOP & Patterns, Factory Method
- View
Observer pattern — event bus.
Medium · Coding, OOP & Patterns, Observer
- View
Java 17 record as a DTO with validation.
Easy · Coding, OOP & Patterns, Records
- View
Sealed classes with pattern matching.
Medium · Coding, OOP & Patterns, Sealed Classes
- View
Template method for data export.
Medium · Coding, OOP & Patterns, Template Method
- View
Decorator pattern — coffee pricing.
Medium · Coding, OOP & Patterns, Decorator
- View
Check if two strings are anagrams (character frequency)
Easy · Coding, Strings, HashMap
- View
Group anagrams from a list of strings
Easy · Coding, Strings, HashMap
- View
Find all unique triplets that sum to zero (3Sum)
Medium · Coding, Strings, Two Pointers
- View
Minimum window substring containing all characters of t
Hard · Coding, Strings, Sliding Window
- View
Find the longest palindromic substring
Medium · Coding, Strings, Two Pointers
- View
Container with most water (two pointers)
Medium · Coding, Arrays, Two Pointers
- View
Trapping rain water between elevation bars
Hard · Coding, Arrays, Two Pointers
- View
Count subarrays with sum equal to k (prefix sum + HashMap)
Medium · Coding, Arrays, Prefix Sum
- View
Count number of islands in a 2D grid (DFS/BFS)
Medium · Coding, Graphs, DFS
- View
Number of connected components using Union-Find
Medium · Coding, Graphs, Union-Find
- View
Dijkstra's shortest path in a weighted graph
Hard · Coding, Graphs, Graph
- View
Word Search — find word in 2D grid (backtracking)
Medium · Coding, Graphs, Backtracking
- View
Alien Dictionary — derive character order from sorted words (topo sort)
Hard · Coding, Graphs, Graph
- View
Word Ladder — shortest transformation sequence (BFS)
Hard · Coding, Graphs, BFS
- View
House Robber — maximum loot without adjacent houses
Easy · Coding, Dynamic Programming, DP
- View
Longest Common Subsequence (LCS)
Medium · Coding, Dynamic Programming, DP
- View
0/1 Knapsack — maximum value with weight limit
Medium · Coding, Dynamic Programming, DP
- View
Edit Distance (Levenshtein) between two strings
Hard · Coding, Dynamic Programming, DP
- View
Decode Ways — count ways to decode a digit string (1-26 → A-Z)
Medium · Coding, Dynamic Programming, DP
- View
Merge overlapping intervals
Medium · Coding, Intervals, Sorting
- View
Non-overlapping intervals — minimum removals to eliminate overlap
Medium · Coding, Intervals, Greedy
- View
Meeting Rooms II — minimum conference rooms required
Medium · Coding, Intervals, Heap
- View
Find the single number (every other appears twice) using XOR
Easy · Coding, Bit Manipulation, Fresher
- View
Count set bits (Hamming weight) in an integer
Easy · Coding, Bit Manipulation, Fresher
- View
Check if a number is a power of two
Easy · Coding, Bit Manipulation, Fresher
- View
Search in rotated sorted array
Medium · Coding, Binary Search, Senior
- View
Koko Eating Bananas — binary search on answer
Medium · Coding, Binary Search, Staff
- View
Jump Game II — minimum jumps to reach last index
Medium · Coding, Greedy, BFS
- View
Jump Game I — can you reach the last index?
Medium · Coding, Greedy, Senior
- View
Activity Selection — maximum non-overlapping intervals
Medium · Coding, Greedy, Intervals
- View
Next Greater Element for each array position
Medium · Coding, Monotonic Stack, Stack
- View
Daily Temperatures — days until warmer temperature
Medium · Coding, Monotonic Stack, Stack
- View
Largest rectangle in histogram
Hard · Coding, Monotonic Stack, Stack
- View
Spiral matrix traversal
Medium · Coding, Matrix, Senior
- View
Validate a 9×9 Sudoku board
Medium · Coding, Matrix, HashSet
- View
Set matrix zeroes in-place
Medium · Coding, Matrix, Senior
- View
Implement Trie (Prefix Tree) with insert, search, startsWith
Medium · Coding, Trie, Senior
- View
Word Search II — find all words from dictionary in grid (Trie + DFS)
Hard · Coding, Trie, Backtracking
- View
Maximum depth of a binary tree
Easy · Coding, Data Structures, Binary Tree
- View
Lowest Common Ancestor in a BST
Easy · Coding, Data Structures, BST
- View
Serialize and deserialize a binary tree
Hard · Coding, Data Structures, Binary Tree
- View
Diameter of a binary tree (longest path between any two nodes)
Medium · Coding, Data Structures, Binary Tree
- View
Merge k sorted linked lists
Hard · Coding, Data Structures, Heap
- View
Find median from a data stream (two heaps)
Hard · Coding, Data Structures, Heap
- View
Root-to-leaf path sum equals target
Easy · Coding, Data Structures, Binary Tree
- View
Design Hit Counter — count hits in past 5 minutes
Medium · Coding, System Design Coding, Queue
- View
Design Twitter feed — merge k sorted post streams
Hard · Coding, System Design Coding, Heap
- View
Consistent hashing — locate key on a server ring
Hard · Coding, System Design Coding, Distributed Systems
- View
Distributed unique ID generator (Snowflake-style)
Hard · Coding, System Design Coding, Distributed Systems
- View
Idempotent API handler with idempotency keys
Medium · Coding, System Design Coding, Design
- View
Circuit breaker pattern implementation
Medium · Coding, System Design Coding, Design
- View
Platform plugin registry — load and invoke extensions safely
Hard · Coding, System Design Coding, Platform
- View
Schema registry — validate and version event payloads
Hard · Coding, System Design Coding, Platform
- View
Policy engine — evaluate allow/deny rules on requests
Hard · Coding, System Design Coding, Platform
- View
Median of two sorted arrays (binary partition)
Hard · Coding, System Design Coding, Binary Search
- View
Saga orchestration — coordinate distributed transactions
Hard · Coding, System Design Coding, Distributed Systems
- View
Generate all subsets (power set) of an array
Medium · Coding, Recursion, Backtracking
- View
Combinations of k numbers from 1..n
Medium · Coding, Recursion, Backtracking
- View
Letter combinations of a phone number
Medium · Coding, Recursion, Fresher
- View
Generate all combinations of well-formed parentheses for n pairs
Medium · Coding, Recursion, Backtracking
- View
Maximum subarray sum with at least one element (Kadane)
Easy · Coding, Algorithms, Fresher
- View
Merge overlapping intervals
Medium · Coding, Algorithms, Sorting
- View
Top k frequent elements in an array
Medium · Coding, Algorithms, Heap
- View
Find first and last position of a target in a sorted array
Medium · Coding, Binary Search, Senior
- View
Find minimum element in a rotated sorted array (no duplicates)
Medium · Coding, Binary Search, Senior
- View
Find a peak element (neighbors are smaller)
Medium · Coding, Binary Search, Senior
- View
Integer square root (floor of √x)
Easy · Coding, Binary Search, Fresher
- View
Kth smallest element in a row-wise and column-wise sorted matrix
Hard · Coding, Binary Search, Staff
- View
Implement a Trie with insert and exact search
Medium · Coding, Trie, Senior
- View
Implement startsWith (prefix search) on a Trie
Easy · Coding, Trie, Fresher
- View
Longest word in dictionary that can be built one character at a time
Medium · Coding, Trie, Fresher
- View
Trie search with '.' wildcard matching any letter
Medium · Coding, Trie, Senior
- View
Insert a new interval into a sorted non-overlapping list
Medium · Coding, Intervals, Senior
- View
Meeting rooms — can one person attend all meetings?
Medium · Coding, Intervals, Senior
- View
Find common free time across employees' busy intervals
Hard · Coding, Intervals, Staff
- View
Assign cookies to children — maximize satisfied children
Easy · Coding, Greedy, Fresher
- View
Jump Game — can you reach the last index?
Medium · Coding, Greedy, Senior
- View
Task scheduler with cooldown n between same tasks
Medium · Coding, Greedy, Staff
- View
Daily temperatures — days until a warmer day
Medium · Coding, Monotonic Stack, Senior
- View
Next greater element for each array position
Medium · Coding, Monotonic Stack, Senior
- View
Rotate an n×n matrix 90 degrees clockwise in-place
Medium · Coding, Matrix, Senior
- View
Search a value in row-column sorted matrix
Medium · Coding, Matrix, Senior
- View
Course schedule — can you finish all courses? (cycle detection)
Medium · Coding, Graphs, Senior
- View
Clone an undirected graph with random-value nodes
Medium · Coding, Graphs, Senior
- View
Length of longest increasing subsequence
Medium · Coding, Dynamic Programming, Senior
- View
Partition array into two subsets with equal sum
Medium · Coding, Dynamic Programming, Senior
- View
Find missing number in [0..n] using XOR
Easy · Coding, Bit Manipulation, Fresher
- View
Reverse bits of a 32-bit integer
Easy · Coding, Bit Manipulation, Fresher
- View
LRU cache using LinkedHashMap
Easy · Coding, Collections, Fresher
- View
Custom HashMap with chaining
Medium · Coding, Collections, Senior
- View
TreeMap range queries on timestamps
Hard · Coding, Collections, Staff
- View
PriorityQueue for merge k sorted lists
Easy · Coding, Collections, Fresher
- View
Deque for sliding window maximum
Medium · Coding, Collections, Senior
- View
Generate permutations of distinct numbers
Easy · Coding, Recursion, Fresher
- View
N-queens count solutions
Medium · Coding, Recursion, Senior
- View
Restore IP addresses from digit string
Hard · Coding, Recursion, Staff
- View
Dutch national flag sort three colors
Easy · Coding, Algorithms, Fresher
- View
Kadane variant — max circular subarray
Medium · Coding, Algorithms, Senior
- View
Quickselect for kth smallest
Hard · Coding, Algorithms, Staff
- View
Merge intervals from unsorted array
Easy · Coding, Algorithms, Fresher
- View
Print numbers with two threads alternately
Easy · Coding, Concurrency, Fresher
- View
Thread-safe lazy initialization
Medium · Coding, Concurrency, Senior
- View
Rate limiter with Semaphore
Hard · Coding, Concurrency, Staff
- View
Implement immutable value object with builder
Easy · Coding, OOP & Patterns, Fresher
- View
Adapter pattern for legacy payment gateway
Medium · Coding, OOP & Patterns, Senior
- View
Facade over multiple microservice clients
Hard · Coding, OOP & Patterns, Staff
- View
Proxy for lazy-loading expensive resource
Easy · Coding, OOP & Patterns, Fresher
- View
Chain of responsibility for request filters
Medium · Coding, OOP & Patterns, Senior
- View
Prototype pattern for document templates
Hard · Coding, OOP & Patterns, Staff
- View
Bridge pattern separating abstraction from implementation
Easy · Coding, OOP & Patterns, Fresher
- View
Number of islands (DFS/BFS)
Easy · Coding, Graphs, Fresher
- View
Course schedule cycle detection
Medium · Coding, Graphs, Senior
- View
Clone a graph with random pointers
Hard · Coding, Graphs, Staff
- View
Word ladder shortest transformation
Easy · Coding, Graphs, Fresher
- View
Longest increasing subsequence length
Easy · Coding, Dynamic Programming, Fresher
- View
Edit distance between two strings
Medium · Coding, Dynamic Programming, Senior
- View
0/1 knapsack maximum value
Hard · Coding, Dynamic Programming, Staff
- View
Coin change — fewest coins
Easy · Coding, Dynamic Programming, Fresher
- View
Decode ways for digit string
Medium · Coding, Dynamic Programming, Senior
- View
Merge overlapping intervals
Easy · Coding, Intervals, Fresher
- View
Insert interval into sorted list
Medium · Coding, Intervals, Senior
- View
Meeting rooms — minimum conference rooms
Hard · Coding, Intervals, Staff
- View
Employee free time across schedules
Easy · Coding, Intervals, Fresher
- View
Interval list intersections
Medium · Coding, Intervals, Senior
- View
Remove covered intervals
Hard · Coding, Intervals, Staff
- View
Check if a number is a power of two
Easy · Coding, Bit Manipulation, Fresher
- View
Count set bits (Hamming weight) for an integer
Easy · Coding, Bit Manipulation, Fresher
- View
Single number — every element appears twice except one (XOR)
Easy · Coding, Bit Manipulation, Fresher
- View
Reverse bits of a 32-bit integer
Medium · Coding, Bit Manipulation, Senior
- View
Maximum XOR of two numbers in an array
Hard · Coding, Bit Manipulation, Staff
- View
Divide two integers without using multiplication or division
Medium · Coding, Bit Manipulation, Senior
- View
Find the two numbers that appear once (others twice)
Hard · Coding, Bit Manipulation, Staff
- View
Find first and last position of target
Easy · Coding, Binary Search, Fresher
- View
Search in rotated sorted array
Medium · Coding, Binary Search, Senior
- View
Find minimum in rotated sorted array
Hard · Coding, Binary Search, Staff
- View
Sqrt(x) using binary search
Easy · Coding, Binary Search, Fresher
- View
Capacity to ship packages within D days
Medium · Coding, Binary Search, Senior
- View
Jump game — can you reach last index
Easy · Coding, Greedy, Fresher
- View
Gas station circuit
Medium · Coding, Greedy, Senior
- View
Partition labels
Hard · Coding, Greedy, Staff
- View
Task scheduler with cooldown
Easy · Coding, Greedy, Fresher
- View
Minimum number of arrows to burst balloons
Medium · Coding, Greedy, Senior
- View
Candy distribution with ratings
Hard · Coding, Greedy, Staff
- View
Next greater element for each index
Easy · Coding, Monotonic Stack, Fresher
- View
Daily temperatures — days until warmer
Medium · Coding, Monotonic Stack, Senior
- View
Largest rectangle in histogram
Hard · Coding, Monotonic Stack, Staff
- View
Remove k digits to make smallest number
Easy · Coding, Monotonic Stack, Fresher
- View
Sum of subarray minimums
Medium · Coding, Monotonic Stack, Senior
- View
Online stock span
Hard · Coding, Monotonic Stack, Staff
- View
132 pattern detection
Easy · Coding, Monotonic Stack, Fresher
- View
Spiral order traversal of a matrix
Medium · Coding, Matrix, Senior
- View
Rotate image 90 degrees clockwise in-place
Medium · Coding, Matrix, Senior
- View
Set matrix zeroes if an element is zero
Medium · Coding, Matrix, Senior
- View
Search in a row-wise and column-wise sorted matrix
Medium · Coding, Matrix, Senior
- View
Valid sudoku board (no duplicate in row/col/box)
Medium · Coding, Matrix, Senior
- View
Game of Life — next generation on a board
Medium · Coding, Matrix, Senior
- View
Pacific Atlantic water flow — cells that drain to both oceans
Hard · Coding, Matrix, Staff
- View
Implement Trie insert/search/startsWith
Easy · Coding, Trie, Fresher
- View
Word search II on a board
Medium · Coding, Trie, Senior
- View
Replace words with roots from dictionary
Hard · Coding, Trie, Staff
- View
Longest word in dictionary from characters
Easy · Coding, Trie, Fresher
- View
Map sum pairs with prefix trie
Medium · Coding, Trie, Senior
- View
Design search autocomplete system
Hard · Coding, Trie, Staff
- View
Design a thread-safe in-memory rate limiter
Easy · Coding, System Design Coding, Fresher
- View
Implement a thread-safe LRU cache with per-entry TTL.
Hard · Coding, Production Coding, Concurrency
- View
Implement a token-bucket rate limiter that allows bursts but enforces an average rate.
Hard · Coding, Production Coding, Concurrency
- View
Build a scheduler that runs tasks after a delay, with cancellation, using a single worker thread.
Hard · Coding, Production Coding, Concurrency
- View
Write a reusable retry helper with exponential backoff, full jitter, and a retry predicate.
Medium · Coding, Production Coding, System Design Coding
- View
Wrap a cursor-paginated API in a lazy Java Iterator.
Medium · Coding, Production Coding, Collections
- View
Merge K sorted iterators (e.g. log streams from K services) into one sorted iterator.
Medium · Coding, Production Coding, Data Structures
- View
Design a time-based key-value store: set(key, value, timestamp) and get(key, timestamp) returns the latest value at or before that time.
Medium · Coding, Production Coding, Data Structures
- View
Implement an in-memory key-value store with nested BEGIN / ROLLBACK / COMMIT.
Hard · Coding, Production Coding, Data Structures
- View
Implement request coalescing (single-flight): concurrent calls for the same key share one in-flight load.
Hard · Coding, Production Coding, Concurrency
- View
Build an executor that runs tasks for the same key in order, while different keys run in parallel.
Hard · Coding, Production Coding, Concurrency
- View
Find the top-K most frequent items in an unbounded stream with bounded memory.
Hard · Coding, Production Coding, Algorithms
- View
Create a bounded task executor that applies backpressure instead of growing an unbounded queue.
Hard · Coding, Production Coding, Concurrency