Final 4 Flashcards

(55 cards)

1
Q

What is one of the main features that distinguishes Kubernetes from other container orchestrators?
a. Ability to run on Linux systems only
b. Support for Windows containers
c. Auto-scaling of applications
d. In-built load balancing

A

b. Support for Windows containers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you typically update a deployment in Kubernetes?
a. kubectl apply -f FILENAME
b. kubectl get deployment DEP_NAME
c. kubectl describe DEP_NAME
d. kubectl config view

A

a. kubectl apply -f FILENAME

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Kafka Message Offset numbers are:
a. Unique message position within a topic partition
b. The amount or distance by which messages are out of sync
c. Reused after message are deleted
d. Non-sequential in the log with multiple producers

A

a. Unique message position within a topic partition

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 2 bare minimum requirements to annotate simple POJO into a JPA entity?
a. @Entity, @Id
b. @JPA, @Entity
c. @Entity, @Table
d. @Entity, no argument public constructor

A

a. @Entity, @Id

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which annotation is used for creating a RESTful web service in Spring Boot?
a. @Service
b. @Path
c. @Controller
d. @RestController

A

d. @RestController

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

In JDBC, what Java class object can be used to invoke a method to update database tables?
a. PreparedStatement
b. ScrollableStatement
c. CompiledStatement
d. None of the above

A

a. PreparedStatement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the term “Lazy Loading” refer to in the context of JPA?
a. The strategy where related entities are loaded automatically with the parent entity
b. The process where the persistence context is cleared automatically when the transaction is committed
c. The strategy where related entities are loaded on-demand rather than at the time of loading the parent entity
d. The process where the entity manager factory is created at the time of the first request rather than at application startup

A

c. The strategy where related entities are loaded on-demand rather than at the time of loading the parent entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the @Column annotation do in JPA?
a. It specifies the column name in the database table for the mapped attribute
b. It specifies the SQL query to be executed when the entity is loaded
c. It specifies the Java data type of the attribute
d. All of the above

A

a. It specifies the column name in the database table for the mapped attribute

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does the EntityManager interface in JPA handle?
a. Control flow of the application
b. Operations for creating, reading, updating, and deleting persistent entities
c. Conversion between different data types
d. Inter-thread communication in a Java program

A

b. Operations for creating, reading, updating, and deleting persistent entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

In JPA, what does the merge() method of the EntityManager interface do?
a. It removes an entity from the persistence context
b. It save changes to the database immediately
c. It create a new instance of an entity
d. It updates the persistent state of an entity with the current state of a detached entity

A

d. It updates the persistent state of an entity with the current state of a detached entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What does JPA stand for in the context of Java development?
a. Java Persistence API
b. Java Processing Application
c. Java Programming Annotation
d. Java Parallel Application

A

a. Java Persistence API

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the @ElementCollection Annotation do in JPA?
a. It marks a class as a JPA entity
b. It specifies the SQL query to be executed when the entity is loaded
c. It specifies a collection of instances of a basic type or embeddable class
d. It specifies the database table for an entity class

A

c. It specifies a collection of instances of a basic type or embeddable class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

In JPA, which of the following best describes a persistent field?
a. It’s a field that’s not stored in the database
b. It’s a field that’s stored in the database but not loaded into memory
c. It’s a field that’s stored in the database and loaded into memory when the entity is loaded
d. It’s a field that’s used to store the database connection settings

A

c. It’s a field that’s stored in the database and loaded into memory when the entity is loaded

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What does the @Table annotation do in JPA?
a. It specifies the database table name for the mapped entity
b. It specifies the primary key of the entity
c. It specifies the SQL query to be executed when the entity is loaded
d. It specifies the database schema where the table resides

A

a. It specifies the database table name for the mapped entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the difference between @Embeddable and @Entity in JPA?
a. There is no difference, both annotations have the same meaning
b. @Entity is used to mark a regular class as an entity, whereas @Emebeddable is used to define a class whose instances are stored as an intrinsic part of an owning entity
c. @Embeddable is used to mark a regular class as an entity, whereas @Entity is used to define a class whose instances are stored as an intrinsic part of an owning entity
d. @Entity is used to create a new table in the database, whereas @Embeddable is used to add columns to an existing table

A

b. @Entity is used to mark a regular class as an entity, whereas @Emebeddable is used to define a class whose instances are stored as an intrinsic part of an owning entity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which HTTP methods are generally considered safe (i.e., they don’t change the state of the server)?
a. GET and HEAD
b. POST and PUT
c. PUT and DELETE
d. POST and DELETE

A

a. GET and HEAD

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

In the context of RESTful Web services, what does “uniform interface” mean?
a. All services have the same interface
b. All resources have the same interface
c. All HTTP methods have the same interface
d. All clients have the same interface

A

