RESTful Mock Test



This section presents you various set of Mock Tests related to RESTful Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

RESTful Mock Test IV

Q 1 - Which of the following annotation of JAX RS API binds the parameter passed to method to a HTTP matrix parameter in path?

A - @PathParam

B - @QueryParam

C - @MatrixParam

D - @HeaderParam

Answer : C

Explanation

@MatrixParam − Binds the parameter passed to method to a HTTP matrix parameter in path.

Q 2 - Which of the following annotation of JAX RS API binds the parameter passed to method to a HTTP header?

A - @PathParam

B - @QueryParam

C - @MatrixParam

D - @HeaderParam

Answer : D

Explanation

@HeaderParam − Binds the parameter passed to method to a HTTP header.

Q 3 - Which of the following annotation of JAX RS API binds the parameter passed to method to a Cookie?

A - @CookieParam

B - @FormParam

C - @DefaultValue

D - @Context

Answer : A

Explanation

@CookieParam − Binds the parameter passed to method to a Cookie.

Q 4 - Which of the following annotation of JAX RS API binds the parameter passed to method to a form value?

A - @CookieParam

B - @FormParam

C - @DefaultValue

D - @Context

Answer : B

Explanation

@FormParam − Binds the parameter passed to method to a form value.

Q 5 - Which of the following annotation of JAX RS API assigns a default value to a parameter passed to method?

A - @CookieParam

B - @FormParam

C - @DefaultValue

D - @Context

Answer : C

Explanation

@DefaultValue − Assigns a default value to a parameter passed to method.

Q 6 - Which of the following annotation of JAX RS API is used to inject a context of the resource for example HTTPRequest as a context

A - @CookieParam

B - @FormParam

C - @DefaultValue

D - @Context

Answer : D

Explanation

@Context − Context of the resource for example HTTPRequest as a context.

Q 7 - REST is web standards based architecture and uses HTTP Protocol for data communication.

A - false

B - true

Answer : B

Explanation

REST is web standards based architecture and uses HTTP Protocol for data communication.

Q 8 - In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources.

A - false

B - true

Answer : B

Explanation

In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources.

Q 9 - A web service is a collection of open protocols and standards used for exchanging data between applications or systems.

A - true

B - false

Answer : A

Explanation

A web service is a collection of open protocols and standards used for exchanging data between applications or systems.

Q 10 - RESTful web services use HTTP methods to implement the concept of REST architecture.

A - true

B - false

Answer : A

Explanation

RESTful web services use HTTP methods to implement the concept of REST architecture.

Q 11 - A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods.

A - false

B - true

Answer : B

Explanation

A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods.

Q 12 - RESTful web services make use of FTP protocol as a medium of communication between client and server.

A - true

B - false

Answer : B

Explanation

RESTful web services make use of HTTP protocol as a medium of communication between client and server.

Q 13 - A RESTful web service client sends a message in form of a Gopher Request and server responds in form of a HTTP Response.

A - true

B - false

Answer : B

Explanation

A RESTful web service client sends a message in form of a HTTP Request and server responds in form of a HTTP Response.

Q 14 - URI of HTTP request indicates HTTP methods to be executed by RESTful Web services.

A - false

B - true

Answer : A

Explanation

HTTP Verb − Indicates HTTP methods such as GET, POST, DELETE, PUT etc.

Q 15 - Request Header - Contains metadata for the HTTP Request message as key-value pairs.

A - false

B - true

Answer : B

Explanation

Request Header − Contains metadata for the HTTP Request message as key-value pairs.

Q 16 - Status/Response Code - Indicate Server status for the requested resource.

A - false

B - true

Answer : B

Explanation

Status/Response Code − Indicate Server status for the requested resource.

Q 17 - Response Header - Contains metadata for the HTTP Response message as key-value pairs.

A - true

B - false

Answer : A

Explanation

Response Header − Contains metadata for the HTTP Response message as key-value pairs.

Q 18 - Request Body - Contains Message content or Resource representation.

A - true

B - false

Answer : A

Explanation

Request Body − Contains Message content or Resource representation.

Q 19 - Each resource in REST architecture is identified by its URI.

A - true

B - false

Answer : A

Explanation

Each resource in REST architecture is identified by its URI.

Q 20 - Purpose of an URI is to do the DNS lookup.

A - true

B - false

Answer : B

Explanation

Purpose of an URI is to locate a resource(s) on the server hosting the web service.

Q 21 - Web services can treat each method request independently.

A - true

B - false

Answer : A

Explanation

Web services can treat each method request independently.

Q 22 - As HTTP is itself a statelessness protocol, RESTful Web services work seamlessly with HTTP protocol.

A - true

B - false

Answer : A

Explanation

As HTTP is itself a statelessness protocol, RESTful Web services work seamlessly with HTTP protocol.

Q 23 - PUT opearations should be readonly.

A - true

B - false

Answer : B

Explanation

PUT opearations should be idempotent.

Q 24 - POST opearations should be idempotent.

A - true

B - false

Answer : B

Explanation

POST operation can cause different result.

Q 25 - GET opearations should be readonly.

A - true

B - false

Answer : A

Explanation

GET opearations should be readonly.

Answer Sheet

Question Number Answer Key
1 C
2 D
3 A
4 B
5 C
6 D
7 B
8 B
9 A
10 A
11 B
12 B
13 B
14 A
15 B
16 B
17 A
18 A
19 A
20 B
21 A
22 A
23 B
24 B
25 A
restful_questions_answers.htm
Advertisements