Vendavo Interview Question

Given a thread problem asked to solve it, Binary tree depth