Core Java Difference between HashMap and ConcurrentHashMap Why is String immutable in Java? Difference between ArrayList and LinkedList Explain equals() vs hashCode() Difference between == and .equals() What happens when you use an object as a key in HashMap? Difference between checked and unchecked exceptions What is the difference between final, finally, and finalize()? Explain Java Memory Model (Heap, Stack, Metaspace) What causes memory leaks in Java? Difference between Comparable and Comparator What are immutable classes? How to create one? Explain method overloading vs overriding What is the use of volatile keyword? Difference between Runnable and Callable Explain synchronization and race conditions Difference between wait(), sleep(), and notify() What is deadlock? How do you prevent it? What are Java 8 Streams? Difference between map() and flatMap() Explain Optional in Java 8 Functional interfaces in Java What is lazy loading in streams? What is serialization/deserialization? What are marker interfaces? Multithreading & Concurrency How does thread pool work? What is ExecutorService? Explain CompletableFuture Difference between parallel stream and normal stream What is atomicity? Explain CountDownLatch vs CyclicBarrier What are concurrent collections? Spring Boot What happens internally when Spring Boot application starts? Explain dependency injection Difference between @Component, @Service, @Repository Difference between constructor and field injection What is Spring Bean lifecycle? Explain @Autowired Difference between @RestController and @Controller What is @Transactional? What is AOP in Spring? Explain profiles in Spring Boot How do you handle exceptions globally? What is Spring Security? How JWT authentication works? Difference between monolith and microservices How do microservices communicate? What is API Gateway? What is service discovery? Explain circuit breaker pattern What is Feign Client? Difference between PUT and PATCH Hibernate / JPA Difference between save() and persist() Explain lazy vs eager loading What is N+1 query problem? Difference between get() and load() What are cascading types? What is first-level cache? Difference between JPQL and native query Explain entity lifecycle states SQL & Database Difference between WHERE and HAVING Explain joins with examples Difference between clustered and non-clustered index What is normalization? What are ACID properties? Explain transactions Difference between DELETE, DROP, and TRUNCATE How to optimize slow queries? What is indexing? Microservices & System Design How do you secure microservices? How do you handle distributed transactions? What is idempotency? Explain Kafka basics What happens if one microservice is down? How do you monitor microservices? What is rate limiting? Explain caching strategies Redis use cases Design a URL shortener / notification service Coding Questions Often Asked Reverse a string without using built-in methods Find duplicate elements in array Find first non-repeated character Check palindrome LRU Cache implementation Producer-consumer problem Sort employees by salary using streams Group strings by length using streams Find second highest number Detect cycle in linked list Scenario-Based Questions (Very Important) Production issue due to high CPU — how will you debug? API response became slow after deployment — approach? Database connections exhausted — what could be wrong? How did you improve performance in your project? Explain one challenging bug you solved How do you handle backward compatibility in APIs? How do you deploy safely in production? For 3–5 years experience, interviewers focus heavily on: real project experience debugging ability concurrency basics API design Spring Boot internals database optimization communication/confidence
Backend Java Developer Interview Questions
517 backend java developer interview questions shared by candidates
Implement a load balancer, use TDD.
Find the target sum in an array. pring the target with index. Level order traversal in a tree. Java 8 stream sql question
Circuit breaker implementation in Java: The service A calls service B and service C every time. If one service fails 3-times in 10 minutes ( or 20 seconds in the implementation) the next call will be blocked for 5 minutes (10 seconds in the implementation). There was given a simulation of remote method calls, I needed to implement only the execute() which calls the remote service if possible.
Java Questions like: - Difference between a StringBuilder and a StringBuffer - Difference between a ArrayList and LinkedList - hashCode() and equals() Spring Framework and SpringBoot - What is the core foundation of Spring Framework - What is the difference between SpringBoot and Spring Framework - Beans lifecycle - @Autowired annotation - @EnableAutoConfiguration Others - Scalability - CI/CD, what is the CI and what is the CD Databases - Difference between Relational and Non Relational Databases Code Challenge: - Find the longest substring of unique characters in a String
Hiring Manager Interview: The interview focused largely on soft skills and engineering practices, including topics such as the difference between an engineer and a developer, giving and receiving feedback, testing strategies (e.g., the test pyramid), and approaches to code reviews. Coding Challenge: The experience during the coding challenge varied significantly depending on the interviewer (mine was absolutely terrible). The discussion covered topics such as the Dockerfile, dependency/version choices in the pom.xml, log and debug console output, and design decisions. In some cases, I was also questioned about features that were not part of the original challenge requirements.
What framworks did you used in your last job
API was responding in 2 ms earlier, now it takes 80 seconds. As a Lead, how will you find the issue?
What if some records fail?
Okay, assume it is POST. Will you process it synchronously?
Viewing 1 - 10 interview questions