0% found this document useful (0 votes)
14 views8 pages

Web Frameworks QB

The document is a comprehensive question bank covering various aspects of Spring Boot, RESTful APIs, JPA, and related technologies. It includes questions on HTTP methods, database interactions, annotations, security, logging, and application architecture. The questions are divided into two parts, with Part A focusing on theoretical concepts and Part B on practical application development scenarios.

Uploaded by

JEGAJITH S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views8 pages

Web Frameworks QB

The document is a comprehensive question bank covering various aspects of Spring Boot, RESTful APIs, JPA, and related technologies. It includes questions on HTTP methods, database interactions, annotations, security, logging, and application architecture. The questions are divided into two parts, with Part A focusing on theoretical concepts and Part B on practical application development scenarios.

Uploaded by

JEGAJITH S
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Question Bank

Part A

1. Identify the difference between HTTP GET and HTTP POST methods in RESTful API, and provide
an example

2. Recall RESTful API, and what are the key principles that define a RESTful API?

3. Justify the purpose of Value annotation in Spring Boot, and how it is used to inject values from
external sources into your code
4. Recall Spring Boot and how does it relate to MySQL database connections with JPA

5. Justify. How can you create a GET API using JPA to retrieve data from a MySQL database in a
Spring Boot application
6. Compare Request Param and Path Variable annotations

7. Justify. How can you perform a join query using JPA in a Spring Boot application?

8 Name the use of lazy loading in JPA and how does it affect the performance of a Spring Boot
application
9
Define Swagger UI

10 Relate how can you insert records with one to one and one to many relationships using JPA in a
Spring Boot application
11 Recognize the use of JSON, and why is it a popular format for transmitting data in RESTful API?

12 Remember the purpose of RESTful API, and what are the key principles that define a RESTful
API?
13 Justify. How do you create a runnable JAR file for a Spring Boot application

14 Explain about pagination and how is it useful in a Spring Boot API that connects to a MySQL
database with JPA
15 Justify the use of Transient annotation in JPA and how can it be used in a Spring Boot application

16 List the examples of SELECT, UPDATE, and DELETE queries that can be executed using JPQL in a
Spring Boot application
17 Infer various ways to change the log level
18 Define AOP, and how can you use it in a Spring Boot application to implement cross-cutting
concerns
19 Name the use of Open UI and how can it be integrated with a Spring Boot application

20 Compare bidirectional one to one relationship in JPA and how is it implemented in a Spring Boot
application
21 What do you understand by Spring Data REST?

22 Define Springboot dependency management.

23 Discuss about how to fetch data from database in spring boot?

24 Infer about native query with example

25 State the @RequestMapping and @RestController annotation in Spring Boot used for?

26 Express your understanding of auto-configuration in Spring Boot and how to disable the auto-
configuration?
27 Demonstrate the working of lazy loading in JPA.

28 Distinguish between one to one and many to one using JPA.

29 List out the benefits of using Swagger UI with spring boot.

30 Compare and contrast between @After Advice and @AfterReturning Advice.

31 List out the 5 essential HTTP methods in RESTful API development

32 Develop a JSON REST service in Spring Boot by annotating our StudentController with
@RestController and also have a @RequestMapping at the class level.
33 Discuss START with Query using JPA.

34 Enumerate the uses of @Query Annotations.

35 Articulate how do you make a one to one relationship in JPA.

36 Discriminate the working of lazy loading in JPA


37 Develop the steps to insert data for one-to-many relationship in Spring Boot.

38 Mention the uses of Swagger UI with spring boot.

39 Explain spring Boot's default logging configuration.

40 Illustrate how to change log level in Spring Boot application properties

41 Define Spring@Value annotation and give example for default Value.

42 Quote the uses of @JsonIgnore Usage, @JsonProperty Usage in Spring Boot.

43 Assume that we have tutorials table in database like this:

Find out APIs for Pagination and Sorting by Ascending or Descending.


44 Discuss about native query with example

45 Is it possible to define a sort type in @query annotation using Spring JPA? Justify your answer.

46 Compare and contrast one to one and many to one using JPA

47 Summarize Log request and responses of REST APIs in Spring Boot.

48 Describe AOP Terminologies and mention its types.

49 Identify an expression in the @Before annotation, which expresses the fully qualified class name
and method name, provided a Point cut expression that exactly matches with a method.
50 Extract Spring AOP @Around Advice and create an Aspect class and add a method in it.

