Search test library by skills or roles
⌘ K

Java & Spring Online Test

The Java Spring Test uses scenario-based MCQs to evaluate candidates' ability to work with Spring modules, such as Core, MVC, Security, and Boot, as well as their understanding of dependency injection, AOP, RESTful web services, and database integration. Other key skills evaluated include object-oriented programming, design patterns, testing, debugging, and software architecture. The test also includes a coding question to test for hands-on Java programming skills.

Covered skills:

  • Java syntax and basics
  • Java OOPs
  • Working with Databases in Java
  • Java data structures
  • Basics of Spring framework
  • Spring bean lifecycle
  • Securing web applications with Spring Security
  • Java Programming
Get started for free
Preview questions

About the Java & Spring Test


The Java & Spring Online Test helps recruiters and hiring managers identify qualified candidates from a pool of resumes, and helps in taking objective hiring decisions. It reduces the administrative overhead of interviewing too many candidates and saves time by filtering out unqualified candidates at the first step of the hiring process.

The test screens for the following skills that hiring managers look for in candidates:

  • Proficient in Java syntax and basics
  • Strong understanding of Java OOPs concepts
  • Experience in working with Databases in Java
  • Knowledge of Java data structures
  • Familiarity with basics of Spring framework
  • Understanding of Spring bean lifecycle
  • Ability to secure web applications with Spring Security
  • Proficient in Java programming
  • Efficient exception handling
  • Strong problem-solving skills

1200+ customers in 80 countries


Use Adaface tests trusted by recruitment teams globally. Adaface skill assessments measure on-the-job skills of candidates, providing employers with an accurate tool for screening potential hires.

customers in 75 countries
Get started for free
Preview questions

Non-googleable questions


We have a very high focus on the quality of questions that test for on-the-job skills. Every question is non-googleable and we have a very high bar for the level of subject matter experts we onboard to create these questions. We have crawlers to check if any of the questions are leaked online. If/ when a question gets leaked, we get an alert. We change the question for you & let you know.

How we design questions

These are just a small sample from our library of 15,000+ questions. The actual questions on this Java & Spring Test will be non-googleable.

🧐 Question

Easy

Custom Exception
Exception Handling
Custom Exceptions
Solve
What does the following code output?
 image

Hard

Holding References
Solve
What does the following Java code output?
 image

Medium

Abstract Interface
OOPs
Interfaces
Java Syntax
Object-oriented Programming (Oop) Concepts
Solve
Given following interface:
 image
Which of these are correct classes?
 image

Medium

Garbage Collection
Garbage Collection
Garbage_collection_rules
Object_reachability
Solve
After which line is "bs" object, created on Line 4, eligible for garbage collection?
 image

Hard

Static Init Blocks
OOPs
Java Syntax
Code Execution Output
Solve
What does the following code output?
 image
1) G A B E D H
2) G B A D E H
3) G B A D E H C F
4) C F G A B E D H
5) C F G B A D E H
6) G C F A B E D H
7) G C F B A D E H

Medium

Autowiring Service
Spring Component Autowiring Behavior
Bean Injection
Solve
Review the following two Spring components- SampleA and SampleB:
 image
 image
Notice @Autowired line added to SampleService in SampleB (rest of the code is same for both components). What happens when the components are run as a @SpringBootApplication?
A: SampleA prints true null
B: SampleA prints true class package.SampleService
C: SampleA throws a null pointer exception
D: SampleA prints false null

E: SampleB prints true null
F: SampleB prints true class package.SampleService
G: SampleB throws a null pointer exception
H: SampleB prints false null

Medium

Bean init and afterPropertiesSet
Beans
Solve
Spring allows specific operations to be performed after the bean is initialized and before the bean is destroyed. Review the following sample Bean that implements init method and overrides afterPropertiesSet. 
 image
Here’s the bean definition added to the configuration file:
 image
What does the code print when the Spring container is started?

Medium

