Skip to content

Instantly share code, notes, and snippets.

@muslemomar
Last active May 22, 2020 09:04
Show Gist options
  • Save muslemomar/b920ea135b044ddf900c813fd655fc22 to your computer and use it in GitHub Desktop.
Save muslemomar/b920ea135b044ddf900c813fd655fc22 to your computer and use it in GitHub Desktop.
Take Home Web Project Questions
1) So you said that the API should not use a database and at the same time it should allow you to register users.
The only possible way is storing users in the memory, but restarting the server will reset the integers. is that ok?
2) Do the numbers have to be exact sequential (one exactly after another)?
for example if current integer is "5", if the user call "next integer" endpoint, it will return you "7" or "10" any integer larger than current one. is that ok?
3) Can the integers be large like "1590081234" ? Actually I have the idea of using timestamps 😅.
4) Should the integers be unique accross users also ? I mean can 2 users or more, share the same integer?
Thanks!
Muslim
@mujz
Copy link

mujz commented May 22, 2020

  1. The problem does not say that the API should not have a database; rather, it's saying that the API client doesn't need to have a database. The API server surely needs a database of some sort. However, the client calling the API doesn't (as outlined in the user story).

  2. Yes, the number have to be consecutive. If the current integer is "5", calling "next integer" must return "6". Returning "7" would be invalid.

  3. Feel free to use whatever makes sense to you here. The specifications don't dictate the size of the integers, so feel free to set your own limitations.

  4. Integers are not unique across users. Two users can have the same integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment