Pergunta de entrevista da empresa The Trade Desk

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