Boot Autowiring
Spring Boot
Spring Bean Management
Autowiring
Context Awareness
Solve
Review the following Spring Boot application code:
 image
Here are two possible SampleConfig class definitions:
 image
When the code is run as @SpringBootApplication, what would happen?

A: Using X as SampleConfig will print- true SimpleDateFormat
B: Using X as SampleConfig will print - true class java.text.SimpleDateFormat
C: Using X as SampleConfig will print a NullPointerException stacktrace
D: Using X as SampleConfig will print a BeanDefinitionParsingException stacktrace

E: Using Y as SampleConfig will print- true SimpleDateFormat
F: Using Y as SampleConfig will print - true class java.text.SimpleDateFormat
G: Using Y as SampleConfig will print a NullPointerException stacktrace
H: Using Y as SampleConfig will print a BeanDefinitionParsingException stacktrace

Easy

Registration Queue
Logic
Queues
Sorting By Custom Order
Solve
We want to register students for the next semester. All students have a receipt which shows the amount pending for the previous semester. A positive amount (or zero) represents that the student has paid extra fees, and a negative amount represents that they have pending fees to be paid. The students are in a queue for the registration. We want to arrange the students in a way such that the students who have a positive amount on the receipt get registered first as compared to the students who have a negative amount. We are given a queue in the form of an array containing the pending amount.
For example, if the initial queue is [20, 70, -40, 30, -10], then the final queue will be [20, 70, 30, -40, -10]. Note that the sequence of students should not be changed while arranging them unless required to meet the condition.
⚠️⚠️⚠️ Note:
- The first line of the input is the length of the array. The second line contains all the elements of the array.
- The input is already parsed into an array of "strings" and passed to a function. You will need to convert string to integer/number type inside the function.
- You need to "print" the final result (not return it) to pass the test cases.

For the example discussed above, the input will be:
5
20 70 -40 30 -10

Your code needs to print the following to the standard output:
20 70 30 -40 -10

Medium

Visitors Count
Strings
Logic
String Parsing
Character Counting
Solve
A manager hires a staff member to keep a record of the number of men, women, and children visiting the museum daily. The staff will note W if any women visit, M for men, and C for children. You need to write code that takes the string that represents the visits and prints the count of men, woman and children. The sequencing should be in decreasing order. 
Example:

Input:
WWMMWWCCC

Expected Output: 
4W3C2M

Explanation: 
‘W’ has the highest count, then ‘C’, then ‘M’. 
⚠️⚠️⚠️ Note:
- The input is already parsed and passed to a function.
- You need to "print" the final result (not return it) to pass the test cases.
- If the input is- “MMW”, then the expected output is "2M1W" since there is no ‘C’.
- If any of them have the same count, the output should follow this order - M, W, C.
🧐 Question🔧 Skill

Easy

Custom Exception
Exception Handling
Custom Exceptions

2 mins

Java
Solve

Hard

Holding References

2 mins

Java
Solve

Medium

Abstract Interface
OOPs
Interfaces
Java Syntax
Object-oriented Programming (Oop) Concepts

2 mins

Java
Solve

Medium

Garbage Collection
Garbage Collection
Garbage_collection_rules
Object_reachability

2 mins

Java
Solve

Hard

Static Init Blocks
OOPs
Java Syntax
Code Execution Output

2 mins

Java
Solve

Medium

Autowiring Service
Spring Component Autowiring Behavior
Bean Injection

3 mins

Spring
Solve

Medium

Bean init and afterPropertiesSet
Beans

2 mins

Spring
Solve

Medium

Boot Autowiring
Spring Boot
Spring Bean Management
Autowiring
Context Awareness

3 mins

Spring
Solve

Easy

Registration Queue
Logic
Queues
Sorting By Custom Order

30 mins

Coding
Solve

Medium

Visitors Count
Strings
Logic
String Parsing
Character Counting

30 mins

