← Samsung questions

Binary Tree Diameter and LRU Cache

Filed under Samsung

Implement a solution to find the diameter of a binary tree in O(n) time. The diameter is the length of the longest path between any two nodes. Additionally, be prepared to discuss LRU Cache design and…

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 Samsung questions

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