Hiring guide

Java Developer Interview Questions

February 27, 2026
42 min read

These Java Developer interview questions will guide your interview process to help you find trusted candidates with the right skills you are looking for.

168 Java Developer Interview Questions

  1. What is Java?

  2. What are the differences between JDK, JRE, and JVM?

  3. Why is Java a platform independent language?

  4. Why is Java not a pure object-oriented language?

  5. What do you understand by an instance variable and a local variable?

  6. What are the default values assigned to variables and instances in Java?

  7. What is the main method in Java and why is it static?

  8. Can the main method be overloaded?

  9. What is JIT compiler?

  10. What are the differences between primitive data types and objects in Java?

  11. What are the main principles of OOP?

  12. What do you mean by data encapsulation?

  13. Explain the concept of inheritance in Java

  14. What is the difference between an abstract class and an interface?

  15. What is polymorphism in Java?

  16. Explain method overloading and method overriding

  17. What is the purpose of the super keyword?

  18. What is the 'IS-A' relationship in Java?

  19. What is the difference between Composition and Aggregation?

  20. Why is inheritance less advantageous than composition?

  21. What is the difference between String, StringBuilder, and StringBuffer?

  22. Why are strings immutable in Java?

  23. What is the difference between equals() method and equality operator (==) in Java?

  24. How is creation of String using new() different from literal?

  25. Why is character array preferred over string for storing confidential information?

  26. Should String or StringBuffer be used when there are lot of updates required?

  27. What is exception handling in Java?

  28. What is the difference between checked and unchecked exceptions?

  29. Can a single try block have multiple catch blocks?

  30. What is the difference between throw and throws keywords?

  31. What is the purpose of the finally block?

  32. Will finally block execute if there is a return statement in try block?

  33. Explain try-with-resources in Java

  34. How do you create and throw custom exceptions?

  35. Is it mandatory for catch block to follow try block?

  36. How does exception propagation work in Java?

  37. What is the Java Collections Framework?

  38. What is the difference between ArrayList and LinkedList?

  39. What is the difference between ArrayList and array?

  40. What is the difference between HashSet and TreeSet?

  41. What is the difference between HashMap and Hashtable?

  42. How does HashMap work internally in Java?

  43. What is the difference between fail-fast and fail-safe iterators?

  44. What is the difference between Comparable and Comparator?

  45. Why is Map not part of the Collection interface hierarchy?

  46. What is the difference between Iterator and ListIterator?

  47. What is multithreading in Java?

  48. What is the difference between process and thread?

  49. How can you create threads in Java?

  50. What is the difference between Runnable and Callable?

  51. Explain the thread lifecycle in Java

  52. What is synchronization in Java?

  53. What is the difference between wait() and sleep()?

  54. What is a deadlock? How can you prevent it?

  55. What is the volatile keyword in Java?

  56. What is the difference between synchronized and volatile?

  57. What is the ExecutorService framework?

  58. What are lambda expressions in Java?

  59. What is a functional interface?

  60. What are Streams in Java 8?

  61. What is the difference between map() and flatMap()?

  62. What is Optional in Java 8?

  63. What are default methods in interfaces?

  64. What is method reference in Java 8?

  65. What is the difference between intermediate and terminal operations in Streams?

  66. What is the Collectors class in Java 8?

  67. What are the new Date and Time APIs in Java 8?

  68. How does garbage collection work in Java?

  69. What are the different memory areas in JVM?

  70. What is the difference between stack and heap memory?

  71. What is memory leak in Java? How can you prevent it?

  72. What are strong, soft, weak, and phantom references?

  73. What is the finalize() method?

  74. What are the different types of garbage collectors?

  75. What is generational garbage collection?

  76. What is reflection in Java?

  77. What are annotations in Java?

  78. What is serialization and deserialization in Java?

  79. What is the transient keyword?

  80. What is the difference between Serializable and Externalizable?

  81. What is cloning in Java? What is the difference between shallow and deep copy?

  82. What are generics in Java? Why are they used?

  83. What is type erasure in Java generics?

  84. What are enum types in Java?

  85. What is the difference between static and instance inner classes?

  86. What is the difference between ClassNotFoundException and NoClassDefFoundError?

  87. What is the purpose of the strictfp keyword?

  88. What is the Singleton design pattern? How do you implement it?

  89. What is the Factory design pattern?

  90. What is dependency injection?

  91. What are SOLID principles?

  92. What is the difference between composition and inheritance?

  93. What are immutable classes? How do you create them?

  94. What is the Builder design pattern?

  95. What coding standards should Java developers follow?

  96. How do you handle null values effectively?

  97. What is technical debt and how do you manage it?

  98. What is the Spring Framework?

  99. What is dependency injection in Spring?

  100. What is the difference between @Component, @Service, @Repository, and @Controller?

  101. What are the different scopes of Spring beans?

  102. What is Spring Boot? How is it different from Spring Framework?

  103. What is Spring AOP? What are cross-cutting concerns?

  104. What is the difference between @Bean and @Component?

  105. What is Spring Data JPA?

  106. What is the difference between @RequestParam and @PathVariable?

  107. How does Spring handle transactions?

  108. What is unit testing? Why is it important?

  109. What is JUnit? How do you write unit tests?

  110. What is the difference between JUnit 4 and JUnit 5?

  111. What is mocking? What is Mockito?

  112. What is the difference between mock, stub, and spy?

  113. What is integration testing?

  114. What is Test-Driven Development (TDD)?

  115. What is code coverage and why is it important?

  116. What tools do you use for code quality and static analysis?

  117. How do you test RESTful APIs?

  118. How do you identify performance bottlenecks in Java applications?

  119. What are common performance optimization techniques?

  120. How does caching improve performance? What caching strategies do you know?

  121. What is lazy loading and eager loading?

  122. How do you optimize database queries?

  123. What is the N+1 query problem? How do you solve it?

  124. What are best practices for String concatenation in loops?

  125. How do you tune JVM for better performance?

  126. What are common security vulnerabilities in Java applications?

  127. How do you prevent SQL injection?

  128. What is Cross-Site Scripting (XSS)? How do you prevent it?

  129. What is CSRF? How does Spring Security protect against it?

  130. How do you securely store passwords?

  131. What is JWT? How does it work?

  132. What is OAuth 2.0?

  133. How do you handle sensitive data in application properties?

  134. What is role-based access control (RBAC)?

  135. What is ORM? What are its advantages?

  136. What is the difference between JPA and Hibernate?

  137. What is the difference between EntityManager and SessionFactory?

  138. Explain the different states of entity lifecycle in JPA

  139. What is the first-level cache and second-level cache in Hibernate?

  140. What are the different types of relationships in JPA?

  141. What is the difference between save() and persist() in Hibernate?

  142. What is the difference between get() and load() methods?

  143. What is JPQL? How is it different from SQL?

  144. What are named queries in JPA?

  145. What are microservices? What are their advantages and disadvantages?

  146. What is REST? What are RESTful principles?

  147. What is the difference between PUT and PATCH?

  148. What is service discovery in microservices?

  149. What is an API Gateway?

  150. What is circuit breaker pattern?

  151. How do you handle distributed transactions in microservices?

  152. What is Docker? How does containerization help?

  153. What is Kubernetes? Why is it used?

  154. What is the difference between monolithic and microservices architecture?

  155. What is message queue? What are its benefits?

  156. What is the difference between JMS and AMQP?

  157. What is Apache Kafka? How does it work?

  158. What is event-driven architecture?

  159. What is the difference between synchronous and asynchronous communication?

  160. What is CQRS pattern?

  161. What is Maven? How does it work?

  162. What is the difference between Maven and Gradle?

  163. What is CI/CD? Why is it important?

  164. What is Git? What are basic Git commands?

  165. What is the difference between merge and rebase?

  166. What is infrastructure as code?

  167. What is logging? What logging frameworks do you know?

  168. What is monitoring and observability?

