Facebook friends

This question is similar to the "Route Between Nodes" from this book. Problem Consider a popular social networking website, Facebook for example. People can create their own profile and add friends. Given two Facebook profiles, I want to…

Validate BST

My usual mistake for this problem: You can not just compare node.left.value < node.value < node.right.value. This does not handle edge cases such as: 10 / \ 5 20 \ 20 20…

Amazon AWS EC2 instances propagation time

This is one of my favorite coding interview questions at the moment. This question reflects a realistic real-world problem. It's not just an artificial question not rooted in any form in reality. Problem statement Ec2 enables customers…