You are on page 1of 2

CrownStack Technologies Pvt. Ltd.

Code challenge for PHP Developer

Summary:
The code challenge is very simple for an experienced developer and we think this is going to take around 2-4 hours only. The
purpose of the code challenge is following:

• To check the basic skill of developer.

• To check how developer architects the code and how he/she write the code which is clean, readable and maintainable.

• To filter out non-serious candidates.

• We do judge technical choices, Test cases, code clarity and correctness.

Code Challenge Overview:


The code challenge is the simple project where we are building REST APIs for e-commerce system for your local camera store
where people can come and buy cameras. This. document will provide more detail about code challenge. Please continue to know
more.

• You are free to use any library or third party code but we would like if you write code yourself instead of using a library for simple
tasks.

• When code challenge is finished please send the project file back to HR. Our developers will see your code and come back to
you.

• Candidate need to submit code challenge back within 2 weeks. In case of failure to do so we’ll not consider the application any
further.

• After submitting the code challenge to HR, please wait for couple of days before we write you back.

• The code should be in PHP. Feel free to use any PHP framework in which you are an expert. Laravel is a bonus.

Problem Statement:
The code challenge is the simple project where we are building REST APIs for a local camera store who wants to expand and have
asked you to create REST APIs so that web frontend and mobile app can consume those.

Camera store has various products which are divided into categories. User can add product into cart. Also to use the system user
must login into the system.

Here is the brief description which camera store want you to store in database

Category: A category is like Nikon or Canon which has many products under them. A category has following details -

• name (string, like Nikon or Canon, not null)

• type (string, can only be “Mirrorless”, “full frame”, “point and shoot”, not null)

• model (int, year, like 2018, not null)

Product: A product is a item under a category. It has following details -

• name (string, like Nikon D850)

• category (category it belongs to, for example “Nikon”)

• description (string, product description)

• price (decimal, like 20134.34)

• make (int, year when it was built)

User has to login into the system and add product to cart.

Now as per code challenge please create following APIs

• list all products

• list all categories

• list all products of a specific category

• user login

• add product to cart

• get cart for a specific user

Deliverables:
• Please create above said APIs and host them somewhere so that developers can consume.

• Unit testing and documentation is a bonus.

You might also like