Coding
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Custom Exception
Exception Handling
Custom Exceptions
Java
Easy2 mins
Solve
Holding References
Java
Hard2 mins
Solve
Abstract Interface
OOPs
Interfaces
Java Syntax
Object-oriented Programming (Oop) Concepts
Java
Medium2 mins
Solve
Garbage Collection
Garbage Collection
Garbage_collection_rules
Object_reachability
Java
Medium2 mins
Solve
Static Init Blocks
OOPs
Java Syntax
Code Execution Output
Java
Hard2 mins
Solve
Autowiring Service
Spring Component Autowiring Behavior
Bean Injection
Spring
Medium3 mins
Solve
Bean init and afterPropertiesSet
Beans
Spring
Medium2 mins
Solve
Boot Autowiring
Spring Boot
Spring Bean Management
Autowiring
Context Awareness
Spring
Medium3 mins
Solve
Registration Queue
Logic
Queues
Sorting By Custom Order
Coding
Easy30 minsSolve
Visitors Count
Strings
Logic
String Parsing
Character Counting
Coding
Medium30 minsSolve
Get started for free
Preview questions
love bonito

With Adaface, we were able to optimise our initial screening process by upwards of 75%, freeing up precious time for both hiring managers and our talent acquisition team alike!

Brandon Lee, Head of People, Love, Bonito

Brandon
love bonito

It's very easy to share assessments with candidates and for candidates to use. We get good feedback from candidates about completing the tests. Adaface are very responsive and friendly to deal with.

Kirsty Wood, Human Resources, WillyWeather

Brandon
love bonito

We were able to close 106 positions in a record time of 45 days! Adaface enables us to conduct aptitude and psychometric assessments seamlessly. My hiring managers have never been happier with the quality of candidates shortlisted.

Amit Kataria, CHRO, Hanu

Brandon
love bonito

We evaluated several of their competitors and found Adaface to be the most compelling. Great library of questions that are designed to test for fit rather than memorization of algorithms.

Swayam Narain, CTO, Affable

Brandon

Why you should use Pre-employment Java & Spring Online Test?

The Java & Spring Test makes use of scenario-based questions to test for on-the-job skills as opposed to theoretical knowledge, ensuring that candidates who do well on this screening test have the relavant skills. The questions are designed to covered following on-the-job aspects:

  • Understanding and implementing Java syntax and basics
  • Applying Object-Oriented Programming concepts in Java
  • Working with Databases in Java, including CRUD operations
  • Demonstrating proficiency in Java data structures
  • Implementing basic functionalities of the Spring framework
  • Understanding the Spring bean lifecycle
  • Securing web applications using Spring Security
  • Developing Java applications with error handling and exception management
  • Applying design patterns in Java programming
  • Implementing multithreading and concurrency in Java applications

Once the test is sent to a candidate, the candidate receives a link in email to take the test. For each candidate, you will receive a detailed report with skills breakdown and benchmarks to shortlist the top candidates from your pool.

What topics are covered in the Java & Spring Online Test?

Java syntax and basics: Java syntax and basics refers to the fundamental rules and principles of writing Java code. It includes knowledge of variables, data types, operators, control structures, and basic syntax rules. This skill is measured in the test to assess the candidate's understanding of the foundations of the Java programming language, which is crucial for writing reliable and efficient code.

Java OOPs: Java OOPs (Object-Oriented Programming) focuses on the concepts and principles of object-oriented programming in Java. It covers topics such as classes, objects, inheritance, polymorphism, and encapsulation. Evaluating this skill helps determine the candidate's ability to design and implement robust and modular Java applications.

Working with Databases in Java: Working with Databases in Java involves understanding how to connect, query, and manipulate databases using Java programming. It includes knowledge of SQL, JDBC (Java Database Connectivity), and database design principles. This skill is assessed to gauge the candidate's proficiency in handling data persistence and interactions with databases within Java applications.

