SpringBootandMSPart1
Test Name: Spring Boot and Microservices Developer Assessment
Total Marks: 100
Instructions:
- You
have 2 hours to complete this test.
- Read
each question carefully before attempting it.
- You
are not allowed to use any resources, including online documentation.
- Write
your code in a clear and organized manner.
- Provide comments for your code when
necessary.
- Ensure
that your code is well-structured and follows best practices.
- You
must submit your solutions before the 2-hour time limit expires.
- Each
question has a specified number of marks.
Question 1 (10 marks): Spring Boot Basics
- Create
a simple Spring Boot application that displays "Hello, Spring
Boot!" when accessed via a web browser.
- Include
a brief explanation of how you configured the project.
Question 2 (15 marks): Spring Boot REST API
- Create
a RESTful API endpoint that allows users to retrieve a list of books.
- Define
a Book class with attributes like title, author, and publication year.
- Implement
methods for listing all books and adding a new book.
- Include
proper error handling.
- Provide
documentation for your API using Swagger or any other suitable tool.
- Include a brief explanation of how you configured the project.
Question 3 (20 marks): Microservices Architecture
- Explain
the key principles of microservices architecture.
- Describe
how microservices differ from monolithic architecture.
- List
and briefly explain common challenges in microservices development.
- Discuss
strategies for handling data consistency and communication between
microservices.
Question 4 (15 marks): Spring Cloud
- Create
a Microservice using Spring Boot that simulates user authentication.
- Implement
JWT (JSON Web Token) authentication for this Microservice.
- Configure
it to work with other microservices in a microservices ecosystem.
- Include
relevant dependencies and configurations in your project.
- Include a brief explanation of how you configured the project.
Question 5 (20 marks): Database Integration
- Create
a Microservice that interacts with a relational database to manage user
profiles.
- Use
Spring Data JPA for database operations.
- Implement
CRUD operations (Create, Read, Update, Delete) for user profiles.
- Ensure
proper error handling and validation.
- Provide
database schema and relevant SQL queries used in your Microservice.
- Include a brief explanation of how you configured the project.
Question 6 (20 marks): Testing
- Write
unit tests for one of the microservices you've created.
- Use
JUnit or TestNG for writing tests.
- Cover
both positive and negative test cases.
- Explain
the purpose and significance of the tests you wrote.
- Describe
any additional testing strategies you would employ for a real-world
microservices application.
- Include a brief explanation of how you configured the project.
Submission:
- Zip
your project files and push those to the GIT and share it for review
- Include
any necessary instructions for running your code.
- Ensure
your code is well-documented.
- Your
submission should be a complete and working solution for each question.
Good Luck!!
Comments
Post a Comment