InterviewTreedInterviewTreed
All learning paths

Programming & Frameworks

Java & Spring Boot

Prepare for Java and Spring Boot interviews, covering core Java, object-oriented programming, collections, concurrency, JVM internals, Spring Framework, Spring Boot, REST APIs, Hibernate, security, and microservices.

Your learning roadmap

Explore the key concepts

Use these subtopics as a study checklist. Start with the fundamentals, then progress to practical examples and interview preparation.

Java fundamentals

Learn the core concepts of Java programming, including its syntax, program structure, object-oriented approach, platform independence, and role in enterprise application development.

Start learning

Java installation and development environment

Understand how to install Java, configure environment variables, select a JDK, and set up development tools such as IntelliJ IDEA, Eclipse, or Visual Studio Code.

Start learning

JVM, JRE, and JDK

Explore the differences between the Java Virtual Machine, Java Runtime Environment, and Java Development Kit, including their responsibilities in compiling and executing Java applications.

Start learning

Java program execution lifecycle

Learn how Java source code is compiled into bytecode and executed by the JVM, including class loading, bytecode verification, interpretation, and JIT compilation.

Start learning

Primitive and reference data types

Understand Java's primitive types and reference types, their memory behavior, default values, and how they are used to represent data in applications.

Start learning

Variables and constants

Learn how to declare, initialize, and use local variables, instance variables, static variables, and constants using the final keyword.

Start learning

Type casting and type conversion

Explore implicit widening and explicit narrowing conversions in Java, including numeric conversions, casting reference types, and handling potential data loss.

Start learning

Operators and expressions

Understand arithmetic, relational, logical, assignment, bitwise, unary, and ternary operators, along with operator precedence and expression evaluation.

Start learning

Conditional statements and loops

Learn how to control program execution using if-else statements, switch expressions, for loops, while loops, do-while loops, break, and continue.

Start learning

Methods and method overloading

Understand how Java methods organize reusable logic, accept parameters, return values, and support method overloading through different parameter lists.

Start learning

Classes and objects

Learn how classes define properties and behaviors while objects represent individual instances, including object creation, fields, methods, and constructors.

Start learning

Constructors and initialization blocks

Explore default and parameterized constructors, constructor overloading, constructor chaining, instance initialization blocks, and static initialization blocks.

Start learning

Object-oriented programming principles

Understand the four core principles of object-oriented programming—encapsulation, inheritance, polymorphism, and abstraction—and how they support maintainable Java applications.

Start learning

Encapsulation

Learn how encapsulation protects object state by controlling access to fields through access modifiers, constructors, getters, setters, and validation logic.

Start learning

Inheritance

Understand how Java classes inherit properties and behavior using extends, reuse parent-class functionality, override methods, and establish class hierarchies.

Start learning

Polymorphism

Explore compile-time and runtime polymorphism in Java, including method overloading, method overriding, dynamic method dispatch, and programming to interfaces.

Start learning

Abstraction

Learn how abstraction exposes essential behavior while hiding implementation details through abstract classes, interfaces, and well-defined contracts.

Start learning

Interfaces and abstract classes

Compare Java interfaces and abstract classes, including method implementations, constructors, fields, multiple interface inheritance, and appropriate design use cases.

Start learning

Method overriding

Understand how subclasses provide specialized implementations of inherited methods, including overriding rules, covariant return types, and the @Override annotation.

Start learning

Access modifiers

Learn how public, protected, package-private, and private access levels control visibility and support encapsulation across classes, packages, and inheritance hierarchies.

Start learning

Static and final keywords

Explore static members shared across class instances and final variables, methods, and classes that restrict reassignment, overriding, or inheritance.

Start learning

this and super keywords

Understand how this refers to the current object and super accesses parent-class constructors and members, including constructor chaining and method resolution.

Start learning

Strings and String handling

Learn Java string operations, immutability, comparison, searching, extraction, replacement, formatting, and common techniques for processing textual data.

Start learning

String, StringBuilder, and StringBuffer

Compare immutable String objects with mutable StringBuilder and StringBuffer, including performance, synchronization, thread safety, and appropriate usage scenarios.

Start learning

Java memory management

Understand how Java manages memory for objects, variables, class metadata, and runtime structures, including heap allocation, garbage collection, and memory monitoring.

Start learning

Stack and heap memory

