Java Online Assessment Questions & Answers
40 questions for the online assessment stage — 23 easy, 16 medium, 1 hard.
About the online assessment round
Most companies start with an online test: aptitude and reasoning, a few MCQs on core Java concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
Tips for the online assessment round
- Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task.
- Read every option before answering; tests often include two nearly correct choices.
- Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
- Attempt the questions you are sure about first, then return to the harder ones.
What are the four pillars of OOP? Explain with Java examples.
Show answer
What is the difference between Comparable and Comparator?
Show answer
What does the var keyword do and where can it not be used?
Show answer
What are text blocks in Java?
Show answer
What is the String constant pool?
Show answer
Implement an LRU cache using LinkedHashMap.
Show answer
Find the second highest salary from a list of employees using streams.
Show answer
Your application hangs and CPU is near zero. How do you find out why?
Show answer
What is the difference between checked and unchecked exceptions?
Show answer
Write code to check if two strings are anagrams.
Show answer
A log file shows a NullPointerException only for some users. How do you debug it?
Show answer
Can you override a static or private method in Java?
Show answer
What is garbage collection and how does the JVM decide an object is garbage?
Show answer
Explain the hierarchy of the Java Collections Framework.
Show answer
Write a stream to partition numbers into even and odd lists.
Show answer
What is Spring Boot and how is it different from the Spring Framework?
Show answer
A team member chains Optional.get() everywhere and gets NoSuchElementException. What do you suggest?
Show answer
Write a record with validation in its compact constructor.
Show answer
Implement the Builder pattern for a User class with many optional fields.
Show answer
What is the difference between JDK, JRE and JVM?
Show answer
What is a ClassLoader and what is the delegation model?
Show answer
What is the difference between JPA, Hibernate and Spring Data JPA?
Show answer
Write a JDBC batch insert for a list of products.
Show answer
A getter returns an internal List and callers modify it, causing bugs. How do you fix this?
Show answer
Exceptions are being swallowed with empty catch blocks in your codebase. How would you fix this?
Show answer
Why is Java called platform independent?
Show answer
What is Spring Boot Actuator used for?
Show answer
Why are String objects immutable in Java?
Show answer
Remove duplicates from a list while keeping the original order.
Show answer
What is the difference between ArrayList and LinkedList?
Show answer
How does Spring Boot auto-configuration work?
Show answer
What is the contract between equals() and hashCode()?
Show answer
Compare String, StringBuilder and StringBuffer.
Show answer
You have to process tasks in order of priority. Which collection do you use?
Show answer
What is the difference between method overloading and method overriding?
Show answer
Group a list of orders by city and sum the amount per city.
Show answer
Why is the main method public static void?
Show answer
Count the frequency of each character in a string using Java.
Show answer
Does the finally block always execute?
Show answer
Frequently asked questions
What happens in the Java online assessment round?
Most companies start with an online test: aptitude and reasoning, a few MCQs on core Java concepts, and one or two short hands-on tasks. It filters a large number of applicants, so speed and accuracy both count.
How do I clear the online assessment round?
Practise under a timer: about one minute per MCQ and 15-20 minutes per hands-on task. Read every option before answering; tests often include two nearly correct choices. Use a stable internet connection, keep your camera on and avoid switching tabs in proctored tests.
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.