Why write an LLD before coding an API?
Coding from a doc prevents rework. The doc forces you to think through input, output, edge cases, database needs, side effects, permissions, and validation. A few hours of LLD saves days of rewriting.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in How to Think Before Writing an API
Start with what the user is trying to do. Then define input, output, status codes, edge cases, database needs, side effects, permissions, and validation. Write a short LLD doc. Then code from the doc.
Because the API serves the user. If you cannot say what the user is trying to do, you do not understand the feature. Starting with the user anchors every other decision (input, output, edge cases).
Resource does not exist (404), user not authenticated (401), user not authorized (403), input invalid (400), duplicate (409), and server error (500). For each, decide what the API should do.
Still have questions?
Browse all our FAQs or reach out to our support team
