All Questions
Api Design easy

A client sends invalid JSON to your API. What should the response include?

  1. A Return a 200 OK status containing a JSON body with { "error": true, "message": "Bad JSON" }.
  2. B Return a 400 Bad Request status with a structured error body describing the validation failure.
  3. C Return a 500 Internal Server Error to indicate the server failed to process the input.
  4. D Close the TCP connection immediately to save server resources.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions