Spring Boot
Core IoC, web layer, data access, AOP & configuration, and security
Master Spring Boot interview topics from dependency injection and IoC containers to building REST APIs, configuring data access with JPA, applying AOP patterns, and securing applications with Spring Security. Each question is structured with intent, explanation, code examples, and what to watch out for.
Core 3 topics
Dependency Injection
Let the framework wire object dependencies instead of constructing them by hand — for testability and loose coupling.
Bean Lifecycle & Scopes
Control when beans are created, initialized, and destroyed — and how many instances exist.
Auto-configuration & Starters
Get sensible defaults wired up automatically based on what's on the classpath — without writing XML or manual @Bean definitions.
Web 3 topics
REST Controllers & Routing
Expose HTTP endpoints via @RestController, map URLs to methods with @GetMapping/@PostMapping, and bind path/query/body parameters automatically.
Validation with @Valid
Reject invalid requests at the boundary using Bean Validation annotations — before they reach your business logic.
Global Exception Handling
Map exceptions to consistent HTTP responses in one place — instead of try/catch in every controller method.
Data 3 topics
@Transactional
Run a unit of work atomically — all-or-nothing — with one annotation, deferring commit/rollback to Spring.
Spring Data JPA
Get CRUD repositories for free by declaring an interface — no implementation needed.
JdbcTemplate vs JPA
Choose JPA for object-graph mapping; choose JdbcTemplate (or jOOQ) for SQL control, bulk operations, and reporting.
Cross-cutting 3 topics
AOP & Aspects
Apply cross-cutting concerns (logging, security, metrics, retries) declaratively without scattering them through every method.
Configuration & Profiles
Externalize config (URLs, credentials, feature flags) and activate environment-specific beans via profiles.
Actuator: Health, Metrics, Tracing
Expose operational endpoints (health, metrics, info, threads, env) for monitoring, alerting, and on-call diagnosis.
Security 3 topics
Spring Security Basics
Wire authentication, authorization, and common HTTP defenses (CSRF, headers, CORS) declaratively via a SecurityFilterChain.
JWT / OAuth2 Resource Server
Validate signed bearer tokens (JWT) at the API boundary so stateless services can trust the identity claims without a session.
Method Security & @PreAuthorize
Authorize at the method level using SpEL expressions — so business logic encodes the access rule next to the action.