Part B
1 Develop a RESTful API using Spring Boot that integrates with a MySQL database and supports
authentication and authorization using JSON Web Tokens (JWT). Discuss the implementation of the
Controller and Service layers, and how JWTs can be used to protect sensitive endpoints.
2 Discuss the role of the Controller and Service layers in a RESTful API, and compare and contrast the
advantages and disadvantages of implementing these layers separately versus using a combined
approach.
3 Develop a Spring Boot application that consumes data from a third-party RESTful API and displays it
in a user-friendly interface. Your application should use appropriate HTTP methods to retrieve data
from the API, and should format the data in a readable and meaningful way for the user. Discuss how
the @Value annotation can be used to configure your application to work with different environments
and external sources of configuration.
4 Discuss the security risks associated with implementing a RESTful API, and describe the measures
you can take to protect against common vulnerabilities such as SQL injection, cross-site scripting
(XSS), and cross-site request forgery (CSRF). Provide examples of security measures that can be
implemented at various layers of the API, including the Controller, Service, and Database layer.
5 Justify. How JPA works in the context of a Spring Boot application that connects to a MySQL
database.
6 Discuss the role of the @Repository annotation in a Spring Boot application that uses JPA for
database access.
7 Develop a GET API using JPA that retrieves data from a MySQL database and returns it in JSON
format.
8 Discuss the advantages and disadvantages of using HTTP POST, PUT, and DELETE methods for
modifying data in a Spring Boot application that uses JPA.
9 Describe the steps involved in creating a one to one mapping between two entities in JPA. How can
you insert data into the database using this mapping? Explain with an example.
10 How can you log request and response JSON using Spring Boot? Discuss the different logging levels
and how to change them. Explain with an example.
11 Compare and contrast the advantages and disadvantages of using a monolithic architecture
versus a microservices architecture for implementing RESTful API. Discuss the factors that
should be considered when choosing these approaches, and provide suitable example.
12 Discuss the implementation of the Controller and Service layers, and how pagination and filtering can
improve the performance and scalability of your API.
13 Describe the purpose and implementation of the Json Ignore and Json Property annotations in a
RESTful API. Provide examples of situations where these annotations may be used to control the
serialization and deserialization of JSON data.
14 Develop a Spring Boot application that deploys a RESTful API as a Docker container. Discuss the
advantages and disadvantages of using Docker for deploying and scaling your API, and describe the
implementation of the Controller and Service layers within the container.
15 Explain the purpose of Request Param and Path Variable annotations in a Spring Boot API, and
provide examples of how they can be used in a MySQL database context.
16 Describe how AND, OR, and IN queries can be implemented using JPA in a Spring Boot application
that connects to a MySQL database.
17 Develop a Spring Boot application that uses JPA to query a MySQL database using JPQL, including
examples of queries that use the STARTS WITH and ENDS WITH operators.
18 Discuss the different methods to implement pagination and sorting using JPA
19 Discuss the advantages and disadvantages of using Open UI with Spring Boot. How can you
integrate Open UI into your Spring Boot project?
20 Explain the concept of lazy loading in JPA. How does it help in reducing the overhead of fetching
data from the database? Illustrate with an example.
21 Develop a Spring Boot web application that displays customer data from a database, how would you
implement pagination with a custom SQL query that searches for customers by name containing a
specific keyword?
22 Analyze the following scenario with examples.
Customer wants to implement sorting so that the user can sort the products by different attributes
such as name, price, or date added. However, developer written a custom SQL query using JPA that
retrieves the product data based on some complex business logic. How would you modify your
Spring Boot code to implement sorting with this custom query using JPA's Sort interface?
23 Write a Spring Boot application that retrieves a list of products from a database using a custom SQL
query. You want to implement pagination so that only a certain number of products are displayed on
each page. How would you use the @Query notation in Spring Boot to write a custom query that
supports pagination?
24 Interpret the Spring Boot program that models a one-to-many relationship between a Customer and
their Orders. You want to use JPA to map the relationship between the two entities in your database.
How would you set up your Spring Boot project to implement the one-to-many relationship mapping
using JPA annotations? And how would you retrieve all the Orders for a given Customer using JPA?
25 Develop a Spring Boot application that models a one-to-one relationship between a User and a
Profile. You want to use JPA to map the relationship between the two entities in your database. How
would you set up your Spring Boot project to implement the one-to-one relationship mapping using
JPA annotations? And how would you retrieve the Profile information for a given User using JPA?
26 Construct a Spring Boot application for retrieving employee details. Create JPQL Query operations
using @Query annotation by adding query method to repository interface.
27 Analyze the development steps for creating a student database using Spring Boot and handle CRUD
operations using JPQL
28 Elucidate the use of Swagger API. How did you implement Swagger UI with Spring Boot using a
suitable example.
29 Demonstrate how to implement the Aspects Oriented Programming using Before Advice, After
Advice and Around Advice. Also give the methods and annotations used to implement Spring AOP.
30 Construct the Logging with Spring Boot and explain how to Change the Log Level, Logging Request
and Response
JSON. List out some of the Logging properties with Spring Boot.
31 Describe in detail the various layers and the architecture of Spring Boot
32 Create a student database for Get & POST operations in JSON API & using the same database
create PUT & DELETE operations
33 Build the pagination and sorting operations of a children’s database for Doctor’s prescription forms
using API containing the following variables:
 Create 6 variables
 1. babyId- int
 2. babyFirstName- string
 3. babyLastName- string
 4. fatherName- string
 5. motherName- string
 6. address- string
 as well as create getters and setters and constructors for the corresponding variables.

