Java Rapid-Fire Questions & Answers
50 questions for the rapid-fire stage — 32 easy, 17 medium, 1 hard.
About the rapid-fire round
Rapid-fire questions are quick definitions and one-line answers that interviewers fire at the start or end of a round to check your Java basics. Aim to answer each in under 20 seconds.
Tips for the rapid-fire round
- Answer in one or two sentences, then stop.
- If you don't know, say so quickly and move on; don't guess at length.
- Revise these the morning of the interview.
- Practise with a friend who reads them in random order.
What is constructor chaining?
Show answer
What is the difference between composition and inheritance, and which should you prefer?
Show answer
Why are String objects immutable in Java?
Show answer
What are virtual threads and when should you use them?
Show answer
What is the difference between static and dynamic binding?
Show answer
What is the difference between == and equals() in Java?
Show answer
What is the difference between a static and an instance variable?
Show answer
How does ExecutorService work and why use a thread pool?
Show answer
What is the difference between method overloading and method overriding?
Show answer
What is the difference between ArrayList and LinkedList?
Show answer
Compare String, StringBuilder and StringBuffer.
Show answer
What are the four pillars of OOP? Explain with Java examples.
Show answer
What are fail-fast and fail-safe iterators?
Show answer
What are the ways to create a thread in Java?
Show answer
What is Spring Boot and how is it different from the Spring Framework?
Show answer
Can you override a static or private method in Java?
Show answer
What is the difference between @Component, @Service, @Repository and @Controller?
Show answer
What are text blocks in Java?
Show answer
Is it good practice to catch Exception or Throwable?
Show answer
Why does Java not support multiple inheritance of classes?
Show answer
What is the difference between checked and unchecked exceptions?
Show answer
Compare the G1, ZGC and Parallel garbage collectors.
Show answer
When would you choose ArrayDeque over Stack and LinkedList?
Show answer
What is the difference between JDK, JRE and JVM?
Show answer
What is the difference between wait() and sleep()?
Show answer
What is a ClassLoader and what is the delegation model?
Show answer
How do you create a custom exception and when should you?
Show answer
What are the primitive data types in Java and their sizes?
Show answer
What is the difference between map() and flatMap()?
Show answer
Why is PreparedStatement preferred over Statement?
Show answer
What is the difference between final, finally and finalize?
Show answer
What is a functional interface?
Show answer
Explain the hierarchy of the Java Collections Framework.
Show answer
What is the difference between JPA, Hibernate and Spring Data JPA?
Show answer
Does the finally block always execute?
Show answer
What is the difference between lazy and eager loading?
Show answer
Why is the main method public static void?
Show answer
What are the main steps to connect to a database with JDBC?
Show answer
How does HashMap work internally?
Show answer
What is the difference between throw and throws?
Show answer
What is the difference between Comparable and Comparator?
Show answer
What does the volatile keyword guarantee?
Show answer
What is the difference between HashMap, LinkedHashMap and TreeMap?
Show answer
What does the var keyword do and where can it not be used?
Show answer
What is the N+1 select problem in Hibernate and how do you fix it?
Show answer
Why is Java called platform independent?
Show answer
Explain the entity lifecycle states in JPA.
Show answer
Explain the main memory areas of the JVM.
Show answer
What is the difference between synchronized and ReentrantLock?
Show answer
Frequently asked questions
What happens in the Java rapid-fire round?
Rapid-fire questions are quick definitions and one-line answers that interviewers fire at the start or end of a round to check your Java basics. Aim to answer each in under 20 seconds.
How do I clear the rapid-fire round?
Answer in one or two sentences, then stop. If you don't know, say so quickly and move on; don't guess at length. Revise these the morning of the interview.
Which round comes next?
A typical order is online assessment, telephonic screening, one or two technical rounds, a managerial round and HR. Use the other round pages to practise each stage.