The Mirror Flip
An easy 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
- easy
- Seniority
- L3
Interview Prompt
Our hierarchy exports render backwards on the new right-to-left dashboard layout, so we need each binary tree flipped before it is drawn. The tree arrives as nested dicts of `val`, `left` and `right`; return its mirror image.
Summary
Sometimes the fastest fix is to swap everything.
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