Trees interview questions
Practice 3 questions on trees. Each runs in a real in-browser editor with Jest tests and a worked, diagram-backed solution.
3 questions
- MEDIUM
Trie (Prefix Tree)
PREMIUMImplement a Trie data structure supporting insert, exact word search, and prefix lookup operations.
25 minAlgorithms - MEDIUM
Union-Find (Disjoint Set)
PREMIUMBuild a disjoint-set structure with near-constant-time union and find, using path compression and union by rank to keep the trees flat.
25 minAlgorithms - HARD
Segment Tree
PREMIUMBuild a segment tree over an array for logarithmic range-sum queries and point updates, each tree node holding the aggregate of its slice.
40 minAlgorithms