Loading

Quipoin Menu

Learn • Practice • Grow

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

Q1.

Why is API versioning important?
A. To manage changes without breaking clients
B. To improve performance
C. To add new features
D. None
Direction: Choose the correct option

Q2.

What are common ways to version a REST API?
A. URI path versioning (/v1/users)
B. Query parameter versioning (/users?version=1)
C. Header versioning (Accept: application/vnd.company.v1+json)
D. All of the above
Direction: Choose the correct option

Q3.

How do you implement URI path versioning in Spring?
A. Define request mappings with /v1/, /v2/ etc.
B. Use @RequestMapping('/v1/users')
C. Both A and B
D. None
Direction: Choose the correct option

Q4.

What is header versioning (content negotiation)?
A. Clients specify version in Accept header
B. Version in custom header
C. Both A and B
D. None
Direction: Choose the correct option

Q5.

How do you handle header versioning in Spring?
A. Using @RequestMapping(headers = 'X-API-Version=1')
B. Using @RequestMapping(produces = 'application/vnd.company.v1+json')
C. Both A and B
D. None
Direction: Choose the correct option

Q6.

What is parameter versioning?
A. Version as a query parameter e.g., /users?version=1
B. Version in path
C. Version in header
D. None
Direction: Choose the correct option

Q7.

How do you implement parameter versioning in Spring?
A. @RequestMapping(params = 'version=1')
B. @RequestParam to check version
C. Both A and B
D. None
Direction: Choose the correct option

Q8.

What is a disadvantage of URI versioning?
A. Clutters URI space
B. Caching can be tricky
C. May lead to code duplication
D. All of the above
Direction: Choose the correct option

Q9.

What is a disadvantage of header versioning?
A. More complex to test from browser
B. Headers are less visible
C. Not as RESTful
D. All of the above
Direction: Choose the correct option

Q10.

Which versioning strategy does Spring recommend?
A. No single recommendation; it's design choice
B. URI versioning
C. Header versioning
D. Parameter versioning