Cadence Design Systems interview question

Write an algorithm that finds maximal depth of a tree