Domanda di colloquio di The Trade Desk

Explain how a Decision Tree works from first principles, and how I could implement one without using any library.