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 filters9 questions · browse by bank instead
- Clone GraphWrite `clone_graph(node)` returning a deep copy of a connected undirected graph. Each node has `val` and `neighbors`. The graph has cycles, so a naive traversal never terminates. Keep a map from origmediumCoderpad#graphs#implementation
- Course ScheduleWrite `can_finish(num_courses, prerequisites)` returning `True` when every course can be taken. Each pair `[a, b]` means b must be taken before a. This is "does this directed graph have a cycle." A smediumCoderpad#graphs#implementation
- Course Schedule IIWrite `find_order(num_courses, prerequisites)` returning any valid order in which every course can be taken, or `[]` when no order exists. Same graph as Course Schedule, but now you emit the order. WmediumCoderpad#graphs#implementation
- Graph Valid TreeWrite `valid_tree(n, edges)` returning `True` when the undirected graph on `n` nodes is a tree: connected and acyclic. valid_tree(5, [[0,1],[0,2],[0,3],[1,4]]) -> True Two conditions, and bothmediumCoderpad#graphs#implementation
- Max Area of IslandWrite `max_area_of_island(grid)` returning the number of cells in the largest connected group of `1`s, or `0` when there is no land. The grid holds integers. Identical traversal to Number of Islands mediumCoderpad#graphs#implementation
- Number of IslandsWrite `num_islands(grid)` counting connected groups of `"1"` cells in a grid of `"1"` and `"0"`. Cells connect up, down, left and right — not diagonally. Scan for an unvisited land cell, count it, thmediumCoderpad#graphs#implementation
- Pacific Atlantic Water FlowWrite `pacific_atlantic(heights)` returning every cell from which water can reach both oceans. Water flows to a neighbour of equal or lower height. The Pacific touches the top and left edges, the AtlamediumCoderpad#graphs#implementation
- Rotting OrangesWrite `oranges_rotting(grid)` where `0` is empty, `1` is fresh and `2` is rotten. Each minute, rot spreads to fresh neighbours. Return the minutes until none are fresh, or `-1` if some can never rot. mediumCoderpad#graphs#implementation
- Surrounded RegionsWrite `solve(board)` flipping every `"O"` region fully surrounded by `"X"` into `"X"`, modifying the board in place. A region touching the border is not surrounded. [["X","X","X"],["X","O","X"],[mediumCoderpad#graphs#implementation