Skip to content
InterviewEra
Loading account navigation
InterviewEra

InterviewEra is an AI-powered mock interview platform with adaptive follow-ups, resume-aware scoring, and structured interview preparation for campus placements and early-career hiring.

Start Mock Interview

Product

  • How It Works
  • For Teams
  • Start Mock Interview
  • Campus Placements
  • Campus Workspace
  • Help Center

Tools

  • Interview Question Generator
  • ATS Resume Checker
  • STAR Answer Builder

Resources

  • Interview Questions
  • All Resources
  • Blog
  • Community Hub
  • DSA Topic Map
  • Placement Guide
  • STAR Guide

Company

  • What is InterviewEra
  • About Us
  • Pricing
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Refund Policy

© 2026 InterviewEra. All rights reserved.

Privacy Policy|Terms & Conditions|Refund Policy
|Ranchi, Jharkhand, India
Interview Questions›Topics›Spring Boot

Backend · Fresher-relevant

Spring Boot Interview Questions 2026

Spring Boot interview questions covering auto-configuration, REST controllers, JPA/Hibernate, and Spring Security.

BackendFresher-relevant

Spring Boot Interview Questions

Placement-oriented · Updated 2026
  1. 01

    What is dependency injection and how does Spring implement it?

    TechnicalMedium

    Tip: DI is providing a class's dependencies from outside rather than constructing them internally, enabling loose coupling and testability. Spring's IoC container creates and wires beans; prefer constructor injection (immutability, easier testing, no field reflection) over field injection.

  2. 02

    How does Spring Boot auto-configuration work?

    TechnicalHard

    Tip: @EnableAutoConfiguration (via @SpringBootApplication) scans the classpath and conditionally configures beans using @ConditionalOnClass / @ConditionalOnMissingBean. Starters pull curated dependencies; auto-config backs off whenever you define your own bean, so your configuration always wins.

  3. 03

    What is the difference between @Component, @Service, @Repository, and @Controller?

    TechnicalEasy

    Tip: All are stereotype annotations that register beans via component scanning. @Service marks business logic, @Repository marks the persistence layer (and translates DB exceptions into DataAccessException), @Controller/@RestController marks web endpoints. They are semantically distinct but technically specialisations of @Component.

  4. 04

    Explain the difference between @RequestParam, @PathVariable, and @RequestBody.

    TechnicalEasy

    Tip: @PathVariable binds a URL template segment (/users/{id}). @RequestParam binds a query string or form parameter (?page=2). @RequestBody deserialises the request body (usually JSON) into an object via Jackson. Use @Valid with @RequestBody to trigger bean validation.

  5. 05

    What are bean scopes in Spring?

    TechnicalMedium

    Tip: Default is singleton (one instance per container). prototype creates a new instance per injection. Web scopes include request, session, and application. Be careful injecting a shorter-lived scope into a singleton — use a proxy or ObjectProvider to avoid a stale reference.

  6. 06

    How does transaction management work with @Transactional?

    TechnicalHard

    Tip: @Transactional wraps a method in a transaction via an AOP proxy: commit on success, rollback on a RuntimeException by default (checked exceptions need rollbackFor). Because it is proxy-based, self-invocation within the same class bypasses it, and the method must be public. Tune propagation (REQUIRED, REQUIRES_NEW) and isolation as needed.

  7. 07

    What is the N+1 query problem in JPA/Hibernate and how do you fix it?

    TechnicalHard

    Tip: Lazy-loading a collection for N parent rows fires 1 query for the parents plus N queries for children. Fix with a JOIN FETCH / @EntityGraph to load eagerly in one query, or batch fetching (hibernate.default_batch_fetch_size). Detect it by logging SQL in dev.

  8. 08

    How do you secure REST endpoints in Spring Boot?

    TechnicalMedium

    Tip: Use Spring Security with a SecurityFilterChain: stateless JWT bearer tokens for APIs (no server session), method-level @PreAuthorize for role checks, BCrypt for password hashing, and HTTPS enforced. Disable CSRF for stateless token APIs but keep it for cookie-based sessions.

Practice Spring questions with your own resume

InterviewEra generates role-specific questions using your actual projects and skills. Get scored feedback on technical depth, clarity, and structure — free to start.

Start free mock interviewFree question generator

Roles that need Spring

  • Java Developer questions
  • Backend Developer questions

Related backend topics

  • Java questions
  • Python questions
  • Node.js questions
  • REST APIs questions
  • Django questions

Practice tools

  • Interview question generator
  • ATS resume checker
  • STAR answer builder

Guides and resources

  • All interview questions
  • HR interview answer tips
  • STAR method with examples