Explore the JVM stack and heap, including method frames, local variables, object allocation, references, and how memory is used during method execution.

Start learning

Garbage collection

Learn how Java garbage collection identifies unreachable objects and reclaims heap memory, including garbage collector types, generations, and performance considerations.

Start learning

Java Collections Framework

Understand the Java Collections Framework, including its interfaces, implementations, algorithms, iterators, and data structures for managing groups of objects.

Start learning

List, Set, and Map

Compare the List, Set, and Map interfaces, including ordering, duplicate handling, key-value storage, iteration, and common implementation choices.

Start learning

ArrayList and LinkedList

Explore ArrayList and LinkedList implementations, comparing internal data structures, access performance, insertion and deletion costs, and practical use cases.

Start learning

HashMap and Hashtable

Understand key-value storage using HashMap and Hashtable, including hashing, collision handling, null support, synchronization, and performance differences.

Start learning

HashSet and TreeSet

Compare HashSet and TreeSet for storing unique elements, including hashing, sorting, ordering guarantees, lookup performance, and comparator-based behavior.

Start learning

Comparable and Comparator

Learn how Comparable defines natural ordering within a class and Comparator provides external custom sorting strategies for collections and object lists.

Start learning

Iterator and ListIterator

Understand how Iterator and ListIterator traverse collections, remove elements safely, inspect traversal positions, and support forward and backward iteration.

Start learning

Generics

Learn how Java generics provide compile-time type safety and reusable classes, interfaces, and methods using type parameters, bounds, wildcards, and generic constraints.

Start learning

Wrapper classes and autoboxing

Explore wrapper classes such as Integer, Double, and Boolean, along with autoboxing, unboxing, primitive conversions, and common performance considerations.

Start learning

Exception handling

Understand Java exception handling using try, catch, finally, throw, and throws, including exception propagation and designing reliable error-handling logic.

Start learning

Checked and unchecked exceptions

Compare checked exceptions and unchecked exceptions, including compiler enforcement, RuntimeException, IOException, and decisions about handling or propagating failures.

Start learning

Custom exceptions

Learn how to define application-specific exception classes by extending Exception or RuntimeException and communicate meaningful error conditions to callers.

Start learning

Try-with-resources

Understand how try-with-resources automatically closes resources implementing AutoCloseable, simplifies cleanup, and handles exceptions during resource management.

Start learning

Java 8 features

Explore major Java 8 enhancements, including lambda expressions, functional interfaces, streams, method references, Optional, and the modern Date and Time API.

Start learning

Lambda expressions

Learn how lambda expressions represent concise implementations of functional interfaces, simplify callback logic, and support functional-style programming in Java.

Start learning

Functional interfaces

Understand functional interfaces containing a single abstract method, including built-in interfaces such as Predicate, Function, Consumer, and Supplier.

Start learning

Method references

Explore method references as shorthand for lambda expressions, including static methods, instance methods, arbitrary object methods, and constructor references.

Start learning

Stream API

Learn how the Java Stream API processes collections through declarative pipelines, transformations, filtering, aggregation, and sequential or parallel execution.

Start learning

Intermediate and terminal operations

Understand lazy intermediate stream operations such as filter, map, and sorted, along with terminal operations such as collect, reduce, count, and forEach.

Start learning

Optional class

Learn how Java Optional represents potentially absent values and helps reduce null-related errors using methods such as ofNullable, map, orElse, and orElseThrow.

Start learning

Date and Time API

Explore the java.time API for working with dates, times, durations, time zones, formatting, and parsing through immutable classes such as LocalDate and ZonedDateTime.

Start learning

Annotations

Understand Java annotations as metadata for source code, including built-in annotations, custom annotations, retention policies, targets, and framework integration.

Start learning

Reflection API

Learn how Java Reflection inspects classes, constructors, methods, fields, and annotations at runtime, including dynamic object creation and framework use cases.

Start learning

Java I/O fundamentals

Understand Java input and output streams, readers, writers, buffering, byte-oriented and character-oriented processing, and resource management.

Start learning

File handling

Learn how to create, read, write, copy, move, and delete files using Java I/O and NIO APIs, including Path, Files, and directory operations.

Start learning

Serialization and deserialization

Understand how Java objects are converted into byte streams and reconstructed, including Serializable, serialVersionUID, transient fields, and security considerations.