b. All resources have the same interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What does it mean if a Web service is “stateful”?
a. It doesn’t maintain any information between requests
b. It maintains information between requests
c. It discards information after each request
d. It doesn’t handle any information at all

A

b. It maintains information between requests

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What does SOAP stand for in the context of web services?
a. Simple Object Access Protocol
b. Simple Object Application Protocol
c. Simple Object Array Protocol
d. Simple Object Argument Protocol

A

a. Simple Object Access Protocol

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

In Spring Boot, what is the purpose of the @RestController annotation?
a. It’s a convenience annotation that combines @Controller and @ResponseBody
b. It specifies that a class is a bean
c. It specifies that a class is a component
d. It binds the parameters of a method to a form

A

a. It’s a convenience annotation that combines @Controller and @ResponseBody

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Which of these annotations is used in Spring Boot to map a specific HTTP method to a Java method?
a. @RequestMapping
b. @WebMapping
c. @HttpMethod
d. @PathMapping

A

a. @RequestMapping

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What is the primary data format used in RESTful web services?
a. XML
b. JSON
c. CSV
d. HTML

A

b. JSON

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

How can you specify the consumed and produced media type of a resource in JAX-RS?
a. Using the @Consumes and @Produces annotations
b. Using the @MediaType annotation
c. Using the @ContentType annotation
d. By specifying the media type in the path

A

a. Using the @Consumes and @Produces annotations

24
Q

In JAX-RS, what is the purpose of the @Consumes annotation?
a. It defines the media type that the methods of a resource class can accept
b. It defines the media type that the methods of a resource can produce
c. It defines the metadata that the methods of a provider class can accept
d. It defines the media type that the methods of a provider class can produce

A

a. It defines the media type that the methods of a resource class can accept

