Login
Sign up
Categories
IT & Programming
Design & Multimedia
Writing & Translation
Sales & Marketing
Admin Support
Engineering & Manufacturing
Finance & Management
Website Designing & Development
Database Management
Networking & Troubleshooting
Aviation & Aerospace
Softwares & Applications
Stocks & Investments
Electronics & Appliances
Online Tools
General Knowledge & Aptitude
Mathematics
Educational Subjects & Courses
Business & Organization
Health & Wellbeing
Culture & Ethics
IT Field Knowledge & Experience
Languages & Communication
Entrepreneurship & Leadership
Economics & Development
Mass Communication & Media
Research Methods & Evaluation
Public Relations & Dealings
Educational Methods and Research
Educational Subjects & Techniques
Crime & Justice
Governments & Policies
Cyber Security & Ethical Hacking
Hospitality & Tourism
Soft Skills & Personal Management
Transportation & Driving Rules
Forest and Nature
Religion
Skill Assessment
MCQs
PDFs
Login
Sign up
Categories
IT & Programming
Design & Multimedia
Writing & Translation
Sales & Marketing
Admin Support
Engineering & Manufacturing
Finance & Management
Website Designing & Development
Database Management
Networking & Troubleshooting
Aviation & Aerospace
Softwares & Applications
Stocks & Investments
Electronics & Appliances
Online Tools
General Knowledge & Aptitude
Mathematics
Educational Subjects & Courses
Business & Organization
Health & Wellbeing
Culture & Ethics
IT Field Knowledge & Experience
Languages & Communication
Entrepreneurship & Leadership
Economics & Development
Mass Communication & Media
Research Methods & Evaluation
Public Relations & Dealings
Educational Methods and Research
Educational Subjects & Techniques
Crime & Justice
Governments & Policies
Cyber Security & Ethical Hacking
Hospitality & Tourism
Soft Skills & Personal Management
Transportation & Driving Rules
Forest and Nature
Religion
Skill Assessment
MCQs
PDFs
Login
Sign up
Skill Assessments
>
IT & Programming
>
Spring Framework Skill Assessment
>
Quiz # 8
Spring Framework Quiz # 8
Instructions
Quiz:
Spring Framework Quiz # 8
Subject:
Basic Spring Framework
Total Questions:
30 MCQs
Time:
30 Minutes
Note
Do not refresh the page while taking the test.
Results along with correct answers will be shown at the end of the test.
Start Quiz
Spring Framework Quiz # 8
End Quiz
Question
1
of 30
00:00
What is component scanning?
Feature that scans packages for classes with specific annotations and, when found, creates their bean definitions within the IoC container
Paradigm where bytecode is actively scanned to identify additional optimizations to inject into components in the application context
A method by which cloud repositories are scanned to identify components for injection into an IoC container
A method by which binary data in a database is searched to identify components for injection into the IoC container
What does @SpringBootApplication do?
This annotation takes the String literal passed into the annotation as a parameter and automatically generates all the code for your application as per the passed in template parameter.
This compound annotation applies the @Bootable, @Springify, and @StandardConfig annotations that launch a CLI tool after launching the Spring Boot WAR file that will guide you through a series of prompts to set up your app.
This annotation scans the provided spring-boot-config-construction.yaml file in your root directory and automatically generates all the code for your application as defined in the YAML file.
How does Spring Data facilitate queries against a datastore?
Queries are explicitly coded in repository implementations using the Spring Data CriteriaBuilder.
Query metadata is stored in the underlying datastore and retrieved at runtime per repository.
Queries are derived from the signatures of methods on a Spring Data repository that contain keywords in their name for constructing the query logic.
A spring-data-queries.xml file contains queries within entity tags that specify the query logic for each repository.
What is the delegating filter proxy?
It's the servlet filter chain proxy that handles all requests to the route defined in spring.security.xml. All calls to the filter proxy are forwarded to the ErrorDispatcherServlet.
It's the servlet filter chain that handles requests to the route defined in spring.security.factories. All calls to the filter proxy y are forwarded to the ErrorServlet.
It's the servlet filter proxy delegating to a filter bean specified in web.xml. All calls to the filter proxy will be delegated to that servlet filter bean.
It's the web servlet daemon filter proxy that delegates to a bean specified in spring.security.factories. All calls to the filter proxy that do not contain a proper route will return an error.
What value does Spring Boot Actuator provide?
It helps monitor and manage a Spring Boot application by providing endpoints such as health checks, auditing, metrics gathering, and HTTP tracing.
It provides out-of-the-box functionality that integrates with third-party metrics platforms to automatically scale up and down the number of threads in threadpools.
It's a CLI that allows you to modify the configuration of a running Spring Boot application without the need for restarting or downtime.
It provides out-of-the-box functionality that integrates wiltr?third-party metrics platforms to automatically scale up and down the number of instances of the Spring Boot application.
What is the purpose of the @ContextConfiguration annotation in a JUnit Test?
It introspects the local machine and automatically provisions resources based on certain contextual configuration files.
It automatically generates comments for annotated classes on autowired dependencies to provide additional context about dependencies.
It defines metadata at the class-level to determine how to load or configure an ApplicationContext in Spring integration tests.
It automatically generates JavaDocs for annotated classes to provide additional context about the purpose of the class.
How are authentication and authorization different?
Authentication is the act of granting access to specific resources and functions based on config settings. Authorization is the act of introspecting a user's credentials to ensure they are not impersonating another user.
Authentication is the act of verifying certain resources and functions are actually valid. Authorization is the act of verifying a user's credentials have not expired.
Authentication is the act of verifying that certain resources and functions actually exist in the database. Authorization is the act of verifying a user's credentials to ensure they are valid.
Authentication is validating that users are who they claim to be. Authorization is granting access to specific resources and functions.
What is the purpose of the @RequestBody annotation?
To create a ThreadLocal byte stream that allows a request to be encoded for reading directly into a database
To automatically generate a ThreadLocal byte stream from the body of a request that allows a request to scanned for security risks
To indicate whether an annotated handler method parameter should be bound to the web request body, which is converted by an HttpMessageConverter
To automatically validate the characters contained in a request to ensure that they are a valid character encoding
What is the DispatcherServlet and what is its function?
The DispatcherServlet process daemon assigns a separate Web Servlet Container process to each HTTP request that comes into the web server.
It is a servlet that dispatches HTTP requests to registered handlers/controllers for processing.
The DispatcherServlet API assigns a separate Web Servlet Node process to each additional HTTP request that comes into the web server.
It is a servlet that dispatches an array of background daemon processes that allocate memory and CPU cycles to each request.
What is Spring Boot autoconfiguration?
It triggers a local automated review of configuration files such as web.xml and detects possible security issues or automatically resolves circular dependencies.
It triggers an automated review of configuration by a web-based agent that reviews your existing web.xml file and detects possible security issues.
It's an opinionated, intelligent method of introspecting an app to configure beans that are likely to be needed. This configuration can be overridden over time with manual configuration.
It provides plug-in functionality while editing your web.xml and other config files that will autocomplete common dependencies while typing.
Which are valid steps to take to enable JPA in Spring Boot?
Add an @EnableJpaRepositories annotation to your configuration class and create a Spring Data Repository.
Add an @EnableJpaEntities annotation to your configuration class, create a Spring Data YAML configuration file, and manually update the Spring XML config files to define your repository locations.
Add an @EnableDbFunctionality annotation to your configuration class, create a Spring Data XML configuration file, and manually update the Spring factories file to define your repositories.
Add an @InitJpaEntities annotation to your configuration class, create a Spring Data properties configuration file, and manually update the Spring startup parameters to define your repository locations.
What is a transaction in the context of Spring Data?
A version-controlled schema change that is applied to a database
A sequence of actions representing a single unit of work managed as a single operation that can be either committed or rolled back
An encoded message and response between various shards of a database
An exchange or interaction between various worker nodes in a multithreaded environment
Modularization of a concern that cuts across multiple classes is known as a(n)____.
Multiclass
Aspect
Crosscut
Sidecut
How do you inject a dependency into a Spring bean?
Any of these answers
Annotate a Setter method with the @Autowired annotation.
Specify parameters in the constructor with an optional @Autowired annotation.
Use field injection.
What is a bean in the context of Spring?
A managed dependency defined by configuration metadata that can be injected into downstream classes
A binary-encoded, agnostic, named entity that is translatable between different data formats
A payload that is transferable between different services in a Service-Oriented Architecture (SOA)
A discrete piece of data that is encoded in a binary format for persisting to a file system
Which property is given precedence by Spring?
Application properties located in an application.properties file outside the application.jar
@PropertySource annotations on configuration classes
Profile-specific application-{profile}.properties files
Application properties located in an application.properties file inside the application.jar
What Spring Boot property is used to set the logging level for the entire application in the application.properties file?
Logging.settings
Log.level
Root.logger.level
Logging.level.root
What is a Spring bean uniquely identified?
An autogenerated UUID
A unique String name
An auto-incremented Integer ID
An ID derived from its location in memory
What is the difference between a JAR and a WAR distribution in Spring Boot?
Spring Boot can create a self-executable WAR file that runs without needing a servlet container. A JAR file has to be deployed to an existing web container such as Tomcat with separate files for dependencies.
Spring Boot can create a JAR file that contains bytecode that interacts directly with the OS without needing a servlet container. A WAR file has to be deployed to an existing web container such as Tomcat with separate files for dependencies.
The Spring Boot JAR file will be deployed to a Servlet container such as Tomcat on an existing running web server locally. The WAR file will be deployed to a cloud-based servlet container.
Spring Boot can create a self-executable JAR file that contains all the dependencies and an embedded Servlet container. A WAR file has to be deployed to an existing web container such as Tomcat.
How does the transaction propagation setting impact the behavior of transactions?
It ensures that transactions that are commited to the database are propagated to all the shards of a clustered database system.
None of these answers is correct.
It guarantees that transactions that are submitted to the database cluster are propagated to all the nodes of a clustered database cloud.
It enforces that a logical transaction scope is created for each method that determines rollback-only status, with an outer transaction scope being logically independent from the inner transaction scope.
To register a custom filter that applies only to certain URL patterns, you should remove the _ annotation from the filter class and register a @Bean of type _ in Spring @Configuration.
@RequestMapping; WebRequest
@Controller; URLFilter
@WebFilter; ServletContextInitializer
@Component; FilterRegistrationBean
What is the purpose of a web application context?
Configures a web application that is able to be deleted and re-created during runtime through hot swap. It adds a recreateContext() method and defines a root WebDaemon that must be bound to in the bootstrap process.
It configures a Spring application that is able to be modified on the fly during runtime through bytecode re-encoding. Also it adds an updateContext() method and defines a root WebServlet that must be bound to in the bootstrap process.
It provides configuration for a web application that is read-only while running. Also, it adds a getServletContext() method and defines an attribute name to which the root context must be bound in the bootstrap process.
It provides configuration for a Spring application that is updatable on the fly during runtime through bytecode weaving. Also it adds an updateServletContext() method and defines a root servlet that must be bound to in the bootstrap process.
What is Spring AOP?
Aspect-Oriented Programming allows you to define different cross-cutting aspects that isolate beans to be available only in certain environments and profiles.
Aspect-Oriented Programming enables you to perform profiling, which lets you develop different cross-cutting JVM performance-tuning profiles for different aspects of your applications.
Aspect-Oriented Programming enables the modularization of cross-cutting concerns so that repeated boilerplate logic, such as logging code, does not pollute business logic.
Aspect-Oriented Programming enables you to persist cross-cutting data across modularized shards of your database.
Assuming username and password authentication is in place, what method on the Authentication object can be used to obtain the username?
GetPrincipal
GetUsername
GetUser
GetDn
Assuming no additional configuration is provided, what is the first selection criteria Spring uses to choose a bean when autowiring a property?
None of these answers
Bean type
Bean size
Bean name
What is a security context?
The security context includes details of the principal currently using the app, which is stored by default in a ThreadLocal in an Authentication object.
The security context holds a list of all users and their encrypted passwords in memory and a list of resources that users are able to access.
The security context includes information about safe network IDs and IP addresses that are able to access the system.
The security context includes information about permissions on the local file system describing how local file resources can be accessed.
How might you map an incoming request to a controller method?
Annotate a Controller class with @Controller. Then, using a specific naming convention for the methods, the RequestMappingHandlerAdapter will automatically configure your endpoints with the proper HTTP verb and URI.
Register a controller as a bean. Then, using a specific naming convention for the methods, the RequestMappingHandlerAdapter will automatically configure your endpoints based on values from the YAML config file.
Annotate a controller method with @RequestMapping, or a HTTP verb-specific annotation with a String URI pattern parameter (and other params as needed), which is supported through a RequestMappingHandlerMapping/Adapter.
Register a controller as a bean. Then, using a specific naming convention for the methods, the RequestMappingHandlerAdapter will automatically configure your endpoints based on values passed into the bean definition.
What pattern does Spring MVC implement to delegate request processing to controllers?
Front Controller
Facade
Reactive Chain
Observer
What methods does the Pointcut expression below reference? execution(* setter*(..))
Any method with a name that contains the String
Any method with a name that begins with String
Any method with a name that begins with String
Any method with a name that contains the String
What is the output from invoking this Actuator endpoint in an unmodified Spring Boot application generated using Spring Intializr? /shutdown
The request would fail because the endpoint is disabled by default.
The Spring Boot app would return a URL and a list of currently running processes, and ask you to confirm the shutdown command.
The Spring Boot app would return a URL to confirm the shutdown command.
The Spring Boot app would begin shutting down.
Submit Test
Prev Question
ABCd
Next Question
Spring Framework Skill Assessment
Login to see Skill Score (It's Free)
Your Skill Level:
Poor
Retake Quizzes to improve it
Start Assessment
Spring Framework Skill Assessment
Login to see Skill Score (It's Free)
Your Skill Level:
Poor
Retake Quizzes to improve it
Start Assessment