Home > Java Programming > Quizzes > Spring Framework Quiz
Spring Framework Quiz
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 23% Most missed: “What is the root interface for accessing a Spring bean container?”

Spring Framework MCQs For LinkedIn Skill Assessments.

Spring Framework Quiz
Time left 00:00
25 Questions

1. What is the purpose of the @RequestBody annotation?
2. How is a resource defined in the context of a REST service?
3. Which property is given precedence by Spring?
4. What property can be used to set the active Spring profiles
5. What is component scanning?
6. What is a bean in the context of Spring?
7. What is dependency injection?
8. How do you inject a dependency into a Spring bean?
9. What is the purpose of the Spring IoC (Inversion of Control) container?
10. What methods does this Pointcut expression?
'within(com.linkedin.service..*)'
11. How filters are used in Spring Web?
12. What is the root interface for accessing a Spring bean container?
13. Which is a valid example of the output from this code (ignoring logging statements) ?
java
@SpringBootApplication
public class App {
public static void main(String args[]) {
SpringApplication.run(App.class, args);
System.out.println('startup');
}
}
public class Print implements InitializingBean {
@Override
public void afterPropertiesSet() throws Exception {
System.out.println('init');
}
}
14. What does a ViewResolver do?
15. What is a RESTful web service?
16. What is a security context?
17. Modularization of a concern that cuts across multiple classes is known as a(n)'____'.
18. In the Spring Bean lifecycle pictured, what should the third step of the process be?
![Alt text](https://usaupload.com/cache/plugins/filepreviewer/69009/c5e6eedce33819dd3b16bff7590d244b0fedf52561323c444b4b63e19e61e2e8/1100x800_cropped.jpg 'Spring bean lifecycle')
19. What interface can be specified as a parameter in a controller method signature to handle file uploads?
20. Which annotation can be used within Spring Security to apply method level security?
21. What is a transaction in the context of Spring Data?
22. How can you access the application context in a Spring integration test?
23. What happens when a class is annotated with the @Controller annotation?
24. What is printed when this code is run as a @SpringBootApplication?
java
@Component
public class Test implements InitializingBean {
@Autowired
ApplicationContext context;
@Autowired
SimpleDateFormat formatter;
@Override
public void afterPropertiesSet() throws Exception {
System.out.println(context.containsBean('formatter'));
System.out.println(formatter.getClass());
}
}
@Configuration
class TestConfig2 {
@Bean
public final SimpleDateFormat formatter() {
return new SimpleDateFormat();
}
}
25. What is the result of calling the map controller method using the following HTTP request?

POST localhost:8080/map
{'b' : 'b', 'd' : 'd'}

java
@RestController
public class SampleController {
@RequestMapping('/map')
public String map(@RequestBody SampleObject sampleObject) {
return sampleObject.getB() + sampleObject.getC();
}
}

java
public class SampleObject {
String b;
String c;
public String getB() { return b; }
public void setB() { this.b = b; }
public String getC() { return c; }
public void setC() { this.c = c; }
}