Download Free Java Developer Interview Questions

Get expert-crafted questions designed specifically for java developer roles. Our comprehensive PDF includes technical, behavioral, and ethics questions to help you identify top talent.

Core Java Fundamentals

What is Java?

What to Listen For:

  • Clear mention of "write once, run anywhere" (WORA) philosophy and platform independence
  • Understanding of object-oriented programming principles as Java's foundation
  • Recognition of automatic memory management through garbage collection

What are the differences between JDK, JRE, and JVM?

What to Listen For:

  • Accurate explanation that JVM executes bytecode, JRE provides runtime environment, and JDK includes development tools
  • Understanding of the hierarchical relationship: JDK contains JRE, which contains JVM
  • Practical knowledge of when each component is needed in development versus deployment

Why is Java a platform independent language?

What to Listen For:

  • Explanation of bytecode compilation and how it enables cross-platform execution
  • Understanding that JVM interprets bytecode on any platform with JRE installed
  • Recognition that source code compiles once but runs on multiple operating systems without modification

Why is Java not a pure object-oriented language?

What to Listen For:

  • Specific mention of primitive data types (int, float, boolean, etc.) that are not objects
  • Understanding that primitives exist for performance and memory efficiency reasons
  • Awareness of wrapper classes that bridge primitives with object-oriented features

What do you understand by an instance variable and a local variable?

What to Listen For:

  • Clear distinction that instance variables belong to objects while local variables exist within methods or blocks
  • Understanding of scope differences and lifecycle of each variable type
  • Recognition that instance variables get default values while local variables must be initialized before use

What are the default values assigned to variables and instances in Java?

What to Listen For:

  • Knowledge that local variables have no default values and must be initialized
  • Awareness that instance variables receive defaults: 0 for numeric types, false for boolean, null for references
  • Understanding that using uninitialized local variables causes compilation errors

What is the main method in Java and why is it static?

What to Listen For:

  • Correct signature: public static void main(String[] args) and understanding of each keyword
  • Explanation that static allows JVM to call main without creating an object instance
  • Recognition that main serves as the entry point for program execution

Can the main method be overloaded?

What to Listen For:

  • Affirmative answer that main can be overloaded with different parameter signatures
  • Understanding that JVM only calls the standard main(String[] args) signature as entry point
  • Awareness that overloaded main methods are treated as regular methods, not entry points

What is JIT compiler?

What to Listen For:

  • Explanation that JIT (Just-In-Time) compiles bytecode to native machine code during runtime
  • Understanding that it improves performance by optimizing frequently executed code paths
  • Recognition that JIT balances compilation time with execution speed for better overall performance

What are the differences between primitive data types and objects in Java?

What to Listen For:

  • Clear explanation that primitives store actual values while objects store references to memory locations
  • Understanding of memory efficiency: primitives use less memory and provide faster access
  • Recognition that primitives cannot be null and have limited operations compared to objects
Object-Oriented Programming Concepts

What are the main principles of OOP?

What to Listen For:

  • Mention of all four pillars: Encapsulation, Abstraction, Inheritance, and Polymorphism
  • Brief explanation of each principle with practical understanding of their purpose
  • Ability to provide real-world examples or scenarios where each principle applies

What do you mean by data encapsulation?

What to Listen For:

  • Explanation of wrapping data and methods together in a single unit (class)
  • Understanding of data hiding using access modifiers like private
  • Recognition of benefits including security, modularity, and controlled access through getters/setters

Explain the concept of inheritance in Java

What to Listen For:

  • Clear explanation that inheritance allows a class to acquire properties and methods from another class
  • Understanding of parent-child relationship and code reusability benefits
  • Mention of extends keyword and that Java supports single inheritance for classes

What is the difference between an abstract class and an interface?

What to Listen For:

  • Knowledge that abstract classes can have both abstract and concrete methods, interfaces traditionally have only abstract methods
  • Understanding that a class can extend only one abstract class but implement multiple interfaces
  • Awareness of Java 8+ features: default and static methods in interfaces

What is polymorphism in Java?

What to Listen For:

  • Explanation that polymorphism allows objects to take multiple forms
  • Understanding of compile-time (method overloading) and runtime (method overriding) polymorphism
  • Recognition of how parent class references can refer to child class objects

Explain method overloading and method overriding

What to Listen For:

  • Clear distinction: overloading uses same method name with different parameters in same class, overriding redefines parent method in child class
  • Understanding that overloading is compile-time polymorphism, overriding is runtime polymorphism
  • Knowledge of @Override annotation and rules for overriding (same signature, return type compatibility)

What is the purpose of the super keyword?

What to Listen For:

  • Explanation that super refers to parent class objects and accesses parent class members
  • Understanding that super() calls parent constructor and must be first statement in child constructor
  • Recognition that super cannot be used with this() in the same constructor

What is the 'IS-A' relationship in Java?

What to Listen For:

  • Explanation that IS-A represents inheritance relationship between classes
  • Understanding through examples like "Dog IS-A Animal" or "Car IS-A Vehicle"
  • Recognition that IS-A enables polymorphism and code reusability

What is the difference between Composition and Aggregation?

What to Listen For:

  • Understanding that both represent HAS-A relationships but differ in dependency strength
  • Explanation that composition has strong ownership (contained object dies with container) while aggregation has weak association
  • Ability to provide examples like University-Department (composition) vs Department-Professor (aggregation)

Why is inheritance less advantageous than composition?

What to Listen For:

  • Recognition that composition provides loose coupling while inheritance creates tight coupling
  • Understanding that Java doesn't support multiple inheritance but composition allows multiple functionalities
  • Awareness that composition enables easier testing through dependency injection and mocking
String Handling

What is the difference between String, StringBuilder, and StringBuffer?

What to Listen For:

  • Clear understanding that String is immutable while StringBuilder and StringBuffer are mutable
  • Knowledge that StringBuffer is thread-safe (synchronized) while StringBuilder is not
  • Practical guidance on when to use each: String for unchanging text, StringBuilder for single-threaded modifications, StringBuffer for multi-threaded scenarios

Why are strings immutable in Java?

