Last active
May 22, 2020 09:04
-
-
Save muslemomar/b920ea135b044ddf900c813fd655fc22 to your computer and use it in GitHub Desktop.
Take Home Web Project Questions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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).
Yes, the number have to be consecutive. If the current integer is "5", calling "next integer" must return "6". Returning "7" would be invalid.
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.
Integers are not unique across users. Two users can have the same integer.