Wells Fargo Interview Question

How to avoid overfitting and underfitting in machine learning?