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 I

Answer : B

Explanation

REST stands for REpresentational State Transfer.

Q 4 - Which of the following is not a valid HTTP methods used in RESTful web services?

A - GET

B - PUT

C - TIME

D - POST

Answer : C

Explanation

TIME is not a HTTP Verb and is not a valid HTTP methods used in RESTful web services.

Q 5 - Which of the following is not a valid HTTP methods used in RESTful web services?

A - OPTIONS

B - DELETE

C - DATE

D - POST

Answer : C

Explanation

DATE is not a HTTP Verb and is not a valid HTTP methods used in RESTful web services.

Answer : C

Explanation

A web service is a collection of open protocols and standards used for exchanging data between applications or systems. Software applications written in various programming languages and running on various platforms can use web services to exchange data over computer networks like the Internet in a manner similar to inter-process communication on a single computer.

Answer : D

Explanation

Web services based on REST Architecture are known as RESTful web services. These web services use HTTP methods to implement the concept of REST architecture. A RESTful web service usually defines a URI, Uniform Resource Identifier a service, provides resource representation such as JSON and set of HTTP Methods.

Answer : C

Explanation

REST uses various representations to represent a resource where text, JSON, XML. XML and JSON are the most popular representations of resources.

Answer : B

Explanation

Completeness: Format should be able to represent a resource completely. For example, a resource can contain another resource. Format should be able to represent simple as well as complex structures of resources.

Q 12 - Which of the following protocol is used by RESTful web services as a medium of communication between client and server?

A - HTTP

B - FTP

C - Gopher

D - None of the above.

Answer : A

Explanation

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

Answer : C

Explanation

A client sends a message in form of a HTTP Request and server responds in form of a HTTP Response. This technique is termed as Messaging. These messages contain message data and metadata i.e. information about message itself.

Q 14 - Which of the following component of HTTP request indicates HTTP methods such as GET, POST, DELETE, PUT etc.?

A - VERB

B - URI

C - HTTP Version

D - Request Header

Answer : A

Explanation

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

Q 15 - Which of the following component of HTTP request is used to identify the resource on server?

A - VERB

B - URI

C - HTTP Version

D - Request Header

Answer : B

Explanation

URI − Uniform Resource Identifier (URI) to identify the resource on server.

Q 16 - Which of the following component of HTTP request is used to indicate HTTP version?

A - VERB

B - URI

C - HTTP Version

D - Request Header

Answer : C

Explanation

HTTP Version − Indicate HTTP version, for example HTTP v1.1 .

Q 17 - Which of the following component of HTTP request contains metadata for the HTTP Request message as key-value pairs?

A - VERB

B - URI

C - HTTP Version

D - Request Header

Answer : D

Explanation

Request Header − Contains metadata for the HTTP Request message as key-value pairs. For example, client ( or browser) type, format supported by client, format of message body, cache settings etc.

Q 18 - Which of the following component of HTTP request contains message content or Resource representation?

A - Request Body

B - URI

C - HTTP Version

D - Request Header

Answer : A

Explanation

Request Body − Message content or Resource representation.

Q 19 - Which of the following component of HTTP response indicates server status for the requested resource?

A - Status/Response Code

B - HTTP Version

C - Response Header

D - Response Body

Answer : A

Explanation

Status/Response Code − Indicate Server status for the requested resource. For example 404 means resource not found and 200 means response is ok.

Q 20 - Which of the following component of HTTP response indicates HTTP version?

A - Status/Response Code

B - HTTP Version

C - Response Header

D - Response Body

Answer : B

Explanation

HTTP Version − Indicate HTTP version, for example HTTP v1.1 .

Q 21 - Which of the following component of HTTP response contains metadata for the HTTP Response message as key-value pairs?

A - Status/Response Code

B - HTTP Version

C - Response Header

D - Response Body

Answer : C

Explanation

Response Header − Contains metadata for the HTTP Response message as key-value pairs. For example, content length, content type, response date, server type etc.

Q 22 - Which of the following component of HTTP response contains response message content or Resource representation?

A - Status/Response Code

B - HTTP Version

C - Response Header

D - Response Body

Answer : D

Explanation

Response Body − Response message content or Resource representation.

Answer : C

Explanation

Addressing refers to locating a resource or multiple resources lying on the server. It is analogous to locate a postal address of a person.

Answer : C

Explanation

URI stands for Uniform Resource Identifier. Each resource in REST architecture is identified by its URI.

Answer : C

Explanation

Each resource in REST architecture is identified by its URI. Purpose of an URI is to locate a resource(s) on the server hosting the web service.

Answer Sheet

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