Pergunta de entrevista da empresa Leap Tools

API interview: Asks about HTTP responses, and status codes, while I was coding. What should be the response of these functions

Resposta da entrevista

Sigiloso

12 de nov. de 2025

Creating item should return 201 on success, 500 for generic error Retrieving items: 200 when success, 404 when not finding an specific item, 400 if there is a bad request, 500 for generic error Deleting: 200 on success, 400 on bad request, 404 or 200 on not finding, 500 for generic error Updating: 200 on success, 404 on not found, 400 for bad request, 500 for generic error