Backend Challenge

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

Turing

1900 Embarcadero Road #104,


Palo Alto, California 94303, U.S.A

Backend Challenge
Overview
In this challenge, you will build the backend of an e-commerce system which allows users to
search, add items to their shopping cart, create orders, and checkout successfully.

Given a database in MySQL (Github), you will need to implement the backend. Note that our
challenge templates for the backend come already setup to use the Turing MySQL database.

Please feel free to use whatever frameworks/languages you feel most comfortable using. We
offer challenge templates in some languages that we have high demand for (Node.js, PHP
Laravel, ASP.net, and Python Django). We have fewer customers interested in engineers skilled
in other technologies, but they still exist and we can match you if you do exceptional work in this
project.

Any advanced techniques, tools, frameworks used in the code will also give you bonus points.
Please add notes in the readme file so we can easily find and evaluate them.

Our customer companies have very high standards for software engineers, so please do your
best possible work here to impress them.

Before You Start


2
Prior to starting your challenge, you are required to set up your account on our Workspace
site. It is built to provide you a good way to communicate with our Turing team while helping
you track your own working time.

Successfully set up your account on the site above will mark the start of your challenge. If you
found that you have time to complete the challenge, please do the following:

1. Visit the following link when you are ready to start: Workspace
2. Sign in with your Turing account and follow the instructions.
3. Set up your stand up time on the Standups tab and make a report daily starting the next
day
4. Create tasks and use our time tracking system on the Workspace tab once you are
working on the challenge.

The actions above are mandatory to work on this challenge. Failing to do so will negatively
affect your candidacy.

Code Template

If you plan to implement the challenge using NodeJS, Django, ASP.net, or Laravel we
provide Back End templates. Using one of these templates will greatly save your time on the
project and help with our evaluation. We also offer the ability for challenges built off of these
templates to be automatically hosted by us. More information about the templates can be found
inside the links below:

NodeJS Back End Template

Laravel Back End Template

Django Back End Template


3
ASP.net Back End Template

Getting Started - Important

1. Endpoints
a. Follow the API Template Document in this link, All endpoints, inputs, and outputs
need to be exactly matched this documentation. This is your guide.
2. Database
a. You must use our Turing database’s data to implement the whole project, but you
can modify the structure to fit your advanced implementation if you need. Our
challenge templates come setup with our DB.
3. Errors
a. Use this link to check the list of errors, you need to use these codes and
messages.
4. Authentication
a. The Authentication should use a header param named 'USER-KEY' using Bearer
scheme.
b. Your application needs to return the key preceded by the word 'Bearer' at
'/customers' and '/customers/login'.
5. Payment
a. You should use our Stripe API key 'sk_test_lomdOfxbm7QDgZWvR82UhV6D' to do
the charge.
b. You should send the 'order_id' on metadata property to Stripe.

Core expectations
1. Project structure: Use best practices for your project structure so it can be scaled easily.
4
2. Error handling:

a. Clear error handling flows


b. Document API errors: Let your API callers know which errors might come in
return so they can handle these thoughtfully without crashing.
c. Use loggers to increase error visibility

3. Functionalities: Work as expected. Precise inputs/outputs. Users can go through flows


smoothly. No critical bugs.

4. System Design: Use the most advanced backend architecture as you can.

5. Coding: Clean code with best practices. Good coding style. Good comments. Easy to
read, debug, and extend the APIs.

6. Performance:

a. The API should be able to support a high number of requests with low latency,
CPU usage. If you can prove that through APM tools, that’s great.

b. Use state management and caching techniques

7. Security: Use best practice to avoid DOS attacks, query injection vulnerabilities, cross-
site scripting...

8. Testing: You should add test cases for the main functions of the system.

9. Deployment: Host your solution online and provide the URL. You may also use our
hosting functionality if you used one of our challenge templates or if your project
otherwise meets our hosting requirements (described below).
5
10. Documentation: Describe the architecture, technologies you use in your documents
and readme file (visually with images, diagrams…). Provide clear backend API
documentation so other developers can follow and use your APIs easily.

11. Source Code: please upload your source code on Github, set it private, and invite
TuringCom as Collaborator.

Feature requirements
1. Users can view all items when entering the website
2. Items are displayed properly based on the selected department and category
3. Users can search items through search box
4. Support paging if we have too many items
5. Users can see item details by selecting a specific item
6. Users can add items to their shopping carts
7. Users can register/login using website custom forms, or social login libraries
8. Users can update personal profiles with shipping addresses and other info
9. Users can checkout with Stripe payment gateways. This requirement is mandatory, you
must use the related APIs for the payment.
10. Users will get confirmations over emails about their orders
11. Clear unused shopping cart frequently.

Advanced requirements

1. The current system can support 100,000 daily active users. How do you design a
new system to support 1,000,000 daily active users?
● Describe your design clearly in the documentation so we can follow your steps
● Implement backend code + database if possible
6
2. A half of the daily active users come from the United States. How do you
design a new system to handle this case?
● Describe your design clearly in the documentation so we can follow your
steps
● Implement backend code + database if possible

Design
Please check out the design at Github to have a clearer product vision.

Automated Hosting
To help save you time, we offer the ability to host your project in an automated fashion. To use
this feature, submit your project by filling in the form below. If you built your project using one of
our challenge templates, then your project is already set up to be automatically hosted by us
upon submission and you do not need to do anything extra. If you wish to have us host a
custom solution that you built, then your project must contain an appropriate Dockerfile and
entrypoint shell script. You can find an example setup in one of our backend challenge
templates listed below:

NodeJS Back End Template

Laravel Back End Template

Django Back End Template

ASP.net Back End Template

What to Submit
7
Once you finished the whole project or the submission deadline is over, you may
either submit your project to us via the form below or email.

If you wish to submit your project via our automated hosting and submission form,
ensure that your project conforms to the Automated Hosting guidelines above, and then fill out
the form appropriately. The source code that you upload should be in a .zip format.

Please send an email to [email protected] with the following information: your


full name, the source code link, hours spent on the project, hosted link, documentation about the
back end architecture, API documentation.

Lastly, please log in to Workspace again and set up the Notifications(by clicking your
Account Name) to stop sending reminder emails to your email address.

Question
If you have any question or concern about our challenge. Please send an email to

[email protected] or create an issue on the Github repository we have given. We already

created a list of Frequently Asked Questions, feel free to check it out: FAQ

You might also like