What to Listen For:

  • Explanation of String pool optimization and memory efficiency through sharing
  • Understanding of thread safety benefits without external synchronization
  • Recognition of security advantages and safe usage as HashMap keys

What is the difference between equals() method and equality operator (==) in Java?

What to Listen For:

  • Clear explanation that == compares memory references while equals() compares content
  • Understanding of String pool behavior and how it affects == comparison results
  • Awareness that equals() can be overridden to define custom equality logic

How is creation of String using new() different from literal?

What to Listen For:

  • Explanation that literals use String pool for interning while new() creates objects in heap memory
  • Understanding that literals enable reference sharing for identical strings
  • Recognition that new() always creates a new object even if identical string exists

Why is character array preferred over string for storing confidential information?

What to Listen For:

  • Understanding that strings remain in memory until garbage collected, creating security risk
  • Explanation that character arrays can be explicitly cleared immediately after use
  • Awareness that string immutability prevents secure cleanup of sensitive data

Should String or StringBuffer be used when there are lot of updates required?

What to Listen For:

  • Clear recommendation to use StringBuffer (or StringBuilder) for frequent modifications
  • Understanding that String creates new objects for each modification, wasting memory
  • Recognition of performance benefits from mutable operations versus constant object creation
Exception Handling

What is exception handling in Java?

What to Listen For:

  • Explanation that exception handling manages runtime errors to maintain normal application flow
  • Understanding of try-catch-finally blocks and their roles in handling exceptions
  • Recognition that proper exception handling prevents application crashes and improves user experience

What is the difference between checked and unchecked exceptions?

What to Listen For:

  • Clear distinction that checked exceptions are verified at compile-time, unchecked at runtime
  • Understanding that checked exceptions must be caught or declared with throws keyword
  • Ability to provide examples: IOException (checked) vs NullPointerException (unchecked)

Can a single try block have multiple catch blocks?

What to Listen For:

  • Affirmative answer that multiple catch blocks can handle different exception types
  • Understanding that specific exceptions should be caught before general exceptions
  • Recognition that only the first matching catch block executes

What is the difference between throw and throws keywords?

What to Listen For:

  • Clear explanation that throw explicitly throws an exception while throws declares possible exceptions
  • Understanding that throw is used inside method body, throws in method signature
  • Recognition that throw accepts exception instance, throws accepts exception classes

What is the purpose of the finally block?

What to Listen For:

  • Explanation that finally block executes regardless of exception occurrence
  • Understanding its primary use for cleanup operations like closing resources
  • Awareness of rare cases when finally doesn't execute (System.exit() or JVM crash)

Will finally block execute if there is a return statement in try block?

What to Listen For:

  • Affirmative answer that finally executes even when try block contains return
  • Understanding that finally executes before the method actually returns
  • Awareness that if finally also has return, it overrides the try block's return value

Explain try-with-resources in Java

What to Listen For:

  • Explanation that try-with-resources automatically closes resources implementing AutoCloseable
  • Understanding that it simplifies resource management and prevents resource leaks
  • Recognition that resources are closed in reverse order of declaration

How do you create and throw custom exceptions?

What to Listen For:

  • Knowledge that custom exceptions extend Exception class or RuntimeException
  • Understanding of constructor implementation to pass error messages
  • Awareness of when custom exceptions provide value over standard exceptions

Is it mandatory for catch block to follow try block?

What to Listen For:

  • Understanding that try must be followed by either catch or finally block
  • Recognition that try-finally without catch is valid for cleanup without handling
  • Awareness that exceptions can be declared with throws instead of catching

How does exception propagation work in Java?

What to Listen For:

  • Explanation that uncaught exceptions propagate up the call stack to calling methods
  • Understanding that propagation continues until exception is caught or reaches main method
  • Recognition that if never caught, JVM terminates the program and prints stack trace
Collections Framework

What is the Java Collections Framework?

What to Listen For:

  • Explanation that it provides data structures like List, Set, Map for storing and manipulating groups of objects
  • Understanding of key interfaces and their common implementations
  • Recognition of benefits including standardization, performance, and reusability

What is the difference between ArrayList and LinkedList?

What to Listen For:

  • Clear explanation that ArrayList uses dynamic array while LinkedList uses doubly-linked list
  • Understanding that ArrayList provides faster random access, LinkedList faster insertions/deletions
  • Practical guidance on choosing based on use case: access patterns vs modification frequency

What is the difference between ArrayList and array?

What to Listen For:

  • Understanding that arrays have fixed size while ArrayList is dynamically resizable
  • Recognition that arrays can store primitives and objects, ArrayList only stores objects (with autoboxing)
  • Awareness that ArrayList provides utility methods like add(), remove(), contains() while arrays require manual operations

What is the difference between HashSet and TreeSet?

What to Listen For:

  • Explanation that HashSet uses hash table with no ordering, TreeSet uses tree structure with sorted ordering
  • Understanding of performance differences: HashSet O(1) operations, TreeSet O(log n) operations
  • Recognition that TreeSet requires elements to be comparable or provide custom comparator

What is the difference between HashMap and Hashtable?

What to Listen For:

  • Clear distinction that HashMap is not synchronized while Hashtable is synchronized
  • Understanding that HashMap allows one null key and multiple null values, Hashtable allows neither
  • Recognition that HashMap is generally preferred; use ConcurrentHashMap for thread-safe operations

How does HashMap work internally in Java?

What to Listen For:

  • Explanation of hash function, buckets, and how key-value pairs are stored using hashCode()
  • Understanding of collision handling through linked lists (or trees in Java 8+) when multiple keys hash to same bucket
  • Awareness of load factor (0.75 default) and rehashing when capacity threshold is reached

What is the difference between fail-fast and fail-safe iterators?

What to Listen For:

  • Explanation that fail-fast iterators throw ConcurrentModificationException when collection is modified during iteration
  • Understanding that fail-safe iterators work on cloned copy and don't throw exceptions
  • Examples: ArrayList/HashMap use fail-fast, CopyOnWriteArrayList/ConcurrentHashMap use fail-safe

What is the difference between Comparable and Comparator?

What to Listen For:

  • Understanding that Comparable provides natural ordering within the class, Comparator provides custom ordering externally
  • Recognition that Comparable has compareTo() method, Comparator has compare() method
  • Awareness that Comparator allows multiple sorting sequences while Comparable provides single natural ordering

Why is Map not part of the Collection interface hierarchy?

What to Listen For:

  • Explanation that Map stores key-value pairs while Collection stores single elements
  • Understanding that Map's fundamental operations differ from Collection's add/remove semantics
  • Recognition that Map provides keySet(), values(), and entrySet() views to integrate with Collection framework

What is the difference between Iterator and ListIterator?

What to Listen For:

  • Understanding that Iterator works with all collections, ListIterator only with List implementations
  • Recognition that ListIterator supports bidirectional traversal while Iterator only moves forward
  • Awareness that ListIterator provides add(), set() methods in addition to Iterator's remove()
Multithreading and Concurrency

What is multithreading in Java?

