Question Bank
Every question, one list
Sandboxed coding rounds that run against a hidden test suite, and written questions graded against a rubric — side by side, because when you are drilling a topic you want both.
Topicimplementation (105)system-design (24)hld (20)trees (11)distributed-systems (10)arrays-hashing (9)concurrency (9)graphs (9)binary-search (8)consistency (8)dp-1d (8)linked-list (8)reliability (8)storage (8)
Clear filters12 questions · browse by bank instead
- Alien DictionaryWrite `alien_order(words)` returning a letter order consistent with the given sorted word list, or `""` if none exists. Any valid order is accepted. ["wrt","wrf","er","ett","rftt"] -> "wertf" hardCoderpad#advanced-graphs#implementation
- Binary Tree Maximum Path SumWrite `max_path_sum(root)` returning the largest sum along any path between two nodes. The path follows parent-child edges, need not touch the root, and must contain at least one node. Values may be nhardCoderpad#implementation#trees
- Find Median from Data StreamImplement `MedianFinder` with `add_num(num)` and `find_median()` returning the median of everything added so far, as a float. Keep a max-heap of the lower half and a min-heap of the upper half. Fix ahardCoderpad#heap#implementation
- Largest Rectangle in HistogramWrite `largest_rectangle_area(heights)` returning the area of the largest rectangle that fits under the histogram. largest_rectangle_area([2, 1, 5, 6, 2, 3]) -> 10 (heights 5 and 6, width 2) hardCoderpad#implementation#stack
- Median of Two Sorted ArraysWrite `find_median_sorted_arrays(a, b)` returning the median of the two ascending arrays combined, as a float. find_median_sorted_arrays([1, 3], [2]) -> 2.0 find_median_sorted_arrays([1,hardCoderpad#binary-search#implementation
- Merge k Sorted ListsWrite `merge_k_lists(lists)` merging `k` ascending linked lists into one and returning its head. The input may contain empty lists. Merging them one at a time into an accumulator is O(n k) — say so, hardCoderpad#implementation#linked-list
- Minimum Window SubstringWrite `min_window(s, t)` returning the shortest substring of `s` containing every character of `t` including duplicates. Return `""` when no such window exists. min_window("ADOBECODEBANC", "ABC")hardCoderpad#implementation#sliding-window
- N-QueensWrite `solve_n_queens(n)` returning every board on which `n` queens share no row, column, or diagonal. Each board is a list of `n` strings using `Q` and `.`. Place one queen per row, so rows never cohardCoderpad#backtracking#implementation
- Serialize and Deserialize Binary TreeImplement `serialize(root)` returning a string, and `deserialize(data)` rebuilding the tree, so that the round trip preserves the tree exactly. Pre-order with an explicit marker for every missing chihardCoderpad#implementation#trees
- Sliding Window MaximumWrite `max_sliding_window(nums, k)` returning the maximum of every contiguous window of width `k`, left to right. max_sliding_window([1,3,-1,-3,5,3,6,7], 3) -> [3, 3, 5, 5, 6, 7] A heap gives hardCoderpad#implementation#sliding-window
- Trapping Rain WaterWrite `trap(heights)` returning the total units of water trapped between the bars after rain. trap([0,1,0,2,1,0,1,3,2,1,2,1]) -> 6 Water above any bar is `min(max_left, max_right) - height`. PhardCoderpad#implementation#two-pointers
- Word Search IIWrite `find_words(board, words)` returning every word from the list that can be spelt by walking adjacent cells (up, down, left, right) without reusing a cell in a single word. Return them in any ordehardCoderpad#implementation#tries