Search test library by skills or roles
⌘ K

Adaface Sample Spring Questions

Here are some sample Spring questions from our premium questions library (10273 non-googleable questions).

Skills

🧐 Question

Medium

Autowiring Service
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
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
🧐 Question🔧 Skill

Medium

Autowiring Service

3 mins

Spring
Solve

Medium

Bean init and afterPropertiesSet
Beans

2 mins

Spring
Solve

Medium

Boot Autowiring
Spring Boot

3 mins

Spring
Solve
🧐 Question🔧 Skill💪 Difficulty⌛ Time
Autowiring Service
Spring
Medium3 mins
Solve
Bean init and afterPropertiesSet
Beans
Spring
Medium2 mins
Solve
Boot Autowiring
Spring Boot
Spring
Medium3 mins
Solve

Trusted by recruitment teams in enterprises globally

Amazon Morgan Stanley Vodafone United Nations HCL PayPal Bosch WeWork Optimum Solutions Deloitte Microsoft NCS Doubtnut Sokrati J&T Express Capegemini

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

hashtag image heart icon Swayam
customers across world
Join 1500+ companies in 80+ countries.
Try the most candidate friendly skills assessment tool today.
g2 badges
Ready to streamline your recruitment efforts with Adaface?
Ready to streamline your recruitment efforts with Adaface?
logo
40 min tests.
No trick questions.
Accurate shortlisting.
ada
Ada
● Online
Previous
Score: NA
Next
✖️