What to Listen For:

  • Explanation that multithreading enables concurrent execution of multiple parts of a program
  • Understanding of benefits including better CPU utilization, improved application responsiveness
  • Recognition that threads share process resources but execute independently

What is the difference between process and thread?

What to Listen For:

  • Clear explanation that process has separate memory space, threads share memory within same process
  • Understanding that processes are heavyweight with higher overhead, threads are lightweight
  • Recognition that inter-process communication is more complex than inter-thread communication

How can you create threads in Java?

What to Listen For:

  • Knowledge of two main approaches: extending Thread class or implementing Runnable interface
  • Understanding that implementing Runnable is preferred as it allows class to extend other classes
  • Awareness of modern alternatives like Callable, ExecutorService, and lambda expressions

What is the difference between Runnable and Callable?

What to Listen For:

  • Explanation that Runnable's run() returns void, Callable's call() returns a value
  • Understanding that Callable can throw checked exceptions, Runnable cannot
  • Recognition that Callable works with Future to retrieve results asynchronously

Explain the thread lifecycle in Java

What to Listen For:

  • Knowledge of all thread states: New, Runnable, Running, Blocked/Waiting, Terminated
  • Understanding of transitions between states and methods that trigger them (start(), sleep(), wait(), etc.)
  • Recognition that once terminated, a thread cannot be restarted

What is synchronization in Java?

What to Listen For:

  • Explanation that synchronization controls access to shared resources by multiple threads
  • Understanding of synchronized keyword for methods and blocks to prevent race conditions
  • Recognition that synchronization uses monitors/locks to ensure thread safety but may impact performance

What is the difference between wait() and sleep()?

What to Listen For:

  • Clear distinction that wait() releases lock, sleep() retains lock
  • Understanding that wait() is from Object class and used in synchronization, sleep() is from Thread class
  • Recognition that wait() must be called within synchronized context, sleep() can be called anywhere

What is a deadlock? How can you prevent it?

What to Listen For:

  • Explanation that deadlock occurs when threads wait indefinitely for locks held by each other
  • Understanding of four conditions: mutual exclusion, hold and wait, no preemption, circular wait
  • Knowledge of prevention strategies: lock ordering, timeouts, deadlock detection algorithms

What is the volatile keyword in Java?

What to Listen For:

  • Explanation that volatile ensures variable visibility across threads by preventing caching
  • Understanding that volatile reads/writes happen directly from main memory
  • Recognition that volatile doesn't guarantee atomicity for compound operations like increment

What is the difference between synchronized and volatile?

What to Listen For:

  • Understanding that synchronized provides both atomicity and visibility, volatile only visibility
  • Recognition that synchronized blocks thread execution, volatile doesn't block
  • Awareness that synchronized can be applied to methods/blocks, volatile only to variables

What is the ExecutorService framework?

What to Listen For:

  • Explanation that ExecutorService manages thread pool and task execution lifecycle
  • Understanding of benefits including thread reuse, resource management, and simplified concurrency
  • Knowledge of different executor types: FixedThreadPool, CachedThreadPool, ScheduledThreadPool
Java 8+ Features

What are lambda expressions in Java?

What to Listen For:

  • Explanation that lambdas provide concise syntax for implementing functional interfaces
  • Understanding of syntax: (parameters) -> expression or statement block
  • Recognition of benefits including reduced boilerplate code and enabling functional programming style

What is a functional interface?

What to Listen For:

  • Clear definition that functional interface has exactly one abstract method
  • Understanding of @FunctionalInterface annotation and its validation purpose
  • Awareness of common functional interfaces: Predicate, Function, Consumer, Supplier

What are Streams in Java 8?

What to Listen For:

  • Explanation that Streams provide functional approach to process collections of objects
  • Understanding of intermediate operations (filter, map) vs terminal operations (collect, forEach)
  • Recognition that Streams are lazy, don't modify source, and support parallel processing

What is the difference between map() and flatMap()?

What to Listen For:

  • Explanation that map() transforms each element to another object, flatMap() flattens nested structures
  • Understanding that map() produces Stream of objects, flatMap() produces flattened Stream
  • Practical example of using flatMap() to handle Stream of Collections or Optional

What is Optional in Java 8?

What to Listen For:

  • Explanation that Optional is a container object that may or may not contain a value
  • Understanding that it helps avoid NullPointerException and makes null handling explicit
  • Knowledge of methods like isPresent(), ifPresent(), orElse(), orElseGet(), orElseThrow()

What are default methods in interfaces?

What to Listen For:

  • Explanation that default methods provide implementation in interfaces without breaking existing implementations
  • Understanding that they enable interface evolution while maintaining backward compatibility
  • Recognition of potential diamond problem and how Java resolves it with explicit override

What is method reference in Java 8?

What to Listen For:

  • Explanation that method references provide shorthand syntax for lambda expressions that call existing methods
  • Understanding of four types: static, instance, constructor, arbitrary object method reference
  • Recognition of syntax using :: operator (e.g., ClassName::methodName)

What is the difference between intermediate and terminal operations in Streams?

What to Listen For:

  • Understanding that intermediate operations return Stream and are lazy (filter, map, sorted)
  • Recognition that terminal operations trigger processing and return non-Stream result (collect, forEach, reduce)
  • Awareness that Streams can have multiple intermediate but only one terminal operation

What is the Collectors class in Java 8?

What to Listen For:

  • Explanation that Collectors provide implementations of reduction operations for Streams
  • Knowledge of common collectors: toList(), toSet(), toMap(), groupingBy(), joining()
  • Understanding of advanced operations like partitioning, grouping, and downstream collectors

What are the new Date and Time APIs in Java 8?

What to Listen For:

  • Knowledge of main classes: LocalDate, LocalTime, LocalDateTime, ZonedDateTime, Instant
  • Understanding that new API is immutable, thread-safe, and addresses flaws in old Date/Calendar classes
  • Awareness of Period and Duration for date/time-based calculations
Memory Management and Garbage Collection

How does garbage collection work in Java?

What to Listen For:

  • Explanation that GC automatically identifies and removes unreferenced objects to free memory
  • Understanding of mark and sweep algorithm and generational garbage collection
  • Recognition that GC runs in background and cannot be forced explicitly (System.gc() is just a suggestion)

What are the different memory areas in JVM?

What to Listen For:

  • Knowledge of main areas: Heap, Stack, Method Area (Metaspace), Program Counter, Native Method Stack
  • Understanding that Heap stores objects, Stack stores method calls and local variables
  • Recognition of thread-specific (Stack) vs shared (Heap, Method Area) memory regions

What is the difference between stack and heap memory?

What to Listen For:

  • Clear explanation that Stack stores primitives and references in LIFO order, Heap stores objects
  • Understanding that Stack is thread-specific and faster, Heap is shared and managed by GC
  • Recognition that Stack has size limits leading to StackOverflowError, Heap can cause OutOfMemoryError

What is memory leak in Java? How can you prevent it?

What to Listen For:

  • Explanation that memory leak occurs when objects remain referenced but are no longer needed
  • Understanding of common causes: unclosed resources, static collections, listeners not removed
  • Knowledge of prevention: proper resource management, weak references, profiling tools

