Java Backend Developer Interview Questions - Complete Guide
Core Java (35 Questions)โ
Fundamentals & JVM Internalsโ
- What is Java and why is it platform-independent?
- Explain the main features of Java (WORA, OOP, Multithreading, Security)
- Differences between JDK, JVM, and JRE
- How does JVM work? Explain Class Loader, Runtime Data Area, Execution Engine
- What is JIT (Just-In-Time) compiler?
- What is bytecode? How does Java achieve platform independence?
- What is the difference between
==and.equals()? - Difference between Heap and Stack memory
- What is garbage collection? Explain different GC algorithms
- What are memory leaks in Java? How to prevent them?
- What are Wrapper classes? Explain autoboxing and unboxing
- Why is Java not a pure object-oriented language?
- What is the difference between primitive types and reference types?
OOP Principles (12 Questions)โ
-
Explain the four pillars of OOP with real-world examples:
- Encapsulation (data hiding, access control)
- Inheritance (code reusability, IS-A relationship)
- Polymorphism (compile-time and runtime)
- Abstraction (hiding implementation details)
-
What is inheritance and its types in Java? (Single, Multilevel, Hierarchical)
-
Why doesn't Java support multiple inheritance? How to achieve it?
-
Difference between method overloading and overriding (with rules)
-
Can we override static methods? Can we overload them?
-
What is method hiding vs method overriding?
-
What is abstraction? Difference between abstract class and interface (Java 8+)
-
Can we create an object of an abstract class? Can abstract class have constructor?
-
What are default and static methods in interfaces (Java 8+)?
-
What are functional interfaces? Name built-in functional interfaces
-
What are marker interfaces? Give examples (Serializable, Cloneable, Remote)
-
Difference between composition and inheritance (HAS-A vs IS-A)
Keywords, Access Modifiers & Best Practicesโ
- Explain access modifiers: public, private, protected, default (with package visibility)
- What is the
statickeyword and its uses? (variable, method, block, nested class) - Can we override static methods? What is static binding vs dynamic binding?
- What is the
finalkeyword? Effects on class, method, and variable - Difference between
final,finally, andfinalize() - What are
transientandvolatilekeywords? - What is
strictfpkeyword? - Difference between
thisandsuperkeyword
Constructors & Object Creationโ
- What are constructors and their types? (default, parameterized, copy)
- What is constructor chaining? Difference between
this()andsuper() - Can constructors be private? What is a singleton class and its implementation patterns?
- What is constructor overloading?
- What is the default constructor? When is it created?
- Difference between shallow copy and deep copy
- What is object cloning? What is the Cloneable interface?
- What are the ways to create objects in Java? (new, reflection, clone, deserialization, factory)
Serialization & Reflectionโ
- What is serialization and deserialization?
- What is
serialVersionUID? Why is it important? - Can we serialize static and transient variables?
- What is externalization? Difference between Serializable and Externalizable
- What is reflection API? When to use it?
- How to prevent serialization of a class?
- What are the security concerns with reflection?
String & Exception Handling (18 Questions)โ
String Manipulationโ
- What is String and String Constant Pool (String Intern Pool)?
- Difference between String, StringBuffer, and StringBuilder (with thread safety)
- Why are Strings immutable in Java? Benefits and drawbacks
- Difference between String literal and
new String() - Important String methods:
equals(),equalsIgnoreCase(),substring(),charAt(),indexOf(),split(),trim(),replace() - How to reverse a string in Java?
- How to check if a string is a palindrome?
- What is the time complexity of String concatenation using
+vsStringBuilder? - How many objects are created in String pool for:
String s1 = "Hello"; String s2 = "Hello";? - What is
intern()method in String?
Exception Handlingโ
- What is an Exception? Explain Java Exception Hierarchy
- Difference between checked and unchecked exceptions (with examples)
- What is the super-class for Exception and Error?
- Difference between Exception and Error
- Difference between
throwandthrows - Can we have
trywithoutcatch? Can we have multiplecatchblocks? - What is multi-catch block (Java 7)?
- What is the role of
finallyblock? When does it not execute? - Can we use
returnstatement infinallyblock? - How to create custom exceptions? (checked vs unchecked)
- What is try-with-resources (Java 7)?
- What is suppressed exceptions?
- Best practices for exception handling
- What is exception chaining?
Collections Framework (30 Questions)โ
Core Conceptsโ
- What is Collection Framework? Advantages over arrays
- Explain the Collections hierarchy (Collection, List, Set, Queue, Map)
- What are generics in Java? Why use them? (type safety, code reusability)
- What is type erasure in generics?
- Which interface doesn't extend Collection interface and why? (Map)
- How to make collections thread-safe? (Collections.synchronizedList, ConcurrentHashMap)
- What is the difference between Collection and Collections?
- What are bounded and unbounded wildcards in generics? (? extends T, ? super T)
List Interfaceโ
- Difference between ArrayList and LinkedList (use cases, time complexity)
- Difference between ArrayList and Vector (thread safety, growth factor)
- When to use ArrayList vs LinkedList vs Vector?
- How to convert Array to List and vice versa?
- What is the initial capacity of ArrayList? How does it grow?
- How does ArrayList work internally? (dynamic array, resizing)
- What is CopyOnWriteArrayList? When to use it?
- How to sort a List? (Collections.sort, Comparable, Comparator)
Set Interfaceโ
- Difference between Set and List (uniqueness, ordering)
- Difference between HashSet, LinkedHashSet, and TreeSet
- How does HashSet maintain uniqueness internally? (hashCode and equals contract)
- What happens if we add duplicate elements to a Set?
- How to convert List to Set?
- What is the time complexity of HashSet operations?
- What is CopyOnWriteArraySet?
- What is EnumSet?
Map Interfaceโ
- What is Map interface? Key characteristics
- Difference between HashMap and Hashtable (thread safety, null values)
- How does HashMap work internally? (hashing, buckets, collision handling, linked list to tree conversion in Java 8)
- What is the time complexity of HashMap operations? (Best, Average, Worst case)
- How many nulls are allowed in HashMap, TreeMap, Hashtable, ConcurrentHashMap, LinkedHashMap?
- Different ways to iterate a Map (keySet, values, entrySet, forEach, Iterator)
- What is WeakHashMap? When to use it?
- What is IdentityHashMap?
- Difference between HashMap and ConcurrentHashMap
- What is the load factor in HashMap? What happens during rehashing?
- What is TreeMap? How does it maintain order?
- What is LinkedHashMap? Difference from HashMap
- How to sort a Map by keys and values?
Queue & Dequeโ
- What is Queue interface? Common implementations
- What is PriorityQueue? How does it work?
- What is Deque? Difference between Queue and Deque
- What is ArrayDeque? When to use it over Stack?
- What is BlockingQueue? Use cases
Advanced Collections Conceptsโ
- What is fail-fast and fail-safe iterators? (with examples)
- What is ConcurrentModificationException? How to avoid it?
- Difference between Comparable and Comparator
- What is the difference between poll() and remove() in Queue?
- What is the difference between offer() and add() in Queue?
- How to create immutable collections? (Collections.unmodifiableList, List.of)
- What is the diamond problem in generics?
- What are concurrent collections? (ConcurrentHashMap, ConcurrentLinkedQueue, CopyOnWriteArrayList)
Java 8+ Features (20 Questions)โ
Lambda & Functional Programmingโ
- What are Lambda expressions? Syntax and examples
- What are functional interfaces? Name built-in ones (Predicate, Function, Consumer, Supplier, BiFunction, UnaryOperator, BinaryOperator)
- What is method reference? Types of method references (static, instance, constructor)
- Difference between lambda expression and anonymous class
- What is the difference between Function and BiFunction?
- What are closure in Java?
Stream APIโ
- What is Stream API? How is it different from Collections?
- What are intermediate and terminal operations? (filter, map, sorted vs collect, forEach, reduce)
- How to filter and map elements using Stream?
- How to find max, min, average, sum using Streams?
- How to group elements using
Collectors.groupingBy()? - How to sort collections using Streams?
- Difference between
map()andflatMap()(with examples) - What is the difference between
findFirst()andfindAny()? - What is the difference between
peek()andforEach()? - How to convert Stream to List, Set, Map?
- What is parallel stream? When to use it?
- What are short-circuit operations in Stream? (anyMatch, allMatch, noneMatch)
- How to handle exceptions in Stream API?
- What is the difference between Collection.stream() and Collection.parallelStream()?
Optional & Other Featuresโ
- What is Optional class? How to avoid NullPointerException using it?
- Important Optional methods (of, ofNullable, isPresent, ifPresent, orElse, orElseGet, orElseThrow)
- What are the new Date and Time API classes? (LocalDate, LocalDateTime, ZonedDateTime, Instant, Duration, Period)
- Difference between Date and LocalDate
- What are static and default methods in interfaces?
- What is the forEach method?
- What are the new features in Java 9, 11, 17, 21? (modules, var, records, sealed classes, pattern matching)
Multithreading & Concurrency (20 Questions)โ
Thread Basicsโ
- What is a thread? Difference between thread and process
- How to create threads in Java? (extending Thread vs implementing Runnable vs Callable)
- Difference between
start()andrun()method - Can you start a thread twice? What happens?
- What is the thread lifecycle? (New, Runnable, Running, Blocked, Waiting, Timed Waiting, Terminated)
- What is thread priority? How to set it?
- What is a daemon thread? How to create it?
- Difference between user thread and daemon thread
Synchronization & Thread Safetyโ
- What is synchronization? Why do we need it?
- What is the
synchronizedkeyword? Where can it be used? (method level, block level, static method) - What is a race condition? How to prevent it?
- What is deadlock? How to avoid it? (prevention strategies)
- What is livelock and starvation?
- Difference between
sleep()andwait()methods - What is the difference between
notify()andnotifyAll()? - What is
join()method? When to use it? - What is thread-local variable?
- What is the
volatilekeyword? How does it ensure visibility?
Concurrency Utilities (Java.util.concurrent)โ
- What is ConcurrentHashMap? How is it different from Hashtable and synchronized HashMap?
- How does ConcurrentHashMap achieve thread safety without synchronizing entire map?
- What is a thread pool? Benefits of using ExecutorService
- Types of ExecutorService (FixedThreadPool, CachedThreadPool, SingleThreadExecutor, ScheduledThreadPool)
- What is Future and Callable? Difference from Runnable
- What is CompletableFuture? How to use it?
- What are atomic variables? (AtomicInteger, AtomicLong, AtomicBoolean)
- What is the difference between CountDownLatch and CyclicBarrier?
- What is Semaphore? Use cases
- What are locks in Java? (ReentrantLock, ReadWriteLock)
- Difference between synchronized and ReentrantLock
- What is the happens-before relationship?
Spring Framework & Spring Boot (35 Questions)โ
Core Conceptsโ
- What is Spring Framework? Core modules
- What is Spring Boot? Advantages over traditional Spring
- What does
@SpringBootApplicationannotation do internally? (@Configuration, @EnableAutoConfiguration, @ComponentScan) - What is Spring Boot Starter? Name important starters (web, data-jpa, security, test, actuator)
- What is auto-configuration in Spring Boot? How does it work?
- What is
application.propertiesvsapplication.yml? - How to externalize configuration in Spring Boot?
- What is Spring Boot DevTools?
Dependency Injection & IoCโ
- What is Dependency Injection? Types of DI (Constructor, Setter, Field)
- What is IoC (Inversion of Control)?
- Difference between
@Component,@Service,@Repository,@Controller - What is
@Autowired? Types of autowiring (byType, byName, constructor) - Difference between
@Autowiredand@Resourceand@Inject - What are
@Qualifierand@Primaryannotations? - What is constructor injection vs setter injection? Which is better?
- What is the Spring Bean lifecycle?
- What are the scopes of Spring beans? (singleton, prototype, request, session, application)
- Difference between singleton and prototype scope
- What is
@PostConstructand@PreDestroy? - What is lazy initialization in Spring?
REST APIs & Web Layerโ
- Difference between
@Controllerand@RestController - What is
@RequestMappingand its variants? (@GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping) - What is
@PathVariablevs@RequestParamvs@RequestBody? - What is
@ResponseBodyand@ResponseEntity? - How to handle exceptions in Spring Boot? (@ControllerAdvice, @ExceptionHandler, @ResponseStatus)
- What is content negotiation in Spring?
- How to implement pagination in Spring Boot?
- What is CORS? How to enable it in Spring Boot?
- How to validate request data? (@Valid, @Validated, validation annotations)
- What is
@ModelAttribute?
Spring Data JPA & Databaseโ
- What is Spring Data JPA?
- What is the difference between JPA and Hibernate?
- What are the annotations used in JPA? (@Entity, @Table, @Id, @GeneratedValue, @Column, @ManyToOne, @OneToMany, @ManyToMany)
- What is the difference between CrudRepository, JpaRepository, and PagingAndSortingRepository?
- What are JPQL and native queries?
- What is the N+1 query problem? How to solve it? (fetch joins, @EntityGraph)
- What is lazy loading vs eager loading?
- What is cascading in JPA?
- What is the difference between save() and saveAndFlush()?
- How to implement custom queries in Spring Data JPA? (@Query, method naming convention)
Spring Boot Featuresโ
- What is Spring Boot Actuator? Important endpoints (/health, /metrics, /info, /env)
- What is the purpose of
@Beanannotation? - Difference between
@Configurationand@Component - What are Spring Boot Profiles? How to use them?
- What is
@Valueannotation? - What is
@ConfigurationProperties? - How to implement caching in Spring Boot? (@Cacheable, @CacheEvict, @CachePut)
- What is Spring AOP? Core concepts (Aspect, Advice, Pointcut, JoinPoint)
- What is Spring Security? How to implement authentication and authorization?
- What is Spring Batch?
Microservices Architecture (25 Questions)โ
Core Conceptsโ
- What are microservices? Principles of microservices
- Advantages and disadvantages of microservices
- Difference between monolithic and microservices architecture
- When to use microservices vs monolithic architecture?
- What are the challenges in microservices? (distributed transactions, data consistency, network latency)
- What is Domain-Driven Design (DDD)?
- What is bounded context?
Service Discovery & API Gatewayโ
- What is Service Discovery? (Eureka, Consul, Zookeeper)
- What is client-side vs server-side service discovery?
- What is API Gateway? (Spring Cloud Gateway, Zuul)
- What are the responsibilities of API Gateway? (routing, authentication, rate limiting, load balancing)
- What is the difference between API Gateway and Load Balancer?
Resilience & Fault Toleranceโ
- What is Circuit Breaker pattern? (Resilience4j, Hystrix)
- What are the states of Circuit Breaker? (Closed, Open, Half-Open)
- What is bulkhead pattern?
- What is retry pattern?
- What is timeout pattern?
- What is rate limiting?
- What is the difference between throttling and rate limiting?
Communication Patternsโ
- What is the difference between REST and gRPC?
- What is synchronous vs asynchronous communication in microservices?
- What is message queue? Examples (RabbitMQ, Kafka, ActiveMQ)
- Difference between message queue and event streaming (RabbitMQ vs Kafka)
- What is event-driven architecture?
- What is CQRS (Command Query Responsibility Segregation)?
- What is event sourcing?
Data Managementโ
- What is Database per Service pattern?
- What is shared database pattern? Pros and cons
- What is SAGA pattern? (Choreography vs Orchestration)
- What is distributed transaction? 2PC (Two-Phase Commit)
- What is eventual consistency?
- What is API composition pattern?
Configuration & Monitoringโ
- What is Spring Cloud Config? Centralized configuration management
- What is distributed tracing? (Sleuth, Zipkin, Jaeger)
- What is distributed logging? (ELK Stack - Elasticsearch, Logstash, Kibana)
- What is correlation ID?
- What are health checks in microservices?
- What is the 12-Factor App methodology?
Security & Deploymentโ
- What is the difference between authentication and authorization?
- What is JWT (JSON Web Token)? How does it work?
- What is OAuth 2.0? Different grant types
- What is service mesh? (Istio, Linkerd)
- What is containerization? Docker basics
- What is Kubernetes? Key concepts (Pod, Service, Deployment, ReplicaSet)
- What is blue-green deployment?
- What is canary deployment?
SQL & Database Management (35 Questions)โ
SQL Basicsโ
- What is the difference between SQL and NoSQL databases?
- What are different types of SQL commands? (DDL, DML, DCL, TCL)
- Difference between
WHEREandHAVINGclause - What are aggregate functions? (COUNT, SUM, AVG, MAX, MIN, GROUP_CONCAT)
- What is
GROUP BY? How does it work withHAVING? - What is the difference between
DISTINCTandGROUP BY? - What are SQL clauses execution order? (FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT)
- What is the difference between
COUNT(*),COUNT(1), andCOUNT(column)?
Joins & Subqueriesโ
- What are different types of JOINs? (INNER, LEFT, RIGHT, FULL OUTER, CROSS, SELF)
- Difference between INNER JOIN and OUTER JOIN
- What is a self-join? Use cases
- What is a cross join? When to use it?
- What is the difference between UNION and UNION ALL?
- What is the difference between INTERSECT and EXCEPT?
- What are subqueries? Types of subqueries (scalar, row, table, correlated)
- What is a correlated subquery? Difference from nested subquery
- What is the difference between JOIN and subquery? Performance implications
Constraints & Keysโ
- What are primary key and foreign key?
- What is a composite key?
- What is a candidate key and alternate key?
- What is a super key?
- What are constraints in SQL? (NOT NULL, UNIQUE, CHECK, DEFAULT, PRIMARY KEY, FOREIGN KEY)
- What is the difference between UNIQUE and PRIMARY KEY?
- Can a table have multiple primary keys?
- What is ON DELETE CASCADE and ON UPDATE CASCADE?
Indexes & Performance Optimizationโ
- What is an index? Why use indexes?
- Types of indexes (clustered, non-clustered, unique, composite, full-text, spatial)
- What is a clustered vs non-clustered index?
- How many clustered indexes can a table have?
- When should you use indexes? Advantages and disadvantages
- What is index cardinality?
- How to optimize SQL queries? (EXPLAIN, query execution plan, avoiding SELECT *, using indexes)
- What is query execution plan?
- What is the difference between covering index and included columns?
- What causes slow queries? (missing indexes, full table scans, complex joins, large result sets)
Transactions & ACID Propertiesโ
- What are ACID properties? (Atomicity, Consistency, Isolation, Durability)
- What is a transaction? How to manage transactions? (BEGIN, COMMIT, ROLLBACK, SAVEPOINT)
- What are different isolation levels? (READ UNCOMMITTED, READ COMMITTED, REPEATABLE READ, SERIALIZABLE)
- What is dirty read, non-repeatable read, and phantom read?
- What is the default isolation level in most databases?
- What is optimistic locking vs pessimistic locking?
- What is deadlock in database? How to detect and prevent it?
Normalization & Database Designโ
- What is normalization? Why is it important?
- What are different normal forms? (1NF, 2NF, 3NF, BCNF, 4NF, 5NF)
- What is denormalization? When to use it?
- What is the difference between star schema and snowflake schema?
- What is ER diagram?
- What are the types of relationships? (one-to-one, one-to-many, many-to-many)
Advanced SQL Conceptsโ
- What is a stored procedure? Advantages and disadvantages
- Difference between stored procedure and function
- What are triggers? Types of triggers (BEFORE, AFTER, INSTEAD OF)
- What is a view? Benefits of using views
- Difference between view and materialized view
- What is a CTE (Common Table Expression)? Difference from subquery
- What are window functions? (ROW_NUMBER, RANK, DENSE_RANK, NTILE, LAG, LEAD)
- What is the difference between RANK and DENSE_RANK?
- What is the N+1 query problem? How to solve it?
- Difference between DELETE, TRUNCATE, and DROP
- What is database partitioning? Types (horizontal, vertical, range, hash, list)
- What is database sharding?
- What is replication? Types (master-slave, master-master)
- What is connection pooling? Why is it important?
DBMS Concepts (25 Questions)โ
Database Architecture & Storageโ
- What is DBMS? Advantages over file system
- What are the components of DBMS architecture? (Query Processor, Storage Manager, Transaction Manager)
- What is a database schema? Types (physical, logical, view level)
- What is data independence? Types (physical, logical)
- What is the difference between physical and logical data independence?
- What is a data dictionary?
- How is data stored in database? (pages, blocks, extents)
- What is B-tree and B+ tree? How are they used in indexing?
- What is the difference between B-tree and B+ tree?
Concurrency Controlโ
- What is concurrency control? Why is it needed?
- What are different concurrency control protocols? (Lock-based, Timestamp-based, Validation-based)
- What is two-phase locking (2PL)? (Growing phase, Shrinking phase)
- What are shared locks and exclusive locks?
- What is timestamp ordering protocol?
- What is MVCC (Multi-Version Concurrency Control)?
- How does PostgreSQL handle concurrency differently from MySQL?
Database Recoveryโ
- What is database recovery? Why is it important?
- What is a log-based recovery? (undo, redo)
- What is checkpoint in database?
- What is shadow paging?
- What is crash recovery?
Query Processing & Optimizationโ
- What is query processing? Steps involved
- What is query optimization?
- What is cost-based optimization vs rule-based optimization?
- What is the role of query optimizer?
- What is an execution plan?
- What is query rewriting?
Distributed Databasesโ
- What is a distributed database?
- What is data fragmentation? (horizontal, vertical, hybrid)
- What is data replication?
- What is distributed query processing?
- What is CAP theorem? (Consistency, Availability, Partition Tolerance)
- What is BASE properties? (Basically Available, Soft state, Eventually consistent)
- Difference between ACID and BASE
NoSQL Databasesโ
- What are NoSQL databases? Types (Document, Key-Value, Column-Family, Graph)
- When to use NoSQL vs SQL databases?
- What is MongoDB? Key features
- What is Redis? Use cases
- What is Cassandra? When to use it?
- What is eventual consistency in NoSQL?
Operating System Concepts (25 Questions)โ
Process Managementโ
- What is an operating system? Main functions
- What is a process? Difference between process and program
- What are the states of a process? (New, Ready, Running, Waiting, Terminated)
- What is Process Control Block (PCB)?
- What is context switching?
- What is the difference between process and thread?
- What is multithreading? Advantages
- What is thread synchronization?
- What are user-level threads vs kernel-level threads?
CPU Schedulingโ
- What is CPU scheduling? Why is it needed?
- What are different CPU scheduling algorithms?
- FCFS (First Come First Serve)
- SJF (Shortest Job First)
- Round Robin
- Priority Scheduling
- Multilevel Queue Scheduling
- What is preemptive vs non-preemptive scheduling?
- What is convoy effect?
- What is starvation? How to prevent it?
- What is aging in OS?
Memory Managementโ
- What is memory management? Why is it important?
- What is paging? What is a page table?
- What is segmentation? Difference between paging and segmentation
- What is virtual memory? How does it work?
- What is demand paging?
- What is page replacement algorithms? (FIFO, LRU, Optimal, LFU)
- What is thrashing? How to prevent it?
- What is the difference between logical and physical address?
- What is TLB (Translation Lookaside Buffer)?
Deadlockโ
- What is deadlock? Necessary conditions for deadlock (Mutual Exclusion, Hold and Wait, No Preemption, Circular Wait)
- What are deadlock handling strategies? (Prevention, Avoidance, Detection, Recovery)
- What is Banker's algorithm?
- What is resource allocation graph?
File Systemโ
- What is a file system? Types (FAT32, NTFS, ext4)
- What is inode?
- What is the difference between hard link and soft link?
- What are different file allocation methods? (Contiguous, Linked, Indexed)
Inter-Process Communication & Synchronizationโ
- What is Inter-Process Communication (IPC)? Methods (Pipes, Message Queues, Shared Memory, Sockets)
- What is semaphore? Types (Binary, Counting)
- What is mutex? Difference between mutex and semaphore
- What is the producer-consumer problem?
- What is the reader-writer problem?
- What is the dining philosophers problem?
System Design & Architecture (20 Questions)โ
Design Principlesโ
- What are SOLID principles?
- Single Responsibility Principle
- Open/Closed Principle
- Liskov Substitution Principle
- Interface Segregation Principle
- Dependency Inversion Principle
- What are design patterns? Categories (Creational, Structural, Behavioral)
- What is Singleton pattern? How to implement thread-safe singleton?
- What is Factory pattern vs Abstract Factory pattern?
- What is Builder pattern? When to use it?
- What is Prototype pattern?
- What is Adapter pattern?
- What is Decorator pattern?
- What is Proxy pattern?
- What is Observer pattern?
- What is Strategy pattern?
- What is Template Method pattern?
Scalability & Performanceโ
- What is horizontal vs vertical scaling?
- What is load balancing? Types (Round Robin, Least Connections, IP Hash)
- What is caching? Caching strategies (Cache-aside, Write-through, Write-back, Read-through)
- What is CDN (Content Delivery Network)?
- What is database replication? Master-slave vs master-master
- What is database sharding? Sharding strategies
- What is rate limiting? Implementation approaches
- What is the difference between latency and throughput?
REST API & Web Services (15 Questions)โ
REST Fundamentalsโ
- What is REST? REST principles (Stateless, Client-Server, Cacheable, Uniform Interface, Layered System)
- What are HTTP methods? (GET, POST, PUT, PATCH, DELETE, OPTIONS, HEAD)
- What is the difference between PUT and PATCH?
- What are HTTP status codes?
- 2xx: Success (200, 201, 204)
- 3xx: Redirection (301, 302, 304)
- 4xx: Client Error (400, 401, 403, 404, 409)
- 5xx: Server Error (500, 502, 503)
- What is idempotency? Which HTTP methods are idempotent?
- What is the difference between REST and SOAP?
- What is RESTful API design best practices?
- What is HATEOAS?
- What is API versioning? Strategies (URI, Header, Query Parameter)
API Securityโ
- What are different authentication mechanisms? (Basic Auth, Bearer Token, OAuth, JWT, API Key)
- What is the difference between authentication and authorization?
- What is OAuth 2.0? OAuth flow
- What is JWT? Structure of JWT (Header, Payload, Signature)
- What is the difference between stateless and stateful authentication?
- What is CORS? How to handle it?
Testing & Best Practices (15 Questions)โ
Testingโ
- What are different types of testing? (Unit, Integration, System, Acceptance)
- What is JUnit? Common annotations (@Test, @Before, @After, @BeforeClass, @AfterClass)
- What is Mockito? How to mock objects?
- What is the difference between mock and stub?
- What is TDD (Test-Driven Development)?
- What is code coverage? Is 100% coverage necessary?
- What is integration testing in Spring Boot? (@SpringBootTest, @WebMvcTest, @DataJpaTest)
- How to test REST APIs? (MockMvc, RestTemplate, TestRestTemplate)
Code Quality & Best Practicesโ
- What are coding standards and why are they important?
- What is code smell? Examples
- What is refactoring?
- What is clean code? Key principles
- What is DRY (Don't Repeat Yourself)?
- What is KISS (Keep It Simple, Stupid)?
- What is YAGNI (You Aren't Gonna Need It)?
Git & Version Control (10 Questions)โ
- What is Git? Difference between Git and GitHub
- What are basic Git commands? (clone, pull, push, commit, merge, rebase, branch, checkout)
- What is the difference between git pull and git fetch?
- What is the difference between git merge and git rebase?
- What is a merge conflict? How to resolve it?
- What is branching strategy? (GitFlow, GitHub Flow, Trunk-Based Development)
- What is a pull request? Code review process
- What is .gitignore file?
- What is git stash?
- What is the difference between git reset and git revert?
Practical Coding Problems (25 Questions)โ
Array & String Problemsโ
- Find the second largest element in an array
- Reverse a string without using built-in methods
- Check if a string is a palindrome
- Find all duplicate elements in an array
- Find the missing number in an array of 1 to n
- Rotate an array by k positions
- Find the first non-repeating character in a string
- Check if two strings are anagrams
- Implement string compression (e.g., "aabbbcccc" -> "a2b3c4")
- Find all pairs in array that sum to a target value
Collections Problemsโ
- Remove duplicates from ArrayList
- Sort a HashMap by values
- Find frequency of each element in a list
- Merge two sorted lists
- Find the intersection of two lists
- Implement LRU Cache using LinkedHashMap
- Group anagrams from a list of strings
- Find top K frequent elements
Stream API Problemsโ
- Find sum of all even numbers in a list using Streams
- Convert list of strings to uppercase using Streams
- Filter employees with salary > 50000 and sort by name
- Group employees by department using Streams
- Find the average salary of employees using Streams
- Flatten a list of lists using flatMap
- Find the longest string from a list using Streams
Scenario-Based Questions (15 Questions)โ
Performance & Optimizationโ
- How would you optimize a slow-running query?
- How would you handle high traffic on your application?
- How would you design a caching strategy for an e-commerce application?
- How would you handle memory leaks in a Java application?
- How would you optimize a Spring Boot application startup time?
Architecture & Designโ
- Design a URL shortener service (like bit.ly)
- Design a rate limiter
- Design a notification system
- Design a file upload and download system
- How would you design a shopping cart system?
Problem Solvingโ
- How would you handle a situation where microservices are failing?
- How would you implement distributed transactions across microservices?
- How would you handle data consistency in microservices?
- How would you debug a production issue with minimal logs?
- How would you migrate from monolithic to microservices architecture?
Behavioral & Situational Questions (10 Questions)โ
- Tell me about a challenging bug you fixed
- Describe a time when you optimized application performance
- How do you stay updated with new technologies?
- Describe your experience with code reviews
- How do you handle disagreements with team members?
- Tell me about a project you're most proud of
- How do you prioritize tasks when working on multiple projects?
- Describe a situation where you had to learn a new technology quickly
- How do you ensure code quality in your projects?
- What's your approach to debugging a complex issue?
Quick Reference: Interview Preparation Strategyโ
Week 1-2: Core Fundamentalsโ
- โ Java basics, OOP, Collections
- โ String manipulation, Exception handling
- โ Multithreading basics
- โ Practice 20-30 coding problems
Week 3-4: Advanced Java & Frameworksโ
- โ Java 8+ features (Streams, Lambda, Optional)
- โ Spring Boot, Spring Data JPA
- โ REST API design
- โ Practice integration problems
Week 5-6: Database & System Designโ
- โ SQL queries, joins, indexes
- โ DBMS concepts (normalization, transactions)
- โ Design patterns
- โ Microservices architecture
Week 7-8: Advanced Topics & Mock Interviewsโ
- โ OS concepts (for system-level understanding)
- โ Microservices patterns
- โ System design scenarios
- โ Mock interviews and revision
Important Tips for Interview Successโ
Technical Round Preparationโ
- Understand, don't memorize: Focus on concepts and use cases
- Practice coding: Write actual code for each concept
- Real-world examples: Always relate to practical scenarios
- Ask clarifying questions: Show your thought process
- Test your code: Always consider edge cases
Common Mistakes to Avoidโ
- โ Not asking clarifying questions
- โ Jumping to code without thinking
- โ Not considering edge cases
- โ Poor time management in coding rounds
- โ Not testing the solution
- โ Getting stuck on one approach
- โ Not communicating your thought process
During the Interviewโ
- โ Listen carefully to the question
- โ Think out loud
- โ Start with a brute force approach, then optimize
- โ Write clean, readable code
- โ Test with examples
- โ Be honest if you don't know something
- โ Show enthusiasm and curiosity
Resources for Practiceโ
- Coding: LeetCode, HackerRank, CodeSignal
- System Design: System Design Primer, Designing Data-Intensive Applications
- Java: Effective Java, Java Concurrency in Practice
- Spring Boot: Official Spring documentation, Baeldung
- SQL: SQLZoo, HackerRank SQL
Topic-wise Priority for Different Experience Levelsโ
Fresher (0-2 years)โ
High Priority: Core Java, OOP, Collections, String, Exception Handling, SQL Basics Medium Priority: Java 8 Features, Spring Boot Basics, Basic Multithreading Low Priority: Advanced Microservices, Complex System Design
Mid-Level (2-5 years)โ
High Priority: All Java topics, Spring Boot, REST APIs, SQL Advanced, Collections Advanced Medium Priority: Microservices, Design Patterns, System Design Basics, DBMS Low Priority: Advanced OS concepts, Complex distributed systems
Senior (5+ years)โ
High Priority: Microservices, System Design, Architecture Patterns, Performance Optimization Medium Priority: All technical topics (should be strong) Focus On: Leadership, Trade-offs, Scalability, Team collaboration
Final Checklist Before Interviewโ
Day Beforeโ
- Review key concepts in your weak areas
- Practice 5-10 coding problems
- Review your resume and projects thoroughly
- Prepare questions to ask the interviewer
- Get good sleep
Interview Dayโ
- Have your IDE/editor ready (for online coding)
- Stable internet connection
- Pen and paper for rough work
- Water/coffee
- Calm mind and positive attitude
Total Questions: 525+ covering all aspects of Java Backend Development
_This comprehensive guide is designed for 2025 interview patterns. Focus on understanding concepts deeply rather than memorizing answers. Practice regularly and build projects to solidify your knowledge. Good luck! _