We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 3
Relevel Backend Development
by Unacademy Practice Questions
Round 3 - Java
Skills tested (Clean, Readable, Clean, Readable, Functional, API, Bugs )
X
Create your Feature
Problem Statement
Relevel is planning to build an online bookstore just like https://www.sapnaonline.com/
where users can buy books of different categories or genres. You have to design & build
the backend for this online bookstore application. It should have the ability for the users
to register, log in, place an order for a book, facility for the bookstore manager to add
and remove books from the store.
Your task is to go through below templates/stories and create an online bookstore for
the Relevel. The tech stack required is Java and Spring Boot. The preferred IDE is
Intelli/Eclipse to import the project directly. Postman tool to test the REST APIs. Make
sure maven and .m2 etc are configured on local
Please solve the problem(s) mentioned below and submit them to us.
Your submission must contain
- Alink to your code.
- Ascreen recording explaining your app.
Follow the standard naming conventions and comment on the code well, so that it is
easily understandable. We are looking for a basic working prototype so make your
assumptions accordingly and pace yourself,
Problem Setup
1, Download the code template on your local system
2. Install spring-boot-suite from https://spring.io/projects/spring-boot. Import project in
spring-boot-suite installation. You should now be able to build the code.
3. The default port is set to 8080 for this application, and there is a sample endpoint to
test the set-up is complete. Open the sample URL localhost:8080\ping in the
browser to see a message “Ping is Successful’. This ensures the set-up is complete.
4. Database Set-Up: The application is configured with an in-memory H2 database.
Dependency for the database is already added in the pom.xml file. You can create
tables for your problem statements using this database.
5. You can access the console of the H2 database using the following link.
URL for H2 Database: locahost:8080/h2-console
Username: sa
Password: passwordRelevel Backend Development
by Unacademy Practice Questions
Round 3 - Java
User Stories
Story 1: Create a User
The task is to create an endpoint localhost:8080/user so that we can create a user
1, Choose appropriate HTTP methods(GET,POST,PUT,DELETE) to hit this URL.
2. The user should provide details like Name, Password, Phone Number, Email ID, Age,
Gender, Address
3. Validate the user input (e.g. valid phone numbers, valid email address, Age range from 5-100
years, the password should be 8 characters minimum etc.) before saving the details to the
database,
4. Create an appropriate table to store these details of the user
5, Upon successful creation of the user return HTTP status as 201 with a message “User Created
Successfully”
6. If the user has provided wrong input, provide appropriate HTTP status
Story 2: Login for the User
The task is to create an endpoint localhost:8080/login so that we can verify if user credentials are
valid
1. Choose appropriate HTTP methods(GET,POST,PUT,DELETE) to hit this URL.
2. The user needs to provide an email address as username and password to verify if the user
credentials are correct.
3. Authenticate the value against the data stored in the database and upon successful
authentication return appropriate HTTP status with JWT token:
4, In case the user has provided a wrong password, return an HTTP status as 401 with the
message as “Invalid Password’.
5. Ifthe user name provided by the user doesn't exist return an HTTP status as 404 with the
message “User does not exist’.
‘Submission Instructions
Code Submission:
1. Compress the code on the local system in the form of a “zip file.
2. Upload the code on your personal google drive in a folder titled - “Name_BD_
Code Base”
3. Don't forget to change the permissions of the folder to ‘Anyone with the link can edit.
Loom video submission:
1. Create an account on Loom
2. Go through the quick tutorial on how to record loom videos.
3. Create a Loom video (while screensharing) covering the following points:
a. Show the functionality of the app you have created i.e demo of the working APIs through a
‘command line. (1 min)
b, Run through the key parts of your code explaining the core logic and how you organized the
code. (2 min)
. Explain your problem-solving approach (what logic you have used and why), (2 min)
4, Please keep your explanation to under 5 mins only.
5. Avoid too much jargon and explain your app in a simple and clear manner.Relevel Backend Development
by Unacademy Practice Questions
Round 4 - Java
S
( Maintainable, Code Standardization, Scalable, Functional, API, Bugs,
\. Communication (through Loom Video) )
Skills tested
Optimise your Feature
Problem Setup
You would need to use the same setup as in the previous round. You need to extend the
code written in the previous round,
|: Retrieve the details of the user
The task is to create an endpoint localhost:8080/user/(userid) to fetch the user details
1, Choose appropriate HTTP methods (GET, POST, PUT, DELETE) to hit this URL.
2. The user needs to provide the ID of the user to get user details as a response.
3. In case the user provides an ID that does not correspond to any user, they should see an
HTTP 404 status with “No users for the given ID” as the response message.
4, In case of Success, the user should see details of the user with appropriate HTTP status