Bloomberg Interview Question

First one was Validate BST and the second one was build queues using stacks.