← Questions

Tree class with depth-first and breadth-first operations

0
CoreWeaveOO designLast asked Jul 2026

An object-oriented design interview question asked in CoreWeave's coding round, last asked Jul 2026. It tests trees, dfs and bfs.

Design a tree class and implement a set of operations on it. Some are naturally depth-first and some breadth-first: implement each with the traversal that suits it, and explain the choice.

Sign in to unlock this question

The full prompt, the worked answer and your own canvas or code with the AI tutor. New accounts get 5 credits: each one unlocks a question for good.

Where it's asked

What it tests

trees · dfs · bfs · object-oriented design

Your canvas and the AI tutor open when you unlock this question.