Pregunta de entrevista de Wells Fargo

How to avoid overfitting and underfitting in machine learning?