Hacker News new | past | comments | ask | show | jobs | submit login

I haven't bootstrapped a full api in years. For my job we just keep keep adding to an existing monolithic api under a big framework (django). I've literally gotten two interviews where they wanted me to bootstrap api's to solve a specific problem on the spot.

To handle interviews I spent a day creating a barebones api under a simpler framework that had example routes for some possible question types like Backend http requests, sql calls, and redis.

Then I abstracted the mundane data transformation functions like "text to json" or "json to text", or "json to response object" into decorators. Literally the views just fetched some data from sql and returned the raw data, while the decorators would handle the necessary transformations.

By doing this leg work first, and writing the api so that in timed interviews you don't have to think about anything other then fetching and returning data (of course the decorators aren't enough to handle all data processing cases) you can outperform other candidates by spending more time working on the problem rather then thinking about configuration or type conversion.

Also it would be good to use a pattern that scales and is a bit unconventional to help you stand out. I chose coroutines with httpaio (I'm a primarily python developer) which is really different from what most people use (flask).

I recommend creating your own barebones template for interviews but you can view what I did here: https://github.com/crimsonalucard/aiohttp_bootstrap/blob/mas...

AS you can see even bootstrapping an api is over a hundred lines of code. If they want you to pull that magic off from scratch in 2 hours, good luck, psh. It took me about 8 hours to write the bootstrap code (Albeit I was dealing with a completely new frameworks, libraries and patterns I've never used at work).

The good thing about having a barebones api setup and running it on your computer is that often these live coding interview questions happen on your computer.

Just some tips. Good luck everyone.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: