Agoda interview question

1. Binary Search Tree 2. Rotate array