1. Core Java & OOP
- Write an immutable class in Java
- Comparable vs Comparator with examples
- What is a Functional Interface? Can it have default and static methods?
- Explain try-with-resources. What happens if both try and close() throw exceptions?
2. JVM, Memory & Performance
- JVM memory management
- Your Java application has high GC pauses in production — what would you investigate?
- How would you identify a memory leak in a Java application?
3. Concurrency & Multithreading
- Multithreading
- Producer–Consumer problem
- Deadlock example in Java
- Implement a thread-safe Singleton using double-checked locking
4. Collections & Internals
- Collections internal working
- HashMap internal working
- How does HashMap handle collisions internally?
- ConcurrentHashMap vs HashMap — scenario-based
- Explain the internal working of ConcurrentHashMap
- Process a large ConcurrentHashMap using multiple threads safely
5. Java 8 & Streams
- How does Java 8 Stream API work internally?
- Difference between map() vs flatMap() with a real-world example
- Write a Java 8 program using flatMap() to flatten a nested list
- Sort Employee list using Comparator & Streams
- Sort employees by salary
- Find Top N highest salaries using Streams
- Find employee with highest salary
- Find employee with second highest salary
- Find the highest-paid employee from each department using Streams
- Group employees by department
- Count employees by department
- Convert List to Map using Streams
- Remove duplicates using Streams
- Find duplicate elements using Streams
- Find highest number in a list using Streams
- Find second highest number in a list using Streams
- Find first non-repeating character using Streams
- Find second non-repeating character using Streams
- Count character frequency using Streams
- Find employees joining after a given year
6. Data Structures — Arrays & Lists
- Find duplicate elements in an array
- Merge two sorted arrays
- Find all unique triplets whose sum equals a given target
- Find duplicate elements in a list
- Remove duplicates from a list
- Find the highest number in a list
- Find the second highest number in a list
7. Data Structures — Strings
- Find first non-repeating character in a string
- Find second non-repeating character in a string
- Find first repeating character in a string
- Reverse a string without using inbuilt methods
- Reverse words in a sentence
- Find longest substring without repeating characters
- Find the length of the longest substring containing at most K distinct characters
- How would you optimize the K-distinct substring problem to O(n)?
- What changes if K = 2?
- How would you manage character frequencies efficiently?
- Count frequency of characters using HashMap
- Remove duplicate characters from a string
- String rotation (ajith → thaji)
8. Data Structures — Stacks, Caching & Classic Problems
- Balanced parentheses problem using Stack
- Implement LRU Cache
9. Algorithms & Sorting
- Implement Merge Sort and explain its time and space complexity
10. Spring Boot & REST APIs
- CompletableFuture real-time scenario
- Retry failed REST API calls
- Pagination implementation in Spring Boot
- Rate Limiter implementation
- Spring Boot exception handling
- REST API best practices
- How would you design an API that can handle 10K+ requests per second?
- How would you prevent duplicate orders if the same request is received twice?
- How would you design an API so that it remains backward compatible when the response structure changes?
- How does @Transactional work internally in Spring Boot?
- How does Dependency Injection work internally in Spring?
11. SQL & Databases
- Find the second-highest salary from an Employee table
- Find nth highest salary
- Find employees having the same salary
- Department-wise maximum salary query
- Count employees department-wise
- Remove duplicate records from a table
- Find duplicate rows in a table
- Difference between WHERE and HAVING
- INNER JOIN vs LEFT JOIN
- Pagination using LIMIT & OFFSET
- How would you design pagination for millions of records?
- SQL optimization
- Indexing, composite indexes, and query execution plans
- How would you optimize a slow query running on millions of records?
- Your database has 100 million records and a query suddenly becomes slow — how would you investigate?
- What happens when your database becomes unavailable for 30 seconds?
- Two requests update the same DB record simultaneously — how would you handle the race condition?
12. Kafka & Asynchronous Messaging
- How would you prevent duplicate processing of Kafka messages?
- Kafka is receiving messages faster than consumers can process them — how would you solve it?
- How would you handle a Kafka message that repeatedly fails?
13. Microservices & System Design
- Microservices communication
- How would you design microservices for high availability?
- API Gateway vs Load Balancer — what is the difference?
- How would you handle failures between two microservices?
- One microservice is down — how should dependent services behave?
- Explain Circuit Breaker, Retry and Timeout patterns
- Retry vs Timeout vs Circuit Breaker — when would you use each?
- How would you design a retry mechanism without creating a retry storm?
- How would you prevent one slow downstream service from exhausting your application's threads?
- How would you maintain consistency when a business operation spans multiple microservices?
- How would you handle distributed transactions?
- How would you handle duplicate requests?
- Designing a scalable payment/transaction backend
- What happens if the payment succeeds, but your service crashes before sending the response?
- Duplicate payments, idempotency, consistency, retries, and event-driven processing
- How would you migrate a Java application from on-premise to Cloud?
14. Debugging, Observability & Performance Tuning
- Your API is slow, but CPU and memory are normal — how would you find the bottleneck?
- An API's latency suddenly increases from 200ms to 5 seconds — how would you debug it?
- Your system works perfectly at normal traffic but fails during a sudden traffic spike — walk me through your debugging approach.
- How would you monitor and troubleshoot a production microservices application?
Top comments (0)