← Amazon questions
CodingReported in a candidate post, Sep 2022

Find duplicate subtrees

Filed under Amazon

Given the root of a binary tree, identify and return all duplicate subtrees. For each unique duplicate subtree pattern, return the root node of any one instance of that duplicate subtree. Two trees…

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.