← Amazon questions

Segment tree build, Max subarray with zero sum & LCA in binary tree

Filed under Amazon

Part 1: Build a segment tree for range sum queries. Part 2: Find the maximum length of a subarray that sums to zero. Part 3: Find the Lowest Common Ancestor (LCA) of two nodes in a binary tree.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Amazon questions

Collected from public candidate posts and coding forums. Updated Nov 2026.