Final 4 Flashcards
(55 cards)
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
b. Support for Windows containers
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. kubectl apply -f FILENAME
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. Unique message position within a topic partition
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. @Entity, @Id
Which annotation is used for creating a RESTful web service in Spring Boot?
a. @Service
b. @Path
c. @Controller
d. @RestController
d. @RestController
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. PreparedStatement
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
c. The strategy where related entities are loaded on-demand rather than at the time of loading the parent entity
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. It specifies the column name in the database table for the mapped attribute
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
b. Operations for creating, reading, updating, and deleting persistent entities
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
d. It updates the persistent state of an entity with the current state of a detached entity
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. Java Persistence API
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
c. It specifies a collection of instances of a basic type or embeddable class
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
c. It’s a field that’s stored in the database and loaded into memory when the entity is loaded
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. It specifies the database table name for the mapped entity
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
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
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. GET and HEAD
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
b. All resources have the same interface
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
b. It maintains information between requests
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. Simple Object Access Protocol
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. It’s a convenience annotation that combines @Controller and @ResponseBody
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. @RequestMapping
What is the primary data format used in RESTful web services?
a. XML
b. JSON
c. CSV
d. HTML
b. JSON
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. Using the @Consumes and @Produces annotations
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. It defines the media type that the methods of a resource class can accept