Java data structures: Java data structures refers to the various built-in data structures provided by the Java programming language, such as arrays, lists, queues, stacks, and maps. It also covers topics like sorting algorithms and searching techniques. Assessing this skill helps determine the candidate's ability to effectively organize, store, and retrieve data to solve complex problems efficiently.

Basics of Spring framework: The basics of the Spring framework involve understanding the core features and concepts of Spring, such as dependency injection, inversion of control, and aspect-oriented programming. It also includes knowledge of Spring configuration files and annotations. This skill is measured in the test to identify the candidate's familiarity with one of the most widely used Java frameworks for building enterprise applications.

Spring bean lifecycle: Spring bean lifecycle refers to the sequence of steps involved in the creation, initialization, and destruction of Spring beans. It encompasses concepts like instantiation, dependency injection, and bean post-processing. Evaluating this skill allows assessment of the candidate's understanding of how Spring manages the lifecycle of beans, which is crucial for maintaining the integrity and scalability of Spring applications.

Securing web applications with Spring Security: Securing web applications with Spring Security focuses on implementing authentication and authorization mechanisms in Spring-based web applications. It includes knowledge of user authentication, role-based access control, and secure communication protocols. This skill is assessed to determine the candidate's ability to develop secure web applications that protect sensitive data and prevent unauthorized access.

Java Programming: Java Programming encompasses the overall proficiency in writing efficient, modular, and maintainable Java code. It includes knowledge of advanced Java concepts like multithreading, exception handling, file I/O, and Java libraries. Assessing this skill helps gauge the candidate's ability to solve complex problems using Java and implement industry best practices for software development.

Full list of covered topics

The actual topics of the questions in the final test will depend on your job description and requirements. However, here's a list of topics you can expect the questions for Java & Spring Test to be based on.

Variables
Operators
Control flow
Classes
Inheritance
Polymorphism
Abstraction
Encapsulation
Exception handling
File handling
Collections
Generics
Multithreading
Database connectivity
SQL queries
Object-Relational Mapping (ORM)
Servlets
JSP
Spring Core
Dependency Injection
Spring MVC
RESTful web services
Spring Data
Spring Security
Bean lifecycle
Aspect-oriented programming (AOP)
Testing with JUnit
Logging
Java streams
Annotations
Concurrency
Serialization
Design patterns
Java 8 features
Lambda expressions
Stream API
Garbage collection
Internationalization
Error handling
Performance optimization
Debugging
JavaFX
Networking
XML processing
JSON processing
Socket programming
Regular expressions
Algorithms
Data structures
Sorting
Searching
Binary trees
Graphs
Recursion

What roles can I use the Java & Spring Online Test for?

  • Java Developer
  • Full Stack Java Developer
  • Backend Java Developer
  • Java Application Developer
  • Java Architect
  • Java Team Lead

How is the Java & Spring Online Test customized for senior candidates?

For intermediate/ experienced candidates, we customize the assessment questions to include advanced topics and increase the difficulty level of the questions. This might include adding questions on topics like

  • Creating restful web services with Spring framework
  • Implementing dependency injection using Spring framework
  • Optimizing performance in Java applications
  • Working with Java collections framework
  • Unit testing and test-driven development in Java
  • Implementing caching mechanisms in Java applications
  • Understanding and utilizing Java lambdas and streams
  • Working with file handling and I/O operations in Java
  • Understanding and applying SOLID principles in Java programming
  • Evaluating and using Java frameworks and libraries for efficient development

The coding question for experienced candidates will be of a higher difficulty level to evaluate more hands-on experience.

Try the most advanced candidate assessment platform

ChatGPT Protection

Non-googleable Questions

Web Proctoring

IP Proctoring

Webcam Proctoring

MCQ Questions

Coding Questions

Typing Questions

Personality Questions

Custom Questions

Ready-to-use Tests

Custom Tests

Custom Branding

Bulk Invites

Public Links

ATS Integrations

Multiple Question Sets

Custom API integrations

Role-based Access

Priority Support

GDPR Compliance

Screen candidates in 3 easy steps

