Amplify interview question

Coding challenge about family trees