TD interview question

Nothing to difficult