InterviewDigestInterviewDigest

OA Practice Workspace

Technical2026-08-16

Zig-zag traversal of a binary tree

AI-Expanded — inferred from the question title, not from the original candidate report

Given a binary tree, return the zigzag level order traversal of its nodes' values, where you traverse from left to right for the first level, right to left for the second, and alternate directions for each subsequent level. The output should be a list of lists, where each inner list represents the nodes at a specific depth in the specified zigzag order.

Context & Summary

Face-to-face interview (1 hour 30 mins) where the interviewer asked three technical questions and discussed OOPs concepts.

💻 Coding practice works best on desktop.
Code editors are too cramped on mobile screens.