Start learning

Multithreading fundamentals

Explore Java multithreading concepts, including concurrent execution, thread creation, shared resources, thread coordination, and application responsiveness.

Start learning

Thread lifecycle

Understand Java thread states and transitions, including NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, and TERMINATED, along with lifecycle methods.

Start learning

Runnable and Callable

Compare Runnable and Callable for defining asynchronous tasks, including return values, checked exceptions, and execution through executor services.

Start learning

Synchronization

Learn how synchronized methods and blocks coordinate access to shared data, prevent race conditions, and provide visibility and mutual exclusion between threads.

Start learning

Locks and concurrent utilities

Explore explicit locking mechanisms such as ReentrantLock and utilities from java.util.concurrent for coordinating threads and managing concurrent operations.

Start learning

ExecutorService and thread pools

Understand how ExecutorService manages task execution using reusable thread pools, task submission, Future results, shutdown operations, and resource control.

Start learning

CompletableFuture

Learn how CompletableFuture supports asynchronous programming through task composition, chaining, exception handling, combining results, and non-blocking execution.

Start learning

Concurrency and parallel programming

Explore concurrency and parallelism in Java, including task coordination, parallel streams, asynchronous execution, thread safety, and performance trade-offs.

Start learning

Java Memory Model

Understand the Java Memory Model, including visibility, atomicity, ordering, happens-before relationships, volatile variables, and synchronization between threads.

Start learning

Deadlocks and race conditions

Learn how deadlocks and race conditions occur in concurrent Java programs, how to identify their causes, and how to prevent them through safe synchronization and lock design.

Start learning

JVM internals

Explore JVM architecture, including runtime data areas, class loading, execution engines, garbage collection, native interfaces, and memory management components.

Start learning

Class loading mechanism

Understand how the JVM loads, links, and initializes classes, including bootstrap, platform, and application class loaders and parent delegation.

Start learning

JIT compilation

Learn how Just-In-Time compilation converts frequently executed bytecode into native machine code and improves runtime performance through optimization techniques.

Start learning

Java performance optimization

Explore Java performance optimization techniques involving memory usage, garbage collection, profiling, thread management, database access, and application bottleneck analysis.

Start learning

Maven and Gradle

Compare Maven and Gradle build systems, including project configuration, dependency declarations, build lifecycle, plugins, tasks, and packaging Java applications.

Start learning

Dependency management

Understand how Java projects manage external libraries, transitive dependencies, dependency versions, repositories, scopes, and conflicts through Maven or Gradle.

Start learning

Unit testing with JUnit

Learn how to write automated Java unit tests using JUnit, including test lifecycle methods, assertions, parameterized tests, exception testing, and test organization.

Start learning

Mocking with Mockito

Explore Mockito for isolating dependencies in unit tests through mock objects, stubbing, verification, argument matchers, and behavior-driven testing patterns.

Start learning

Spring Framework fundamentals

Understand the Spring Framework and its core capabilities for building enterprise Java applications, including dependency injection, configuration, web development, and data access.

Start learning

Spring architecture

Explore Spring's modular architecture, including Core Container, AOP, Data Access, Web MVC, Security integration, and how application components work together.

Start learning

Inversion of Control (IoC)

Learn how Inversion of Control transfers object creation and lifecycle management from application code to the Spring container, reducing direct dependencies.

Start learning

Dependency Injection (DI)

Understand constructor, setter, and field injection in Spring, including dependency resolution, bean wiring, loose coupling, and testable application design.

Start learning

Spring Bean lifecycle

Explore the Spring bean lifecycle, including instantiation, dependency injection, initialization callbacks, bean post-processors, destruction callbacks, and container management.

Start learning

Bean scopes

Learn Spring bean scopes such as singleton, prototype, request, session, application, and websocket, including how scope affects object creation and lifecycle.

Start learning

Spring configuration and annotations

Understand Spring configuration using Java-based configuration, @Configuration, @Bean, component annotations, and annotation-driven dependency management.

Start learning

Component scanning

Learn how Spring component scanning discovers annotated classes such as @Component, @Service, @Repository, and @Controller and registers them as application beans.

Start learning

Spring AOP

Explore Spring Aspect-Oriented Programming for separating cross-cutting concerns such as logging, security, transactions, and auditing using aspects, advice, and pointcuts.