25
What is a hypervisor? a. Container runtime b. Part of host operating system c. Part of guest operating system d. Helps run virtual machines
d. Helps run virtual machines
26
Let's say there is a Black Friday sale coming up for an online store that you have implemented using a Kafka cluster of 2 brokers. For the sale, you created a topic name black_friday_orders with 1 partition with 1 replica count. Based on teh amount of the incoming traffic to handle, you realize that the current configuration is not scalable. What changes will you make to yield higher throughput? a. Increase number of topics to 3 b. Increase number of partitions to 3 c. Increase number of replica count to 3 d. Increase number of brokers from 2 to 5
b. Increase number of partitions to 3
27
What is the use of @Autowired in Spring Boot? a. Used for creating RESTful web services b. Used for dependency injection in Spring Boot c. Used for specifying the primary key for an entity class d. Used for declaring a class with business logic
b. Used for dependency injection in Spring Boot
28
Which of the following are the three key features of Spring Boot? a. Auto-scaling, embedded servers, and opinionated framework. b. Auto-configuration, external servers, and flexible framework. c. Auto-scaling, external servers, and opinionated framework. d. Auto-configuration, embedded servers, and opinionated framework.
d. Auto-configuration, embedded servers, and opinionated framework.
29
In a JMS topic, what happens if a message is published while a durable subscriber is inactive? a. The message is not delivered to the subscriber. b. The message is delivered to the subscriber as soon as it is published. c. The message is delivered to the subscriber when it becomes active. d. The message is delivered to the subscriber when it becomes active, provided the subscriber is a non-durable subscriber.
c. The message is delivered to the subscriber when it becomes active.
30
What is the responsibility of aJMS producer in a JMS Publish/Subscribe messaging model? a. Sending messages to a specific topic. b. Receiving messages from a specific topic. c. Receiving messages from a specific queue d. Sending messages to a specific queue.
a. Sending messages to a specific topic.
31
Which of the following component of HTTP request is used to identify the RESTful resource on a Web server? a. HTTP Version b. Request Header c. HTTP protocol d. URI
d. URI
32
Select the name of the JDBC API (method) that is used to execute SQL statement to insert a record into the database table. a. insert into tableName b. executeQuery c. executeUpdate d. update tableName set column1= value1, column2=value2,, column=valueN
c. executeUpdate
33
In JDBC what Java class object is used to get the database connection? a. JDBC Driver b. JDBCTemplate c. DataSource d. DriverManager
d. DriverManager
34
True or False: The default embedded Web server in Spring Boot is Jetty.
False
35
What does the @Autowired annotation do in Spring Boot? a. It is used to automatically wire bean on setter methods, constructor, and properties b. It is used to create a new instance of a class c. It is used to specify the routes that a controller will handle d. It is used to specify the type of a property
a. It is used to automatically wire bean on setter methods, constructor, and properties
36
What does the @EnablejpaRepositories annotation do in Spring Boot? a. It enables the auto-configuration of Spring's annotation driven transaction management capability b. It enables the auto-confiquration of Spring's AOP support c. It enables the auto-configuration of Spring Data JPA repositories d. It enables the auto-configuration of Spring's JDBC support
c. It enables the auto-configuration of Spring Data JPA repositories
37
What does the @RestController annotation do in Spring Boot? a. It creates a new instance of the RestController class b. It specifies that the class will be a controller in the MVC architecture c. It configures the routes that the controller will handle d. It specifies that the class can handle HTTP requests
d. It specifies that the class can handle HTTP requests
38
In Spring Boot, what does the @GetMapping annotation do? a. It is a composed annotation that acts as a shortcut for @RequestMapping(method = RequestMethod.GET) b. It is used to specify the type of a property c. It is used to create a new instance of a class d. It is used to map web requests onto specific handler methods based on some conditions
a. It is a composed annotation that acts as a shortcut for @RequestMapping(method = RequestMethod.GET)
39
Which annotation is used in Spring Boot to wire beans? a. @Bean b. @Component c. @Autowired d. @Inject
c. @Autowired
40
In Spring Boot, what is the purpose of the @ResponseBody annotation? a. It is used to bind the value of a query parameter to a method parameter b. It is used to indicate that a class is a "Service" c. It is used to indicate that the return value of a method should be used as the body for the response d. It is used to mark a class as an entity (i.e., a persistent POJO class)
c. It is used to indicate that the return value of a method should be used as the body for the response
41
What does the Spring Boot @DeleteMapping annotation do? a. It is used to specify the type of a property b. It is used to create a new instance of a class c. It is a composed annotation that acts as a shortcut for @RequestMapping(method = RequestMethod.DELETE) d. It is used to map web requests onto specific handler methods based on some conditions
c. It is a composed annotation that acts as a shortcut for @RequestMapping(method = RequestMethod.DELETE)
42
Which of the following is NOT true about the @Service annotation in Spring? a. It is used at the class level b. It is a specialization of the component annotation c. It is used at the method level d. It is used to indicate that a class is a "Service"
c. It is used at the method level
43
What is the purpose of the Spring Boot @PathVariable annotation? a. It is used to indicate that a method parameter should be bound to a URI template variable b. It is used to create a new instance of a class c. It is used to specify the type of a property d. It is used to indicate that a method parameter should be bound to a URI template variable
a. It is used to indicate that a method parameter should be bound to a URI template variable
44
What does the Spring Framework provide to enterprise Java developers? a. A server to host their web applications b. A programming language to write their applications in c. An Integrated Development Environment (IDE) for coding d. A comprehensive programming and configuration model
d. A comprehensive programming and configuration model
45
What is the purpose of Spring Boot @RequestParam annotation? a. It is used to indicate that a method parameter should be bound to a URI template variable b. It is used to bind the value of a query parameter to a method parameter c. It is used to specify the type of a property d. It is used to create a new instance of a class
b. It is used to bind the value of a query parameter to a method parameter
46
In Spring Boot, which of the following specifies a method, constructor argument, or field should be automatically populated with a value by Spring's dependency injection facilities? a. @Configuration b. @RestController c. @Autowired d. @EnableAutoConfiguration
c. @Autowired
47
What is the purpose of using JAX-RS? a. To implement Java persistence API b. Java Architecture for XML and RESTful c. Java API for RESTful Web Services d. None of the above
c. Java API for RESTful Web Services
48
What is the main feature of Spring Data JPA? a. Automatic generation of repository implementation at runtime b. Automatic generation of business persistence logic c. Improved Security d. Reduced memory usage
a. Automatic generation of repository implementation at runtime
49
The starting point of a Spring Boot application is: a. @SpringBootApplication b. @RestController c. @Controller d. @Component
a. @SpringBootApplication
50
Which annotation is used for a class with business logic? a. @RestController b. @Autowired c. @RequestMapping d. @Service
d. @Service
51
What is the name of the configuration file in a Maven project that includes information about the project's dependencies, build settings, and other project details? a. manifest.xml b. pom.xml c. build.xml d. package.json
b. pom.xml
52
When using JAX-RS, which one of the following can be used to configure a Java class into a RESTful Resource? a. @POST, @GET b. @PATH, @GET c. @PATH[{id}], @GEТ d.@Produces, @Consumes
b. @PATH, @GET
53
Which of the following is a popular build tool for Java applications? a. Apache Ant b. Apache Maven c. Apache CodeBuild d. Jenkins
b. Apache Maven
54
Which one of the following is NOT one of the key principles of the REST architecture? a. Uniform interface via HTTP methods b. Stateful Communication c. Support for multiple representation of data d. Resource Identification through URI
b. Stateful Communication
55
What annotation(s) are used to facilitate the automatic creation of the value of the primary key in a JPA entity when you persist the JPA entity in a table? a. @PrimaryKey @Automated b.@ld @GeneratedValue c.@PrimaryKey @Strategy.Auto d. None of the above
b.@ld @GeneratedValue