What are strong, soft, weak, and phantom references?

What to Listen For:

  • Understanding that strong references prevent GC, soft references collected when memory low
  • Recognition that weak references collected in next GC cycle, phantom references after finalization
  • Practical knowledge of use cases: caching (soft), WeakHashMap (weak), resource cleanup (phantom)

What is the finalize() method?

What to Listen For:

  • Explanation that finalize() is called by GC before object destruction for cleanup operations
  • Understanding that it's deprecated in Java 9+ and unreliable for resource management
  • Recognition that try-with-resources or explicit close() methods are preferred alternatives

What are the different types of garbage collectors?

What to Listen For:

  • Knowledge of major GC types: Serial, Parallel, CMS, G1, ZGC, Shenandoah
  • Understanding of trade-offs between throughput and pause times for different collectors
  • Awareness of when to use each collector based on application requirements

What is generational garbage collection?

What to Listen For:

  • Explanation that heap is divided into Young (Eden, Survivor) and Old generations
  • Understanding that most objects die young, so Young generation is collected more frequently
  • Recognition of Minor GC (Young) vs Major/Full GC (Old generation) and their performance implications
Advanced Java Topics

What is reflection in Java?

What to Listen For:

  • Explanation that reflection allows inspection and manipulation of classes, methods, and fields at runtime
  • Understanding of use cases: frameworks, serialization, testing, dependency injection
  • Awareness of drawbacks including performance overhead, security restrictions, and breaking encapsulation

What are annotations in Java?

What to Listen For:

  • Explanation that annotations provide metadata about code without affecting its execution
  • Knowledge of built-in annotations: @Override, @Deprecated, @SuppressWarnings, @FunctionalInterface
  • Understanding of retention policies (SOURCE, CLASS, RUNTIME) and how to create custom annotations

What is serialization and deserialization in Java?

What to Listen For:

  • Clear explanation that serialization converts object to byte stream, deserialization reverses the process
  • Understanding that classes must implement Serializable interface (marker interface)
  • Awareness of serialVersionUID, transient keyword, and security considerations

What is the transient keyword?

What to Listen For:

  • Explanation that transient prevents field serialization, excluding it from persistent state
  • Understanding of use cases: sensitive data, derived fields, non-serializable objects
  • Recognition that transient fields get default values upon deserialization

What is the difference between Serializable and Externalizable?

What to Listen For:

  • Understanding that Serializable uses automatic serialization, Externalizable requires manual implementation
  • Recognition that Externalizable provides complete control through writeExternal() and readExternal() methods
  • Awareness that Externalizable can offer better performance but requires more code

What is cloning in Java? What is the difference between shallow and deep copy?

What to Listen For:

  • Explanation that cloning creates object copy; shallow copy copies references, deep copy copies actual objects
  • Understanding that clone() method requires implementing Cloneable interface
  • Recognition of alternatives: copy constructors, serialization, or using libraries like Apache Commons

What are generics in Java? Why are they used?

What to Listen For:

  • Explanation that generics enable type-safe operations on classes, interfaces, and methods
  • Understanding of benefits: compile-time type checking, elimination of type casting, enabling generic algorithms
  • Knowledge of type parameters, bounded types, wildcards (?, extends, super)

What is type erasure in Java generics?

What to Listen For:

  • Explanation that compiler removes generic type information, replacing with Object or bounds at runtime
  • Understanding that this maintains backward compatibility with pre-generics code
  • Awareness of limitations: cannot create generic arrays, cannot use instanceof with parameterized types

What are enum types in Java?

What to Listen For:

  • Explanation that enums define fixed set of named constants in type-safe manner
  • Understanding that enums can have constructors, methods, and implement interfaces
  • Knowledge of built-in methods: values(), valueOf(), ordinal(), name()

What is the difference between static and instance inner classes?

What to Listen For:

  • Understanding that static nested classes don't have reference to outer class instance
  • Recognition that instance inner classes can access outer class members including private ones
  • Awareness of memory implications and when to use each type

What is the difference between ClassNotFoundException and NoClassDefFoundError?

What to Listen For:

  • Clear distinction that ClassNotFoundException is checked exception thrown by Class.forName() or ClassLoader
  • Understanding that NoClassDefFoundError is error occurring when class was present at compile-time but missing at runtime
  • Recognition of typical causes and troubleshooting approaches for each

What is the purpose of the strictfp keyword?

What to Listen For:

  • Explanation that strictfp ensures consistent floating-point calculations across platforms
  • Understanding that it restricts floating-point operations to IEEE 754 standard
  • Awareness that it's rarely needed in modern applications but important for scientific computing
Design Patterns and Best Practices

What is the Singleton design pattern? How do you implement it?

What to Listen For:

  • Explanation that Singleton ensures only one instance of class exists throughout application
  • Knowledge of implementation approaches: eager initialization, lazy initialization, thread-safe variations
  • Awareness of enum singleton as best practice and issues with reflection/serialization breaking singleton

What is the Factory design pattern?

What to Listen For:

  • Explanation that Factory pattern provides interface for creating objects without specifying exact class
  • Understanding of benefits: loose coupling, centralized object creation, easier testing
  • Recognition of real-world examples like Calendar.getInstance(), JDBC DriverManager

What is dependency injection?

What to Listen For:

  • Explanation that DI provides dependencies from outside rather than creating them internally
  • Understanding of three types: constructor injection, setter injection, interface injection
  • Recognition of benefits: loose coupling, easier testing, better maintainability

What are SOLID principles?

What to Listen For:

  • Knowledge of all five principles: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, Dependency Inversion
  • Ability to explain each principle with practical examples
  • Understanding of how SOLID principles lead to maintainable, flexible code

What is the difference between composition and inheritance?

What to Listen For:

  • Understanding that inheritance represents "is-a" relationship, composition represents "has-a"
  • Recognition that composition provides loose coupling and greater flexibility
  • Awareness of "favor composition over inheritance" principle and when to apply it

What are immutable classes? How do you create them?

What to Listen For:

  • Explanation that immutable objects cannot be modified after creation
  • Knowledge of requirements: final class, private final fields, no setters, defensive copying
  • Understanding of benefits: thread safety, caching, security, use as HashMap keys

What is the Builder design pattern?

What to Listen For:

  • Explanation that Builder separates complex object construction from representation
  • Understanding of use cases: objects with many optional parameters, immutable objects
  • Knowledge of implementation using fluent interface pattern for method chaining

What coding standards should Java developers follow?

What to Listen For:

  • Knowledge of naming conventions: classes (PascalCase), methods/variables (camelCase), constants (UPPER_CASE)
  • Understanding of code organization: package structure, class design, method size
  • Awareness of documentation, error handling, and performance best practices

How do you handle null values effectively?

What to Listen For:

  • Use of Optional class to make null handling explicit
  • Defensive programming: null checks, Objects.requireNonNull(), validation
  • Design approaches: null object pattern, avoiding null returns when possible

What is technical debt and how do you manage it?