Start learning

Spring MVC fundamentals

Understand the Spring MVC request-processing architecture, including DispatcherServlet, controllers, handler mappings, view resolution, and HTTP request handling.

Start learning

Spring Boot fundamentals

Learn how Spring Boot simplifies Java application development through auto-configuration, starter dependencies, embedded servers, and production-ready features.

Start learning

Spring Boot project structure

Understand the standard Spring Boot project layout, including application entry points, controllers, services, repositories, entities, configuration, resources, and tests.

Start learning

Spring Boot auto-configuration

Explore how Spring Boot automatically configures application components based on classpath dependencies, existing beans, properties, and conditional configuration.

Start learning

Spring Boot starters

Learn how Spring Boot starter dependencies bundle compatible libraries for common capabilities such as web development, data access, security, testing, and messaging.

Start learning

Spring Boot configuration and profiles

Understand externalized configuration and Spring profiles for managing environment-specific settings, activating configurations, and separating development, testing, and production environments.

Start learning

application.properties and application.yml

application.properties and application.yml: Learn its key concepts, practical implementation, architecture, and interview considerations.

Start learning

Spring Boot REST API development

Explore how to build RESTful services with Spring Boot, including endpoint design, HTTP semantics, request validation, response formats, and layered application architecture.

Start learning

Controllers and REST controllers

Understand the roles of @Controller and @RestController in Spring MVC, including request handling, view rendering, JSON responses, and controller responsibilities.

Start learning

Request mapping and HTTP methods

Learn how Spring maps incoming requests using @RequestMapping, @GetMapping, @PostMapping, @PutMapping, @PatchMapping, and @DeleteMapping.

Start learning

Request parameters and path variables

Understand how to capture URL query parameters and path segments using @RequestParam and @PathVariable, including optional values, defaults, and type conversion.

Start learning

Request and response handling

Learn how Spring Boot processes HTTP request bodies, headers, status codes, response entities, content types, and JSON serialization for REST APIs.

Start learning

DTOs and data transfer objects

Understand how DTOs separate API request and response structures from persistence entities, control exposed data, and support validation and application-layer boundaries.

Start learning

Bean validation

Learn how to validate incoming Spring Boot requests using Jakarta Bean Validation annotations, custom constraints, @Valid, @Validated, and structured validation error responses.

Start learning

Global exception handling

Explore centralized exception handling in Spring Boot using @ControllerAdvice and @ExceptionHandler to return consistent error responses and appropriate HTTP status codes.

Start learning

Spring Boot filters and interceptors

Compare servlet filters and Spring MVC interceptors, including request preprocessing, authentication checks, logging, response handling, and execution lifecycle.

Start learning

Spring Data JPA

Learn how Spring Data JPA simplifies database access through repository interfaces, derived query methods, pagination, custom queries, and transaction integration.

Start learning

Hibernate ORM fundamentals

Understand Hibernate as an ORM framework that maps Java objects to relational database tables, manages persistence contexts, and handles SQL generation and entity state.

Start learning

Entity mapping and relationships

Learn how to map Java entity classes to database tables using JPA annotations, primary keys, columns, relationship mappings, and persistence configuration.

Start learning

One-to-one, one-to-many, and many-to-many relationships

Explore JPA relationship mappings using @OneToOne, @OneToMany, and @ManyToMany, including ownership, join columns, join tables, and cascade behavior.

Start learning

JPQL and native queries

Compare JPQL and native SQL queries in Spring Data JPA, including entity-oriented querying, named parameters, @Query, projections, and database-specific operations.

Start learning

Pagination and sorting

Learn how Spring Data JPA supports efficient pagination and sorting through Pageable, Page, Slice, Sort, and repository query methods.

Start learning

Transactions with @Transactional

Understand transaction management in Spring using @Transactional, including commit and rollback behavior, propagation, isolation levels, and read-only transactions.

Start learning

Lazy and eager loading

Compare lazy and eager fetching strategies in Hibernate, understand when associated entities are loaded, and avoid unnecessary database queries and session-related errors.

Start learning

N+1 query problem

N+1 query problem: Learn its key concepts, practical implementation, architecture, and interview considerations.

Start learning

Spring Security fundamentals

Understand Spring Security architecture, including security filters, authentication providers, security contexts, request authorization, and protection of application endpoints.

Start learning

