Java with Spring Boot Test
Total Time: 2 Hours
Total Marks: 100
Section A – Core Java & Spring Boot MCQ (20 Marks)
• 1. Which annotation is used to mark a class as a Spring Boot Application?
• 2. Which dependency is required to create REST APIs in Spring Boot?
• 3. What does @Autowired do?
• 4. Which annotation is used to create REST API methods?
• 5. Which layer communicates directly with database?
• 6. Spring Boot is built on which framework?
• 7. Which annotation converts Java object to JSON response?
• 8. What does Spring Boot Starter do?
• 9. Which file contains application configuration in Spring Boot?
• 10. Which tool is commonly used for dependency management?
Section B – Short Answer Questions (30 Marks)
• What is Spring Boot and why is it used?
• Difference between @Controller and @RestController.
• What is Dependency Injection in Spring Boot?
• Explain Spring Boot Auto Configuration.
• What is Spring Data JPA?
• What is the use of [Link] file?
• Explain Spring Boot Starter Web.
• What is REST API?
• Difference between GET and POST request.
• What is Bean in Spring Framework?
Section C – Machine Round (Coding Tasks) – 50 Marks
Task 1 – Student Management REST API (20 Marks)
Create a Spring Boot application that manages student records with fields: id, name, email, course.
APIs: POST /students, GET /students, GET /students/{id}, DELETE /students/{id}
Task 2 – Product CRUD API (15 Marks)
Create Product API with fields: id, name, price, category.
APIs: Add product, Update product, Get all products, Delete product using Spring Data JPA.
Task 3 – Simple Login API (15 Marks)
Create login API with fields: id, username, password.
Endpoint: POST /login. Return Login Success if credentials match database otherwise Invalid
Credentials.
Bonus Question (Optional – 10 Marks)
Explain the flow of a Spring Boot request from Controller → Service → Repository → Database.