What to Listen For:

  • Understanding that technical debt represents shortcuts taken that require future refactoring
  • Recognition of causes: time pressure, lack of knowledge, changing requirements
  • Strategies for management: continuous refactoring, code reviews, automated testing, documentation
Spring Framework

What is the Spring Framework?

What to Listen For:

  • Explanation that Spring is comprehensive framework for enterprise Java development
  • Understanding of core features: dependency injection, AOP, transaction management, MVC
  • Recognition of benefits: loose coupling, testability, modularity, integration with other frameworks

What is dependency injection in Spring?

What to Listen For:

  • Explanation that Spring container manages object creation and wiring of dependencies
  • Knowledge of injection types: constructor, setter, field injection and their trade-offs
  • Understanding of @Autowired, @Inject annotations and XML/Java configuration approaches

What is the difference between @Component, @Service, @Repository, and @Controller?

What to Listen For:

  • Understanding that all are specializations of @Component for different architectural layers
  • Recognition that @Service indicates business logic, @Repository for data access, @Controller for web layer
  • Awareness that @Repository provides additional exception translation for persistence

What are the different scopes of Spring beans?

What to Listen For:

  • Knowledge of scopes: singleton (default), prototype, request, session, application
  • Understanding that singleton creates one instance per container, prototype creates new instance per request
  • Recognition of web-specific scopes and when to use each scope

What is Spring Boot? How is it different from Spring Framework?

What to Listen For:

  • Explanation that Spring Boot provides auto-configuration and convention over configuration
  • Understanding of features: embedded servers, starter dependencies, production-ready metrics
  • Recognition that Spring Boot simplifies Spring application development and deployment

What is Spring AOP? What are cross-cutting concerns?

What to Listen For:

  • Explanation that AOP separates cross-cutting concerns from business logic
  • Understanding of concepts: aspect, advice, pointcut, join point, weaving
  • Examples of cross-cutting concerns: logging, security, transaction management, caching

What is the difference between @Bean and @Component?

What to Listen For:

  • Understanding that @Component is class-level annotation for auto-detection, @Bean is method-level for explicit configuration
  • Recognition that @Bean gives more control and is used for third-party classes
  • Awareness that @Component works with component scanning, @Bean with @Configuration classes

What is Spring Data JPA?

What to Listen For:

  • Explanation that Spring Data JPA simplifies data access layer implementation
  • Understanding of repository interfaces and query derivation from method names
  • Knowledge of @Entity, @Id, @GeneratedValue, @OneToMany, @ManyToOne annotations

What is the difference between @RequestParam and @PathVariable?

What to Listen For:

  • Clear explanation that @PathVariable extracts values from URI path, @RequestParam from query string
  • Understanding of use cases: RESTful resource identifiers vs optional filtering parameters
  • Examples: /users/{id} uses @PathVariable, /users?status=active uses @RequestParam

How does Spring handle transactions?

What to Listen For:

  • Explanation of @Transactional annotation for declarative transaction management
  • Understanding of transaction propagation levels (REQUIRED, REQUIRES_NEW, etc.)
  • Knowledge of isolation levels, rollback rules, and transaction boundaries
Testing

What is unit testing? Why is it important?

What to Listen For:

  • Explanation that unit testing validates individual components in isolation
  • Understanding of benefits: early bug detection, documentation, refactoring confidence, design improvement
  • Recognition of characteristics: fast execution, independent, repeatable, self-validating

What is JUnit? How do you write unit tests?

What to Listen For:

  • Knowledge that JUnit is the standard testing framework for Java
  • Understanding of annotations: @Test, @Before/@BeforeEach, @After/@AfterEach, @BeforeClass/@BeforeAll
  • Awareness of assertions: assertEquals, assertTrue, assertThrows, assertAll

What is the difference between JUnit 4 and JUnit 5?

What to Listen For:

  • Understanding of JUnit 5 architecture: Platform, Jupiter, Vintage modules
  • Knowledge of new features: @DisplayName, @Nested, @ParameterizedTest, assertThrows
  • Recognition of annotation changes: @Before to @BeforeEach, @BeforeClass to @BeforeAll

What is mocking? What is Mockito?

What to Listen For:

  • Explanation that mocking creates test doubles for dependencies to isolate unit under test
  • Understanding that Mockito is popular mocking framework for Java
  • Knowledge of key methods: mock(), when(), thenReturn(), verify(), @Mock, @InjectMocks

What is the difference between mock, stub, and spy?

What to Listen For:

  • Understanding that mocks verify interactions, stubs provide predefined responses
  • Recognition that spies are partial mocks that wrap real objects
  • Knowledge of when to use each: mocks for behavior verification, stubs for state-based testing

What is integration testing?

What to Listen For:

  • Explanation that integration testing verifies interactions between multiple components
  • Understanding of scope: testing database interactions, external APIs, message queues
  • Awareness of tools: @SpringBootTest, TestContainers, embedded databases

What is Test-Driven Development (TDD)?

What to Listen For:

  • Explanation of Red-Green-Refactor cycle: write failing test, make it pass, improve code
  • Understanding of benefits: better design, high test coverage, working documentation
  • Recognition of challenges and when TDD is most effective

What is code coverage and why is it important?

What to Listen For:

  • Explanation that code coverage measures percentage of code executed during tests
  • Understanding of different metrics: line coverage, branch coverage, method coverage
  • Recognition that high coverage doesn't guarantee quality but indicates untested code areas

What tools do you use for code quality and static analysis?

What to Listen For:

  • Knowledge of tools: SonarQube, Checkstyle, PMD, FindBugs/SpotBugs, JaCoCo
  • Understanding that these tools identify bugs, code smells, security vulnerabilities
  • Awareness of integration into CI/CD pipelines for continuous quality monitoring

How do you test RESTful APIs?

What to Listen For:

  • Knowledge of tools: MockMvc, RestAssured, Postman, REST-assured
  • Understanding of testing aspects: status codes, response bodies, headers, error handling
  • Awareness of @WebMvcTest, @MockBean annotations for Spring REST controller testing
Performance Optimization

How do you identify performance bottlenecks in Java applications?

What to Listen For:

  • Knowledge of profiling tools: JProfiler, YourKit, VisualVM, Java Mission Control
  • Understanding of metrics to monitor: CPU usage, memory consumption, thread activity, GC behavior
  • Awareness of APM tools: New Relic, AppDynamics, Dynatrace for production monitoring

What are common performance optimization techniques?

What to Listen For:

  • Algorithm optimization: choosing appropriate data structures, reducing time complexity
  • Memory management: object pooling, proper collection sizing, avoiding memory leaks
  • Concurrency: parallel processing, async operations, proper thread pool configuration

How does caching improve performance? What caching strategies do you know?

What to Listen For:

  • Understanding that caching stores frequently accessed data to reduce expensive operations
  • Knowledge of strategies: cache-aside, read-through, write-through, write-behind
  • Awareness of tools: Ehcache, Redis, Caffeine, Spring Cache abstraction

What is lazy loading and eager loading?