34 In the above data base create the following:


 Have to create a folder named “Controllers” inside the springapp in src.
 Inside the Controllers create a java file named “ApiController.java”.
 Next have to create the same inside the springapp named as “Models”.
 Inside Models, you should create the java file named “Child.java”.
 And create Repositories folder and inside that create "ChildRepo.java"
 Finally, create the "Service" folder, and inside that create the "ApiService.java" file.

35 Explain in detail about classes and interfaces to be used before pagination and sorting using Product
Repository
36 Create a Student database and annotate the field age with @Transient annotation
37 Build an application for Car details using JPQL Query operations. The following variables are used
as reference:
CarId, CarName, CarType, Owner, CurrentOwner, Mailid, Phone no., Address.
38 Write the steps to create Application properties for student database
39 Create an employee database that contains the following variables: Eid, First name, LastName,
Basic, HRA, DA, TA. Use the above database with @Query Annotation start-with and end-with
40 Describe in detail about the three basic types of JPA Queries
41 Analyze the development steps for creating a patient database using Spring Boot and handle CRUD
operations using JPQL
42 Let's suppose we are building a user management system, and our boss asks us to store a mailing
address for each user. A user will have one mailing address, and a mailing address will have only
one user tied to it. Implement this one-to-one relationship with JPA
43 Create a new Simple Spring Maven project so that all the Spring Core libraries are included in the
pom.xml files and we don’t need to include them explicitly. Our final project will look like the below
image, we will look into the Spring core components and Aspect implementations in detail.
44 Let's create a SwaggerConfig class and annotate with @Configuration annotation. The configuration
of Swagger mainly centers around the Docket bean so let's add the SwaggerConfig class. Let's say
we are creating a blog application so in our case, the exact URL will be:
http://localhost:8080/blog-app/swagger-ui/

45 Describe the flow of HTTPS requests through the Spring Boot application? List few features of
Spring Boot.
46 List the steps to use JDBC for spring boot application connects with the database.
47 Build a springboot application for getting student details. Create a file named Student.java with four
variables StudentId(int), StudentName(string), EmailId(string) and DepartmentName(string). Create
getters and setters and constructors for all the variables. Include Controller, Repository and Service.
Get the student details using GET and POST API.
48 Mention the basic annotations offered by Spring boot. What dependencies are required to start the
JPA application and connect the in-memory database with Spring Boot application?
49 Create a springboot application for getting employee details using pagination and sorting. Create a
file named Employee.java with four variables EmployeeId(int), EmployeeName(string),
EmployeeEmailId(string) and Employee Mobile(long). Create getters and setters and constructors
for all the variables. Include Controller, Repository and Service.
50 Construct a springboot application for retrieving student details. Create JPQL Query operations using
@Query annotation by adding query method to repository interface.
Write the JPQL query syntax for SELECT, UPDATE and DELETE queries. Build a springboot
application which includes the following queries:
1. Write the query to select all the records where DepartmentName=”CSE”.
2. Write the query to update student name whose StudentId is equal to 3.
3. Write the query to delete all the records whose StudentId is greater than 5.
51 Describe the internal need of @SpringBootApplication annotation. How does a spring boot
application get started? Write the code to implement one-one relationship using JPA.
52 Explain different types of join queries in JPA with syntax for each type. Add the query in the
Springboot application to retrieve all books under a specific field written by a particular author.
53 Illustrate the use of Swagger API. How did you implement Swagger UI with Spring Boot? Explain it
with example.
54 Explain in detail about Aspects Oriented Programming using Before Advice, After Advice and Around
Advice. Also give the methods and annotations used to implement Spring AOP.

You might also like