UBS Interview Question

write an algorithm to find the depth of n-ary tree