What to Listen For:

  • Explanation that lazy loading defers initialization until needed, eager loading loads immediately
  • Understanding of trade-offs: memory usage vs initial load time, N+1 query problem
  • Context of JPA relationships: @OneToMany(fetch = FetchType.LAZY/EAGER)

How do you optimize database queries?

What to Listen For:

  • Use of proper indexing, avoiding SELECT *, using pagination for large result sets
  • Understanding of query optimization: EXPLAIN plans, avoiding N+1 queries, batch operations
  • Knowledge of connection pooling (HikariCP), statement caching, prepared statements

What is the N+1 query problem? How do you solve it?

What to Listen For:

  • Explanation that N+1 occurs when fetching parent entities triggers separate queries for each child
  • Understanding of solutions: JOIN FETCH, @EntityGraph, batch fetching
  • Awareness of detection methods: query logging, Hibernate statistics

What are best practices for String concatenation in loops?

What to Listen For:

  • Recognition that using + operator in loops creates many temporary String objects
  • Recommendation to use StringBuilder or StringBuffer for better performance
  • Understanding that Java compiler optimizes + operator outside loops but not inside

How do you tune JVM for better performance?

What to Listen For:

  • Knowledge of heap size tuning: -Xms (initial), -Xmx (maximum), -XX:MaxMetaspaceSize
  • Understanding of GC tuning: selecting appropriate collector, adjusting generation sizes
  • Awareness of JVM flags for monitoring and optimization: -XX:+PrintGCDetails, -XX:+UseG1GC
Security

What are common security vulnerabilities in Java applications?

What to Listen For:

  • Knowledge of OWASP Top 10: SQL injection, XSS, CSRF, authentication issues, sensitive data exposure
  • Understanding of deserialization vulnerabilities and remote code execution risks
  • Awareness of dependency vulnerabilities and importance of keeping libraries updated

How do you prevent SQL injection?

What to Listen For:

  • Primary defense: use PreparedStatement with parameterized queries instead of concatenating SQL
  • Understanding that ORMs like Hibernate provide protection when used correctly
  • Additional measures: input validation, principle of least privilege for database accounts

What is Cross-Site Scripting (XSS)? How do you prevent it?

What to Listen For:

  • Explanation that XSS allows attackers to inject malicious scripts into web pages
  • Understanding of prevention: output encoding/escaping, Content Security Policy headers
  • Knowledge of libraries: OWASP Java Encoder, framework built-in protections (Spring Security)

What is CSRF? How does Spring Security protect against it?

What to Listen For:

  • Explanation that CSRF tricks authenticated users into executing unwanted actions
  • Understanding that Spring Security uses synchronizer token pattern by default
  • Knowledge of CSRF token inclusion in forms and AJAX requests

How do you securely store passwords?

What to Listen For:

  • Understanding that passwords must be hashed using strong algorithms like BCrypt, SCrypt, or Argon2
  • Recognition that salting prevents rainbow table attacks
  • Awareness that plain text or simple hashing (MD5, SHA1) is inadequate for passwords

What is JWT? How does it work?

What to Listen For:

  • Explanation that JWT is self-contained token for stateless authentication
  • Understanding of structure: header, payload, signature and their purposes
  • Knowledge of security considerations: HTTPS requirement, token expiration, secret key management

What is OAuth 2.0?

What to Listen For:

  • Explanation that OAuth 2.0 is authorization framework for delegated access
  • Understanding of roles: resource owner, client, authorization server, resource server
  • Knowledge of grant types: authorization code, client credentials, password, implicit

How do you handle sensitive data in application properties?

What to Listen For:

  • Understanding that secrets should never be committed to version control
  • Knowledge of solutions: environment variables, secret management tools (Vault, AWS Secrets Manager)
  • Awareness of Spring Cloud Config encryption capabilities

What is role-based access control (RBAC)?

What to Listen For:

  • Explanation that RBAC assigns permissions based on user roles
  • Understanding of implementation in Spring Security: @PreAuthorize, @Secured annotations
  • Recognition of benefits: simplified permission management, principle of least privilege
Database and JPA/Hibernate

What is ORM? What are its advantages?

What to Listen For:

  • Explanation that ORM maps objects to database tables, eliminating manual SQL writing
  • Understanding of benefits: productivity, database independence, maintainability
  • Awareness of trade-offs: learning curve, potential performance issues, less control

What is the difference between JPA and Hibernate?

What to Listen For:

  • Clear understanding that JPA is specification/interface, Hibernate is implementation
  • Recognition that Hibernate provides additional features beyond JPA standard
  • Awareness of other JPA implementations: EclipseLink, OpenJPA

What is the difference between EntityManager and SessionFactory?

What to Listen For:

  • Understanding that EntityManager is JPA standard API, SessionFactory is Hibernate-specific
  • Recognition that EntityManager provides persistence context for entity operations
  • Awareness that SessionFactory is thread-safe factory for Session instances

Explain the different states of entity lifecycle in JPA

What to Listen For:

  • Knowledge of four states: Transient, Persistent/Managed, Detached, Removed
  • Understanding of transitions: persist(), merge(), remove(), detach(), clear()
  • Recognition that only persistent entities are tracked for changes

What is the first-level cache and second-level cache in Hibernate?

What to Listen For:

  • Explanation that first-level cache is session-scoped and mandatory
  • Understanding that second-level cache is SessionFactory-scoped and optional
  • Knowledge of cache providers: Ehcache, Infinispan, Hazelcast

What are the different types of relationships in JPA?

What to Listen For:

  • Knowledge of all relationship types: @OneToOne, @OneToMany, @ManyToOne, @ManyToMany
  • Understanding of bidirectional vs unidirectional relationships
  • Awareness of cascade types and orphan removal

What is the difference between save() and persist() in Hibernate?

What to Listen For:

  • Understanding that persist() is JPA standard method, save() is Hibernate-specific
  • Recognition that save() returns generated identifier, persist() returns void
  • Awareness that persist() should be used inside transaction boundaries

What is the difference between get() and load() methods?

What to Listen For:

  • Understanding that get() hits database immediately, load() returns proxy (lazy loading)
  • Recognition that get() returns null if not found, load() throws ObjectNotFoundException
  • Awareness that load() is preferred when you're sure entity exists

What is JPQL? How is it different from SQL?

What to Listen For:

  • Explanation that JPQL queries entities and their properties rather than database tables
  • Understanding that JPQL is database-independent and object-oriented
  • Knowledge of syntax differences: entity names instead of table names, property paths

What are named queries in JPA?

What to Listen For:

  • Explanation that named queries are pre-defined, reusable JPQL queries
  • Understanding of benefits: validation at startup, performance optimization through pre-compilation
  • Knowledge of @NamedQuery annotation and usage pattern
Microservices and Cloud

What are microservices? What are their advantages and disadvantages?

What to Listen For:

  • Explanation that microservices are independently deployable services focused on specific business capabilities
  • Understanding of advantages: scalability, technology diversity, fault isolation, faster deployment
  • Awareness of challenges: distributed complexity, data consistency, testing difficulty, operational overhead

What is REST? What are RESTful principles?

