Java Interview Prep
Master the backend, one topic at a time.
Mastered
Revision
collections0 / 24
- Internal working of ArrayList and HashMap.
- Vector vs ArrayList
- LinkedList vs ArrayList: When to use which?
- HashMap vs Hashtable
- Internal Working: TreeMap vs HashMap
- Shallow vs Deep Cloning
- Synchronized vs Concurrent Collections
- CopyOnWriteArrayList vs ArrayList
- WeakHashMap and Types of References
- Sorting Custom Objects in Java
- Iterator vs ListIterator: Traversal & Modification
- What is PriorityQueue?
- Comparable vs Comparator: Natural vs Custom Sorting
- Why ConcurrentModificationException occurs?
- Internal Working of HashMap: Hashing, Buckets and RB-Trees
- Collections & Arrays: Utility Puzzles
- Array vs ArrayList: Which one is preferred?
- Finding the Second Largest Element: Algorithms & Time Complexity
- ConcurrentHashMap vs Synchronized HashMap
- Map to List Conversion in Java
- Generics vs Arrays: Why you cannot create a Generic Array
- HashMap vs ConcurrentHashMap: Thread-Safety, Locking & Performance
- ConcurrentHashMap: Segmentation vs CAS Locking
- Mastering Immutable Classes: Security, Reflection & I/O
db0 / 16
- DELETE vs TRUNCATE
- WHERE vs HAVING: Filtering Data at Different Stages
- Internal Execution Order of a SQL Query
- Query to find the Second Highest Salary
- ACID Properties in Databases
- Self Join: Why is it required?
- View vs Materialized View
- Horizontal vs Vertical Partitioning
- Primary, Candidate, and Surrogate Keys
- Advanced SQL Query Puzzles (Top Paid, Dept Averages)
- Advanced Partitioning (Sub-partitioning, Indexes)
- Inner Join vs Left Join with Examples
- Indexing: When, How, and Why (Adv/Disadv)
- How to implement pagination in SQL?
- INNER JOIN vs LEFT JOIN vs RIGHT JOIN: Complete Comparison
- How to Optimize a Slow SQL Query in Production
exceptions0 / 6
fundamentals0 / 11
- What is JVM? Difference between JVM/JDK /JRE?
- Explain JVM architecture and components (Class Loader, Runtime Data Areas, Execution Engine).
- Thread-specific runtime data areas in JVM and their roles?
- Java Memory Model (JMM): Core Guarantees & Happens-Before
- What are happens-before relationships in JMM?
- How does the JVM implement volatile variables and atomic operations?
- Analyzing GC spikes and frequent Full GCs in production.
- JVM args to fine tune performance.
- What is MetaSpace? How does it differ from PermGen?
- volatile keyword — Why does it exist, when do you actually need it.
- Virtual Functions in Java: Runtime Polymorphism & VTable Dispatch
java80 / 18
- What are Functional interfaces? Why they were added? Is FI annotation mandatory?
- Categories of Functional Interfaces and Predicate vs Function vs Supplier.
- Write a Functional Interface for summing 2 numbers.
- What is a default method and why is it required?
- Can a functional interface extend/inherit another interface?
- Method references? Syntax and Scenarios.
- Lambdas vs Anonymous Inner Classes (Scope and Performance).
- Asynchronous Programming with CompletableFuture.
- Difference between terminal and intermediate operations in Streams.
- Parallel streams? When to use and Pitfalls.
- What is a Spliterator? Diff between Iterator vs Spliterator.
- Multiple inheritance and Diamond Problem in Java 8.
- Performance difference between Streams.sorted() vs Collections.sort()
- Stream API vs Collection API: Key Differences & When to Use Each
- How does Parallel Stream work internally? Is it always better?
- Functional Interfaces Deep Dive: Can we extend them?
- map() vs flatMap(): One-to-One vs One-to-Many with Examples
- What is Optional and how does it prevent NullPointerException?
jpa0 / 10
- JPA vs Hibernate vs Spring Data JPA.
- Explain the N+1 Query Problem and how to fix it.
- FetchType.LAZY vs FetchType.EAGER.
- @GeneratedValue strategies in JPA.
- Optimistic vs Pessimistic Locking in JPA.
- How to enable pagination and sorting in Spring Data JPA?
- Role of EntityManager in Spring Data JPA.
- How to implement auditing in Spring Data JPA?
- Multi-tenancy strategies with Spring Data JPA.
- Named Queries vs @Query in Spring Data JPA.
microservices0 / 19
- Monolithic vs. Microservices Architecture: Trade-offs & Deep Dive
- Saga Pattern for Distributed Transactions.
- CQRS Pattern (Command Query Responsibility Segregation).
- Circuit Breaker Pattern (Resilience4j).
- Distributed Tracing (Sleuth and Zipkin).
- Event Driven Architecture (EDA).
- Event vs Command vs Query in EDA (and Broker roles).
- Saga Advanced: Retries, Idempotency, and High Throughput.
- Event Sourcing vs Traditional CRUD.
- API Gateway vs Kubernetes Service Load Balancing.
- Steps to implement Circuit Breaker (Resilience4j).
- Kubernetes Auto-scaling: HPA, VPA, and CA.
- Fault Tolerance vs Resilience (and Bulkhead pattern).
- What is Service Discovery and why do we need it?
- Feign Client and Fallbacks.
- Client-side vs Server-side Load Balancing (L4 vs L7).
- 12-Factor App and CAP Theorem.
- What is API Gateway and why is it needed in Microservices?
- What are Idempotent APIs? Examples with GET, PUT, DELETE
miscellaneous0 / 6
multithreading0 / 14
- Thread vs Runnable? Which is better?
- wait() vs sleep()?
- wait(), notify(), notifyAll() - Why in Object class?
- Synchronized method vs Synchronized block.
- ExecutorService and Thread Pool types.
- synchronized vs Lock Interface.
- CountDownLatch vs CyclicBarrier.
- Implement a program to print Thread1 and Thread2 from two parallel threads in sequential order.
- Race Condition vs Visibility problem.
- What is a daemon thread in Java?
- How does ThreadLocal work and where is it used in real projects?
- Callable vs Runnable: Return Values, Exceptions & When to Use Each
- What is ForkJoinPool and how does it improve performance?
- What is Immutability and how does it help in Multi-threading?
spring0 / 19
- Bean Lifecycle in Spring?
- IoC and DI - Purpose and Benefits.
- Singleton in Spring vs Java Singleton.
- @Autowired, @Primary, and @Qualifier.
- @RestController vs @Controller.
- What does @SpringBootApplication comprise of?
- Spring Caching: @Cacheable, @CachePut, and @CacheEvict
- @Valid vs @Validated.
- @RequestParam vs @PathVariable vs @RequestBody.
- Lifecycle of a REST request in Spring Boot (DispatcherServlet).
- Securing APIs with Spring Security and JWT.
- @ControllerAdvice vs @RestControllerAdvice.
- Best practices for REST endpoints and URL naming.
- How to configure CORS in Spring Boot REST APIs?
- How Spring Boot auto-configures Jackson?
- How to implement custom validation annotations?
- Validating nested objects and collections.
- Spring Boot Auto-Configuration: How does it work internally?
- @Component vs @Service vs @Repository vs @Controller