- RESTful Tutorial
- RESTful - Home
- RESTful - Introduction
- RESTful - Environment Setup
- RESTful - First Application
- RESTful - Resources
- RESTful - Messages
- RESTful - Addressing
- RESTful - Methods
- RESTful - Statelessness
- RESTful - Caching
- RESTful - Security
- RESTful - Java (JAX-RS)
- RESTful Useful Resources
- RESTful - Questions and Answers
- RESTful - Quick Guide
- RESTful - Useful Resources
- RESTful - Discussion
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.
RESTful Mock Test II
Q 1 - Which of the following is a best practice to create a standard URI for a web service?
Answer : D
Explanation
All of the above options are correct.
Q 2 - Which of the following is a best practice to create a standard URI for a web service?
Answer : C
Explanation
Both of the above options are correct.
Q 3 - Which of the following is correct about statelessness in context of RESTful web service?
A - As per REST architecture, a RESTful web service should not keep a client state on server.
Answer : C
Explanation
Both of the above options are correct.
Q 4 - Which of the following is advantage of RESTful web service being stateless?
A - Web services can treat each method request independently.
Answer : D
Explanation
All of the above options are correct.
Q 5 - Which of the following HTTP method should be idempotent in nature?
Answer : B
Explanation
PUT opearations should be idempotent, means their result will always same no matter how many times these operations are invoked.
Q 6 - Which of the following HTTP method should be idempotent in nature?
Answer : B
Explanation
DELETE opearations should be idempotent, means their result will always same no matter how many times these operations are invoked.
Q 7 - Which of the following HTTP method should be read only in nature?
Answer : A
Explanation
GET opearations should be read only.
Q 8 - Which of the following HTTP method should be used to create/update resource using RESTful web service?
Answer : C
Explanation
POST opearations should be used to create/update resource using RESTful web service.
Q 9 - Which of the following HTTP method should be used to delete resource using RESTful web service?
Answer : B
Explanation
DELETE opearations should be used to delete resource using RESTful web service.
Q 10 - Which of the following HTTP method should be used to create resource using RESTful web service?
Answer : C
Explanation
PUT opearations should be used to create resource using RESTful web service.
Q 11 - Which of the following HTTP method should be used to fetch resource using RESTful web service?
Answer : A
Explanation
GET opearations should be used to fetch resource using RESTful web service.
Q 12 - Which of the following HTTP method should be used to get status of method availability in RESTful web service?
Answer : B
Explanation
HEAD opearations should be used to get status of method availability in RESTful web service.
Q 13 - Which of the following HTTP method should be used to get list the supported operations in RESTful web service?
Answer : D
Explanation
OPTIONS opearations should be used to get list the supported operations in RESTful web service.
Q 14 - Which of the following is true about caching in RESTful web service?
Answer : C
Explanation
Both of the above options are correct.
Q 15 - Which of the following header of HTTP response, provides the date and time of the resource when it was created?
Answer : A
Explanation
Date header provides the date and time of the resource when it was created.
Q 16 - Which of the following header of HTTP response, provides the date and time of the resource when it was last modified?
Answer : B
Explanation
Last Modified header provides the date and time of the resource when it was last modified.
Q 17 - Which of the following header of HTTP response provides control over caching?
Answer : C
Explanation
Cache-Control is the primary header to control caching.
Q 18 - Which of the following header of HTTP response sets expiration date and time of caching?
Answer : D
Explanation
Expires header sets expiration date and time of caching.
Q 19 - Which of the following directive of Cache Control Header of HTTP response indicates that resource is cachable by any component?
Answer : A
Explanation
Public directive indicates that resource is cachable by any component.
Q 20 - Public directive of Cache Control Header of HTTP response indicates that resource is cachable by any component.
Answer : A
Explanation
Public directive indicates that resource is cachable by any component.
Q 21 - Which of the following directive of Cache Control Header of HTTP response indicates that resource is cachable by only client and server?
Answer : B
Explanation
Private directive indicates that resource is cachable by only client and server, no intermediary can cache the resource.
Q 22 - Which of the following directive of Cache Control Header of HTTP response indicates that resource is not cachable?
Answer : C
Explanation
no-cache/no-store directive indicates that resource is not cachable.
Q 23 - Which of the following directive of Cache Control Header of HTTP response can set the time limit of caching?
Answer : D
Explanation
max-age directive indicates that the caching is valid up to max-age in seconds. After this, client has to make another request.
Q 24 - Which of the following directive of Cache Control Header of HTTP response provides indication to server to revalidate resource if max-age has passed?
Answer : A
Explanation
must-revalidate directive provides indication to server to revalidate resource if max-age has passed.
Q 25 - Which of the following is a best practice for caching in RESTful web service?
B - Never keep expiry date too high.
Answer : D
Explanation
All of the above options are correct.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | D |
2 | C |
3 | C |
4 | D |
5 | B |
6 | B |
7 | A |
8 | C |
9 | B |
10 | C |
11 | A |
12 | B |
13 | D |
14 | C |
15 | A |
16 | B |
17 | C |
18 | D |
19 | A |
20 | A |
21 | B |
22 | C |
23 | D |
24 | A |
25 | D |