ByteDance·Software Engineer·Technical Phone Screen
Apr 2026
Bytedance SWE interview with a binary tree problem that looked straightforward until the follow-up hit. One round, pretty algorithm-heavy, left me second-guessing my path reconstruction logic the whole way home.
- Given the root of a binary tree, find the maximum path sum. A path can start and end at any node, doesn't need to go through the root, and each node can only be used once. Solve it in O(n) time.
- Follow-up: can you reconstruct and print the actual sequence of node values along that optimal path, not just the sum?
“Post-order DFS was the right call and I got there, but explaining why I needed to track the downward gain separately from the global max took me longer than it should have.” The rest of the author's notes on Software Engineer interview at ByteDance, Technical Phone Screen round, covers how they worked through the question, what the panel pushed back on, and what they would do differently.
View Post