Spring Boot Interview Questions 2026

Published July 22, 2026 · Updated July 22, 2026

16 Spring Boot interview questions from Infosys, TCS, Netflix, Accenture. All difficulty levels, all roles. Upvoted by engineers who were asked them.

16 questions
Companies: Infosys, TCS, Netflix, Accenture
773 upvotes

Spring Boot Questions by Company

Infosys (5)

Infosys Medium Technical round JavaSpring Boot

How do you implement custom validation in Spring Boot? Explain the approach using @Constraint and ConstraintValidator, where to place the annotation, and how to return meaningful error messages through BindingResult.

↑ 74 upvotes · 28 engineers asked this · SDE2
Infosys Medium System Design round JavaSpring BootMySQL

Design a library management system. Include entities (Book, Member, Loan), relationships, and key operations: borrow, return, search, fine calculation. Discuss how to handle concurrent borrows of the last copy of a book.

↑ 61 upvotes · 22 engineers asked this · SDE2
Infosys Medium Technical round JavaSpring Boot

What are design patterns? Explain Singleton, Factory, and Observer patterns with Java code examples. In which Spring Boot components are these patterns used internally?

↑ 62 upvotes · 39 engineers asked this · SDE2
Infosys Medium Technical round JavaSpring Boot

What is the difference between checked and unchecked exceptions in Java? When should you use each? Explain the exception hierarchy and best practices for custom exceptions in a Spring Boot REST API.

↑ 55 upvotes · 34 engineers asked this · SDE1
Infosys Medium Technical round JavaSpring BootREST

Explain REST API best practices. What makes an API RESTful? Cover: proper use of HTTP verbs, status codes, versioning strategies (/v1/users vs Accept header), pagination (cursor vs offset), and HATEOAS.

↑ 60 upvotes · 38 engineers asked this · SDE2

TCS (5)

TCS Medium Technical round JavaSpring Boot

How do you handle transactions in Spring Boot? Explain the @Transactional annotation, propagation levels (REQUIRED, REQUIRES_NEW, NESTED), isolation levels, and how Spring proxies intercept methods — including why self-invocation bypasses the proxy.

↑ 41 upvotes · 43 engineers asked this · SDE2
TCS Medium System Design round JavaSpring BootREST

Design a REST API for an e-commerce cart system. Define the endpoints (add item, remove item, get cart, checkout), explain authentication with JWT, handle race conditions on inventory, and discuss idempotency for the checkout endpoint.

↑ 46 upvotes · 47 engineers asked this · SDE2
TCS Medium Technical round JavaSpring Boot

What are the SOLID principles? Explain each with a real-world Java example. Then describe a scenario where rigidly following SOLID leads to over-engineering, and how you balance pragmatism with good design.

↑ 93 upvotes · 36 engineers asked this · SDE2
TCS Medium Technical round JavaSpring Boot

Explain Spring Boot auto-configuration. How does @SpringBootApplication work under the hood? What is the difference between @Component, @Service, @Repository, and @Controller in Spring?

↑ 61 upvotes · 39 engineers asked this · SDE2
TCS Medium System Design round JavaSpring BootMySQL

Design a library management system with online book reservation. Students can search, reserve, and borrow books. Librarians can manage inventory. Cover the database schema, REST APIs, and how you handle concurrent reservations of the last copy.

↑ 54 upvotes · 33 engineers asked this · SDE2

Netflix (1)

Netflix Medium Technical round JavaSpring BootDistributed Systems

What is the circuit breaker pattern? Explain the three states (Closed, Open, Half-Open), when to trip and reset the breaker, and how Netflix's Hystrix library implements it. When would you NOT use a circuit breaker?

↑ 55 upvotes · 33 engineers asked this · SDE2

Accenture (5)

Accenture Easy Technical round 1-3 yearsSpring BootJava

What does @SpringBootApplication actually do? Which three annotations does it combine, and what does each one do?

↑ 24 upvotes · 16 engineers asked this · Developer
Accenture Medium Technical round 2-4 yearsSpring BootJavaREST

Design a REST controller in Spring Boot for a "create order" endpoint. What annotations and validation would you use to ensure a malformed request returns 400 instead of crashing?

↑ 20 upvotes · 12 engineers asked this · Developer
Accenture Medium Technical round 2-5 yearsSpring BootJava

Explain constructor injection vs field injection (@Autowired on a field) in Spring. Why do most teams now prefer constructor injection?

↑ 27 upvotes · 19 engineers asked this · Developer
Accenture Medium Technical round 2-4 yearsSpring BootJava

How do you implement centralized exception handling across all controllers in a Spring Boot application, so you don't repeat try/catch in every endpoint?

↑ 18 upvotes · 9 engineers asked this · Developer
Accenture Hard Technical round 3-6 yearsSpring BootMicroservicesJava

What does Spring Boot Actuator give you out of the box for a microservice running in production? Name at least 3 endpoints and what each is used for.

↑ 22 upvotes · 10 engineers asked this · Developer

Practice these questions with AI feedback

Get instant grading on your answers, identify your weak areas, and generate a personalised 14-day study plan — all free.

Build my study plan →

Spring Boot questions at each company

Infosys Spring Boot TCS Spring Boot Accenture Spring Boot

Frequently asked questions

How do you implement custom validation in Spring Boot? Explain the approach using @Constraint and ConstraintValidator, where to place the annotation, and how to return meaningful error messages through BindingResult.
How do you implement custom validation in Spring Boot? Explain the approach using @Constraint and ConstraintValidator, where to place the annotation, and how to return meaningful error messages through BindingResult.
Design a library management system. Include entities (Book, Member, Loan), relationships, and key operations: borrow, return, search, fine calculation. Discuss how to handle concurrent borrows of the last copy of a book.
Design a library management system. Include entities (Book, Member, Loan), relationships, and key operations: borrow, return, search, fine calculation. Discuss how to handle concurrent borrows of the last copy of a book.
How do you handle transactions in Spring Boot? Explain the @Transactional annotation, propagation levels (REQUIRED, REQUIRES_NEW, NESTED), isolation levels, and how Spring proxies intercept methods — including why self-invocation bypasses the proxy.
How do you handle transactions in Spring Boot? Explain the @Transactional annotation, propagation levels (REQUIRED, REQUIRES_NEW, NESTED), isolation levels, and how Spring proxies intercept methods — including why self-invocation bypasses the proxy.
Design a REST API for an e-commerce cart system. Define the endpoints (add item, remove item, get cart, checkout), explain authentication with JWT, handle race conditions on inventory, and discuss idempotency for the checkout endpoint.
Design a REST API for an e-commerce cart system. Define the endpoints (add item, remove item, get cart, checkout), explain authentication with JWT, handle race conditions on inventory, and discuss idempotency for the checkout endpoint.
What are the SOLID principles? Explain each with a real-world Java example. Then describe a scenario where rigidly following SOLID leads to over-engineering, and how you balance pragmatism with good design.
What are the SOLID principles? Explain each with a real-world Java example. Then describe a scenario where rigidly following SOLID leads to over-engineering, and how you balance pragmatism with good design.