Vendavo interview question

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