Your task, should you choose to accept it, is to create a bookmarking application with these properties:
- Multiple users, can create an account on the system by themselves.
- Users can create, edit or delete private or public bookmarks.
- the mandatory bookmark structure is:
- description
- bookmark link
- is public the rest is up to you
- the mandatory bookmark structure is:
- Users can list their own bookmarks and public bookmarks made by everyone.
For this task you must use the latest versions of Python, Django and Django Rest Framework. Feel free to add any other libraries you need. The application only exposes the API. Do not implement the frontend, but provide a way to demonstrate that the API endpoints work. This can be a bash script with Curl commands.
Try to achieve as much test coverage as possible.
In addition, please answer these questions:
-
What database would you choose to use for this application?
- relational one beacuse of the feature to filter bookmarks by foreign key
-
How would you scale this application to support millions of users?
- implement caching at least for basic feature as "list my own bookmarks"
- more caching strategy depending on app usage pattern
- distribute app to many cloud servers and put a load balancer in front
- extend the database to cluster
- depending on user beahavior maybe introduce replicated read only database nodes to speed up reads
- maybe build a separate bookmark storage service to handle create bookmark requests and implement queue
-
How would you implement a background service that checks the validity of links stored in the database?
- extend a model with some timestamp "last checked" and run a scheduled task which would check the URLs periodically
- in case when URL is not available, maybe put a bookmark into a state "Unavailable" and give it some time to recover
- after X amount of time mark a bookmark as "Invalid" and give a user notification and a way to edit or remove it
-
Describe approaches you can use to test this code.
- by TestCase of Django
- by unit tests
- by curl or http from shell
- by Selenium
- by cron job to test application health (and also implement health info at some endpoint)
-
Bonus: describe what online resources you used to build this application and prepare answers to these questions.
Please time-box this project to no more than 2-3 hours. The application does not have to be in perfect working condition, it is more important for us to see your approach to building applications.