Serialize Arithmetic Expression Tree with Minimum Parentheses
Asked at Waymo · Coding Questions · Difficulty: Hard · Last asked Apr 27, 2026
Write `serialize(tree)`, which turns an arithmetic expression tree into an infix string that uses as few parentheses as possible while still describing exactly the same tree. A reader (or a parser) who evaluates the string with the usual operator rules must rebuild the original structure.
Loading the problem…
More Waymo interview questions
- ML System Design: Choose Passenger Drop-off Location
- L5+ Behavioral: Policy vs Efficiency Trade-offs & Leadership
- Fix a Buggy Matrix Class
- Project Deep-Dive + ML Fundamentals Discussion
- ML System Design: Behavior Prediction from Sensor + Camera Data
- ML System Design: Inference Serving with Back-of-Envelope Capacity Planning