The Sum of Its Parts
A medium Python mock interview question on DataDriven, with an AI interviewer who asks follow-up questions and a hire or no-hire decision at the end.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid
Interview Prompt
A 3D modeling tool stores each design as an assembly tree: every component has a `name`, a `quantity` saying how many of it sit inside its parent, and a `children` list of sub-components nested arbitrarily deep. Roll the design up into how many of each basic part, the ones not made of anything smaller, it takes to build the whole thing.
Summary
Every assembly hides smaller ones. Count what it really takes to build.
How This Interview Works
- Read the vague prompt (just like a real interview)
- Ask clarifying questions to the AI interviewer
- Write and run your Python against test cases
- Answer the interviewer's follow-up questions, then get a hire or no-hire decision