Authentication and authorization

Explore the difference between authentication and authorization and learn how Spring Security verifies identities and determines access to protected application resources.

Start learning

JWT authentication

Learn how to implement JWT-based authentication in Spring Boot, including token generation, signing, validation, expiration, security filters, and stateless request processing.

Start learning

OAuth 2.0 and OpenID Connect

OAuth 2.0 and OpenID Connect: Learn its key concepts, practical implementation, architecture, and interview considerations.

Start learning

Role-based access control

Learn how to implement role-based access control in Spring Security using authorities, roles, request matchers, method-level security, and access-control annotations.

Start learning

Spring Boot testing

Explore Spring Boot testing support, including application context tests, test slices, test configuration, dependency replacement, and integration with JUnit and Mockito.

Start learning

Unit and integration testing

Understand the differences between unit and integration testing in Spring Boot, including isolated service tests, repository tests, application context loading, and database integration.

Start learning

MockMvc and API testing

Learn how to test Spring MVC controllers and REST endpoints using MockMvc, including request simulation, response assertions, validation testing, and security checks.

Start learning

Spring Boot Actuator

Explore Spring Boot Actuator endpoints for application health, metrics, environment information, configuration visibility, and operational monitoring.

Start learning

Logging and monitoring

Learn how to configure application logging and monitor Spring Boot services using logging frameworks, structured log output, metrics, tracing, and monitoring integrations.

Start learning

Caching with Spring Boot

Understand Spring's caching abstraction, including @Cacheable, @CachePut, @CacheEvict, cache providers, cache expiration, and strategies for improving application response times.

Start learning

Spring Boot asynchronous processing

Learn how to execute background tasks in Spring Boot using @Async, TaskExecutor, CompletableFuture, and asynchronous method execution.

Start learning

Spring Boot scheduling

Explore scheduled task execution in Spring Boot using @Scheduled, cron expressions, fixed delays, fixed rates, and configurable task scheduling.

Start learning

Microservices with Spring Boot

Understand how to build independently deployable microservices with Spring Boot, including service boundaries, REST communication, resilience, configuration, and distributed system concerns.

Start learning

Spring Cloud fundamentals

Explore Spring Cloud components for distributed applications, including centralized configuration, service discovery, API gateways, load balancing, and resilience patterns.

Start learning

Service discovery

Learn how service discovery allows microservices to locate one another dynamically using registries, service registration, health checks, and discovery clients.

Start learning

API Gateway

Understand the API Gateway pattern and its implementation in Spring Cloud Gateway, including routing, authentication, request filtering, rate limiting, and cross-cutting concerns.

Start learning

Circuit breaker pattern

Learn how the circuit breaker pattern prevents repeated calls to failing services, including closed, open, and half-open states, fallback behavior, and Resilience4j integration.

Start learning

OpenFeign

Explore OpenFeign as a declarative HTTP client for communicating between Spring Boot microservices using annotated interfaces, service discovery, and client configuration.

Start learning

Distributed configuration

Understand centralized configuration management for microservices using Spring Cloud Config, configuration servers, environment-specific properties, and runtime refresh capabilities.

Start learning

Kafka integration with Spring Boot

Learn how to integrate Apache Kafka with Spring Boot using producers, consumers, topics, partitions, serialization, message listeners, and error-handling strategies.

Start learning

Dockerizing Spring Boot applications

Understand how to package Spring Boot applications into Docker images, configure containers, manage environment variables, expose ports, and run services consistently across environments.

Start learning

Spring Boot deployment

Explore deployment strategies for Spring Boot applications, including executable JARs, application servers, containers, cloud platforms, environment configuration, and release practices.

Start learning

Production application monitoring

Learn how to monitor production Spring Boot applications using health checks, metrics, centralized logs, distributed tracing, alerting, and operational dashboards.

Start learning

Spring Boot performance optimization

Explore techniques for improving Spring Boot performance through JVM tuning, database query optimization, connection pooling, caching, thread management, and application profiling.

Start learning

Practice & revise

Interview questions

Practice interview questions with answers, key points, and practical examples.

Test your knowledge

Explore 125 questions for this topic, covering concepts, practical examples, and interview scenarios.

Browse 125 questions

Keep learning step by step

Work through the concepts, practice explaining them in your own words, and use interview questions to check your understanding.

Explore another learning path