Pick a test from over 500+ tests

The Adaface test library features 500+ tests to enable you to test candidates on all popular skills- everything from programming languages, software frameworks, devops, logical reasoning, abstract reasoning, critical thinking, fluid intelligence, content marketing, talent acquisition, customer service, accounting, product management, sales and more.

Invite your candidates with 2-clicks

Make informed hiring decisions

Get started for free
Preview questions

Have questions about the Java & Spring Hiring Test?

What is Java & Spring Test?

The Java & Spring Test evaluates candidates' understanding of Java, including its syntax, OOPs, data structures, and the basics of the Spring framework. This test is useful for hiring managers looking to assess the technical proficiency of developers.

Can I combine the Java & Spring Test with other skills?

Yes, recruiters can request a custom test that includes multiple skills. For instance, you can combine this test with the Java, Spring & Hibernate Test to get a more comprehensive assessment.

What types of questions are included in the Java & Spring Test?

This test consists of 5 Java MCQs, 4 Spring MCQs, and 1 Java coding question. It covers topics like Java syntax, OOPs, data structures, Spring framework basics, and securing web applications with Spring Security.

How to use the Java & Spring Test in my hiring process?

Use this test at the start of your recruitment. Add the test link to your job post or invite candidates via email. Adaface helps you identify skilled candidates early in the hiring process.

Can I test Java and SQL together in a single test?

Yes, you can test Java and SQL together using our Java, Spring & SQL Test. This combination helps assess a candidate's proficiency in both Java and SQL skills.

What are the main Java tests?

We offer several tests to assess Java skills:

Can I combine multiple skills into one custom assessment?

Yes, absolutely. Custom assessments are set up based on your job description, and will include questions on all must-have skills you specify. Here's a quick guide on how you can request a custom test.

Do you have any anti-cheating or proctoring features in place?

We have the following anti-cheating features in place:

  • Non-googleable questions
  • IP proctoring
  • Screen proctoring
  • Web proctoring
  • Webcam proctoring
  • Plagiarism detection
  • Secure browser
  • Copy paste protection

Read more about the proctoring features.

How do I interpret test scores?

The primary thing to keep in mind is that an assessment is an elimination tool, not a selection tool. A skills assessment is optimized to help you eliminate candidates who are not technically qualified for the role, it is not optimized to help you find the best candidate for the role. So the ideal way to use an assessment is to decide a threshold score (typically 55%, we help you benchmark) and invite all candidates who score above the threshold for the next rounds of interview.

What experience level can I use this test for?

Each Adaface assessment is customized to your job description/ ideal candidate persona (our subject matter experts will pick the right questions for your assessment from our library of 10000+ questions). This assessment can be customized for any experience level.

Does every candidate get the same questions?

Yes, it makes it much easier for you to compare candidates. Options for MCQ questions and the order of questions are randomized. We have anti-cheating/ proctoring features in place. In our enterprise plan, we also have the option to create multiple versions of the same assessment with questions of similar difficulty levels.

I'm a candidate. Can I try a practice test?

No. Unfortunately, we do not support practice tests at the moment. However, you can use our sample questions for practice.

What is the cost of using this test?

You can check out our pricing plans.

Can I get a free trial?

Yes, you can sign up for free and preview this test.

I just moved to a paid plan. How can I request a custom assessment?

Here is a quick guide on how to request a custom assessment on Adaface.

View sample scorecard


Along with scorecards that report the performance of the candidate in detail, you also receive a comparative analysis against the company average and industry standards.

View sample scorecard
customers across world
Join 1200+ companies in 80+ countries.
Try the most candidate friendly skills assessment tool today.
g2 badges
Ready to use the Adaface Java & Spring Test?
Ready to use the Adaface Java & Spring Test?
logo
40 min tests.
No trick questions.
Accurate shortlisting.
Terms Privacy Trust Guide
ada
Ada
● Online
Previous
Score: NA
Next
✖️