21/05/2024, 22:24 Backend Task
Backend Task
Task Overview
You are tasked with designing and implementing a distributed e-commerce platform that
allows global users to place orders with multiple items. The platform should ensure strong
data consistency across distributed components, handle network partitions and
concurrent updates, and incorporate a rate-limited API. Additionally, implement distributed
transactions to handle various order processing components.
You are open to choose any JavaScript frameworks(Express JS, Nest JS).we would prefer
[Link] + Postgresql
Task Components:
Order Placement and Inventory Management:
1. Design a database schema for orders and inventory, considering the distributed
nature of the system.
2. Choose an appropriate database technology or combination of technologies for
scalability and performance.
3. Implement a transaction management system ensuring atomicity, consistency,
isolation, and durability (ACID properties) for order placement and inventory updates.
4. Handle scenarios like network partitions and concurrent updates to the same
inventory item.
Rate-Limited:
1. Implement a rate-limited for various routes.
2. Allow users a maximum of 10 requests per minute.
3. Return a 429 Too Many Requests status code if a client exceeds the limit.
4. Uniquely identify clients using an API key provided in the request header.
5. Implement in-memory storage to keep track of request counts.
Distributed Transactions:
1. Extend the order placement scenario to involve multiple microservices or
components responsible for different aspects of the order process (e.g., payment
processing, shipping).
2. Implement a distributed transaction management system to ensure that all
components commit or rollback transactions atomically.
3. Consider and implement strategies for handling failures in one part of the system,
ensuring transaction consistency.
Containerization:
1. Dockerize the entire application.
2. Provide instructions for setting up the application using Docker.
Testing
Ensure the application is robust and error-free.
Unit Testing:
[Link] 1/4
21/05/2024, 22:24 Backend Task
1. Write unit tests for critical backend functionalities.
2. Use a testing framework like Jest or Mocha.
Security Considerations:
1. Briefly discuss security considerations in your application, such as handling
2. Sensitive data and preventing common vulnerabilities.
Submission Guidelines:
1. Provide a well-documented Submission file explaining how to set up and run the
application.
2. Include relevant documentation for API endpoints.
3. Share the source code via a version control system (e.g., GitHub).
This task aims to assess your ability to design and implement a distributed system, handle
rate limiting for API endpoints, and manage distributed transactions in a complex real-
world scenario. It requires a combination of database design, transaction management,
API development, and distributed system architecture skills.
Deadline: 23 May(Thursday)(8 AM) (Approximately 45 Hours from now)
If you have any queries, Contact: 01701270341
Best regards,
HR,
Masterkey Technologies Ltd.
[Link]@[Link] Switch account
The name, email, and photo associated with your Google account will be recorded when you
upload files and submit this form
* Indicates required question
Your Full Name (English) *
Your answer
[Link] 2/4
21/05/2024, 22:24 Backend Task
Email Address *
Your answer
Contact Number *
Your answer
Submission File Link: [Please make it public] *
Your answer
GitHub Repository link *
Your answer
API Documentation Link
Your answer
Upload your Updated CV *
Add file
Submit Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy
Forms
[Link] 3/4
21/05/2024, 22:24 Backend Task
[Link] 4/4