โ† Amazon questions

Nodes at K distance from leaves and Java equals/hashcode

Filed under Amazon

Find all nodes in a binary tree that are exactly distance K from any leaf node. Also, explain the contract between equals() and hashCode() in Java.

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.