3 ms·
Ask HN: How can I make my API “wow” someone?
I was tasked with creating an API as part of my interview for a junior position. I have never created an API professionally.
What mistakes and pitfalls should I watch out for? How can I make it so they'll think "he knows his stuff?"
For reference on my experience, I had to look up whether I should be using cookies or tokens (interviewer said no outside modules), and how to store them.
- cnj 10y agoThe basics of designing any programming interface apply: Model your domain well, choose good names, try to make things as self-explanatory as possible. Assuming you're tasked with doing a REST/JSON API, you should know both and be able to explain REST. Some things depend on the consumer of the API. For example if you're applying for a position to build an API for a Mobile App company, they'll place a bigger focus on reducing bandwidth, number of calls etc. A single-page-app company may be interested in long-polling/WebRTC/... A microservice company may place bigger emphasis on asynchronous processing with webhooks or so. Here is some advanced stuff that should "wow" someone (but, TBH, I wouldn't necessarily expect a junior dev to implement those): * Instead of REST, implement a GraphQL API * Document your API with Swagger/OpenAPI/RAML (+show some generated doc/client code) * Implement a CQRS API Good luck!
- ziggythesnake 10y agoYep, it's REST/JSON API. Thanks for the info.
- adnanh 10y agoPay attention to: - versioning - consistency in naming - documentation