Ganpat University interview question

Explain how DocTypes work in ERPNext.