All jobs / Frontend / web developer
Frontend / web developer interview question · 1–3 years
The team argues whether a field is `userId` or `user_id`.
What is OpenAPI for here?
The strongest answer
The living contract both sides generate types and tests from — not a PDF we update after the merge
Why it works
Exactly. If the spec is generated or checked in CI, a renamed field fails the build instead of the demo.
What a good answer covers
- OpenAPI is the join, not a brochure.
- Generate types or fail CI on drift.
- Review spec diffs like you review SQL.
- Docs that lag the code are a second, lying API.
Answers that fall short
- Close, but not the strongest: A pretty docs page for external users only
Public docs are a bonus. The value is the same file your UI already imports. - Weak: A file we export once from the controllers when we remember
A stale export is folklore with a YAML hat. - Red flag: A replacement for talking to the frontend team
The spec is how you talk — not how you avoid talking.
Who gets asked this
More Frontend / web developer questions
- When does React.memo help, and when does it not?
- The register API can fail because the email is taken or because the password is too short. What should the UI…
- The app feels sluggish when typing in one field. How do you find the cause?
- Where should state live, as a rule?
- Why do teams use a server-state library instead of useEffect plus useState for data?
- Choosing between client rendering, server rendering, static generation and streaming for a new product — how…
- A 400-component app has become impossible to change safely. What structural move do you make first?
- Different screens show different values for the same entity. What is the root cause and the design fix?