Pergunta de entrevista da empresa Capital One

How do you know when a model is underfitting/overfitting?