What to Listen For:

  • Understanding of REST constraints: client-server, stateless, cacheable, uniform interface, layered system
  • Knowledge of HTTP methods: GET, POST, PUT, DELETE, PATCH and their semantics
  • Recognition of resource-oriented design and proper use of status codes

What is the difference between PUT and PATCH?

What to Listen For:

  • Clear explanation that PUT replaces entire resource, PATCH applies partial modifications
  • Understanding that PUT is idempotent, PATCH may or may not be
  • Practical guidance on when to use each method

What is service discovery in microservices?

What to Listen For:

  • Explanation that service discovery enables services to find and communicate with each other dynamically
  • Knowledge of patterns: client-side discovery (Eureka, Consul) vs server-side (load balancer)
  • Understanding of service registration and health checks

What is an API Gateway?

What to Listen For:

  • Explanation that API Gateway is single entry point for all client requests
  • Understanding of responsibilities: routing, authentication, rate limiting, request/response transformation
  • Knowledge of tools: Spring Cloud Gateway, Netflix Zuul, Kong

What is circuit breaker pattern?

What to Listen For:

  • Explanation that circuit breaker prevents cascading failures by stopping calls to failing services
  • Understanding of states: Closed, Open, Half-Open and transitions between them
  • Knowledge of implementations: Resilience4j, Hystrix (deprecated), Spring Cloud Circuit Breaker

How do you handle distributed transactions in microservices?

What to Listen For:

  • Understanding that traditional ACID transactions don't work well in distributed systems
  • Knowledge of patterns: Saga pattern (choreography or orchestration), eventual consistency
  • Awareness of compensating transactions for handling failures

What is Docker? How does containerization help?

What to Listen For:

  • Explanation that Docker packages applications with dependencies into containers
  • Understanding of benefits: consistency across environments, isolation, efficient resource usage
  • Knowledge of Dockerfile, images, containers, volumes, networks

What is Kubernetes? Why is it used?

What to Listen For:

  • Explanation that Kubernetes orchestrates container deployment, scaling, and management
  • Understanding of core concepts: Pods, Services, Deployments, ReplicaSets, ConfigMaps
  • Recognition of benefits: auto-scaling, self-healing, load balancing, rolling updates

What is the difference between monolithic and microservices architecture?

What to Listen For:

  • Clear understanding that monolithic is single deployable unit, microservices are multiple independent services
  • Recognition of trade-offs: simplicity vs scalability, consistency vs flexibility
  • Practical guidance on when each architecture is appropriate
Messaging and Event-Driven Architecture

What is message queue? What are its benefits?

What to Listen For:

  • Explanation that message queue enables asynchronous communication between services
  • Understanding of benefits: decoupling, reliability, scalability, load leveling
  • Knowledge of popular solutions: RabbitMQ, Apache Kafka, Amazon SQS, ActiveMQ

What is the difference between JMS and AMQP?

What to Listen For:

  • Understanding that JMS is Java API specification, AMQP is wire-level protocol
  • Recognition that AMQP is language-agnostic while JMS is Java-specific
  • Awareness of implementations: ActiveMQ supports both, RabbitMQ is AMQP-native

What is Apache Kafka? How does it work?

What to Listen For:

  • Explanation that Kafka is distributed streaming platform for high-throughput event processing
  • Understanding of concepts: topics, partitions, producers, consumers, consumer groups
  • Recognition of use cases: event sourcing, log aggregation, real-time analytics

What is event-driven architecture?

What to Listen For:

  • Explanation that systems react to events rather than direct requests
  • Understanding of patterns: pub-sub, event sourcing, CQRS
  • Recognition of benefits: loose coupling, scalability, real-time processing

What is the difference between synchronous and asynchronous communication?

What to Listen For:

  • Clear distinction that synchronous blocks until response received, asynchronous doesn't wait
  • Understanding of trade-offs: simplicity vs resilience, consistency vs availability
  • Examples: REST/gRPC for sync, message queues/events for async

What is CQRS pattern?

What to Listen For:

  • Explanation that CQRS separates read and write operations into different models
  • Understanding of benefits: optimized queries, independent scaling, better performance
  • Awareness of complexity and eventual consistency challenges
Build Tools and DevOps

What is Maven? How does it work?

What to Listen For:

  • Explanation that Maven is build automation and dependency management tool
  • Understanding of POM.xml structure, dependency coordinates (groupId, artifactId, version)
  • Knowledge of build lifecycle phases: compile, test, package, install, deploy

What is the difference between Maven and Gradle?

What to Listen For:

  • Understanding that Maven uses XML configuration, Gradle uses Groovy/Kotlin DSL
  • Recognition that Gradle is more flexible and generally faster with incremental builds
  • Awareness that Maven has larger ecosystem and more widespread adoption

What is CI/CD? Why is it important?

What to Listen For:

  • Explanation that CI automates integration and testing, CD automates deployment
  • Understanding of benefits: faster feedback, reduced risk, consistent deployments
  • Knowledge of tools: Jenkins, GitLab CI, GitHub Actions, CircleCI, Azure DevOps

What is Git? What are basic Git commands?

What to Listen For:

  • Understanding that Git is distributed version control system
  • Knowledge of commands: clone, pull, push, commit, branch, merge, rebase, checkout
  • Awareness of branching strategies: Git Flow, GitHub Flow, trunk-based development

What is the difference between merge and rebase?

What to Listen For:

  • Explanation that merge preserves history with merge commit, rebase rewrites history linearly
  • Understanding of when to use each: merge for feature branches, rebase for keeping clean history
  • Awareness of golden rule: never rebase public/shared branches

What is infrastructure as code?

What to Listen For:

  • Explanation that IaC manages infrastructure through code rather than manual processes
  • Knowledge of tools: Terraform, CloudFormation, Ansible, Puppet, Chef
  • Understanding of benefits: version control, consistency, repeatability, automation

What is logging? What logging frameworks do you know?

What to Listen For:

  • Knowledge of frameworks: SLF4J (facade), Logback, Log4j2, java.util.logging
  • Understanding of log levels: TRACE, DEBUG, INFO, WARN, ERROR
  • Best practices: structured logging, correlation IDs, appropriate log levels, avoid sensitive data

What is monitoring and observability?

What to Listen For:

  • Understanding of three pillars: logs, metrics, traces
  • Knowledge of tools: Prometheus, Grafana, ELK Stack, Jaeger, Zipkin, Datadog
  • Recognition that observability helps understand system behavior and troubleshoot issues
Start Here
Get Java Developer Job Description Template
Create a compelling java developer job posting before you start interviewing

How X0PA AI Helps You Hire Java Developer

Hiring Java Developers shouldn't mean spending weeks screening resumes, conducting endless interviews, and still ending up with someone who leaves in 6 months.

X0PA AI uses predictive analytics across 6 key hiring stages, from job posting to assessment to find candidates who have the skills to succeed and the traits to stay.

Job Description Creation

Multi-Channel Sourcing

AI-Powered Screening

Candidate Assessment

Process Analytics

Agentic AI