Loading

Quipoin Menu

Learn • Practice • Grow

spring / REST API Introduction
mcq
Direction: Choose the correct option

Q1.

What is a REST API?
A. An API that follows REST architectural constraints
B. An API that uses HTTP methods
C. An API that returns JSON
D. All of the above
Direction: Choose the correct option

Q2.

Which HTTP method is typically used to retrieve a resource?
A. GET
B. POST
C. PUT
D. DELETE
Direction: Choose the correct option

Q3.

Which HTTP method is used to create a new resource?
A. POST
B. PUT
C. PATCH
D. GET
Direction: Choose the correct option

Q4.

What is the purpose of PUT in REST?
A. To update an entire resource or create if not exists
B. To partially update
C. To delete
D. To retrieve
Direction: Choose the correct option

Q5.

What does RESTful URL for a specific user with ID 5 look like?
A. /users/5
B. /getUser?id=5
C. /user/5
D. /users?id=5
Direction: Choose the correct option

Q6.

What HTTP status code indicates successful resource creation?
A. 201 Created
B. 200 OK
C. 204 No Content
D. 202 Accepted
Direction: Choose the correct option

Q7.

What is the advantage of REST APIs?
A. Statelessness
B. Cacheability
C. Uniform interface
D. All of the above
Direction: Choose the correct option

Q8.

What does 'stateless' mean in REST?
A. Each request from client to server must contain all information
B. Server does not store session state
C. Both A and B
D. None
Direction: Choose the correct option

Q9.

Which annotation is used to create a REST controller in Spring?
A. @RestController
B. @Controller
C. @Component
D. @Service
Direction: Choose the correct option

Q10.

What does Spring provide to build REST APIs easily?
A. Spring MVC with @RestController
B. Spring HATEOAS for hypermedia
C. Spring Data REST
D. All of the above