0% found this document useful (0 votes)
5 views

Java Machine Coding Round

The document outlines a coding task to create a Spring Boot web application with a User entity. It specifies the required API operations for managing users, including fetching, updating, and deleting user details, along with the necessary project setup and structure. Additionally, it emphasizes the importance of proper syntax, variable naming, REST mappings, and exception handling in the implementation.

Uploaded by

Rishabh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Java Machine Coding Round

The document outlines a coding task to create a Spring Boot web application with a User entity. It specifies the required API operations for managing users, including fetching, updating, and deleting user details, along with the necessary project setup and structure. Additionally, it emphasizes the importance of proper syntax, variable naming, REST mappings, and exception handling in the implementation.

Uploaded by

Rishabh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Java Machine Coding Round

Time : 45 mins

Description :

You would need to create a spring boot web app with User entity and the
ability to do the following api operations:
i. Get user details of all users
ii. Fetch user based on Id
iii. Update details for a User
iv. Delete a user based on id

1. Create a new spring boot project


2. Add any relevant dependencies
3. Create a User entity with the following Fields :
a. Id (Long)
b. Name
c. Address
d. PlanName
e. SubscriptionDate (Timestamp)
4. Create a jpa repository interface for the User
5. Create a service class to handle the following:
a. Save a new user in db
b. Get user by id
c. Get all users
d. Update user details
e. Delete a user
6. Create a controller class with the following rest api’s endpoints:
a. /user – to save a new user
b. /users – to get all users
c. /user/{id} – to get user by id
d. /user/{id} – update user details for the given user id and
updated details passed in request body
e. /user/{id} – to delete a user based on Id

Please make sure to use correct syntax, proper variable names, rest
mappings, exception handling of responses wherever need be.

You might also like