Skip to content
Sharp

FastAPI · interview question

Which move is the best default when api errors becomes part of this workflow?

Multiple choiceHardchapter-13-curatedpremiumfastapiapi-errors
Choose one answer
Answer and explanation

Correct answer

D. Return status codes and messages that are truthful for the caller while preserving deeper detail in logs.

Why

Return status codes and messages that are truthful for the caller while preserving deeper detail in logs. That is the stronger engineering move because good interview answers distinguish caller-facing errors from operator-facing diagnostics. Dumping raw exceptions at the client boundary makes the API feel accidental and insecure.

Test yourself on FastAPI

A free test with instant, explained results. No account needed.

Start free test
All FastAPI questions →