Pergunta de entrevista da empresa Wells Fargo

How to avoid overfitting and underfitting in machine learning?