- 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 III
Q 1 - Which of the following is a best practice for designing a secure RESTful web service?
Answer : C
Explanation
Both of the above options are correct.
Q 2 - Which of the following is a best practice for designing a secure RESTful web service?
Answer : C
Explanation
Both of the above options are correct.
Q 3 - Which of the following is a best practice for designing a secure RESTful web service?
A - Validate Malformed XML/JSON - Check for well formed input passed to a web service method.
Answer : C
Explanation
Both of the above options are correct.
Q 4 - Which of the following HTTP Status code means OK, shows success?
Answer : A
Explanation
HTTP Status Code 200 means OK, shows success.
Q 5 - Which of the following HTTP Status code means CREATED, when a resource is successful created using POST or PUT request?
Answer : B
Explanation
HTTP Status Code 201 means CREATED, when a resource is successful created using POST or PUT request.
Q 6 - Which of the following HTTP Status code means NO CONTENT, when response body is empty for example, a DELETE request?
Answer : C
Explanation
HTTP Status Code 204 means NO CONTENT, when response body is empty for example, a DELETE request.
Q 7 - Which of the following HTTP Status code means NOT MODIFIED, used to reduce network bandwidth usage in case of conditional GET requests?
Answer : D
Explanation
HTTP Status Code 304 means NOT MODIFIED, used to reduce network bandwidth usage in case of conditional GET requests.
Q 8 - Which of the following HTTP Status code means BAD REQUEST, states that invalid input is provided e.g. validation error, missing data?
Answer : A
Explanation
HTTP Status Code 400 means BAD REQUEST, states that invalid input is provided e.g. validation error, missing data.
Q 9 - Which of the following HTTP Status code means FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights?
Answer : B
Explaination
HTTP Status Code 403 means FORBIDDEN, states that user is not having access to method being used for example, delete access without admin rights.
Q 10 - Which of the following HTTP Status code means NOT FOUND, states that method is not available?
Answer : C
Explanation
HTTP Status Code 404 means NOT FOUND, states that method is not available.
Q 11 - Which of the following HTTP Status code means CONFLICT, states conflict situation while executing the method for example, adding duplicate entry?
Answer : D
Explanation
HTTP Status Code 409 means CONFLICT, states conflict situation while executing the method for example, adding duplicate entry.
Q 12 - Which of the following HTTP Status code means INTERNAL SERVER ERROR, states that server has thrown some exception while executing the method?
Answer : A
Explanation
HTTP Status Code 500 means INTERNAL SERVER ERROR, states that server has thrown some exception while executing the method.
Q 13 - What JAX-RS stands for?
A - Just API for RESTful Web Services.
B - Joint API for RESTful Web Services.
Answer : C
Explanation
JAX-RS stands for JAVA API for RESTful Web Services.
Q 14 - Which of the following is correct about JAX-RS?
Answer : C
Explanation
Both of the above options are correct.
Q 15 - Which of the following is correct about JAX-RS?
B - It also provides supports for creating clients for RESTful web services.
Answer : C
Explanation
Both of the above options are correct.
Q 16 - Which of the following annotation of JAX RS API is used to annotate a method to get the relative path of the resource class/method?
Answer : A
Explanation
@Path - Relative path of the resource class/method.
Q 17 - Which of the following annotation of JAX RS API is used to annotate a method used to fetch resource?
Answer : B
Explanation
@GET − HTTP Get request, used to fetch resource.
Q 18 - Which of the following annotation of JAX RS API is used to annotate a method used to create resource?
Answer : C
Explanation
@PUT − HTTP Get request, used to create resource.
Q 19 - Which of the following annotation of JAX RS API is used to annotate a method used to create/update resource?
Answer : D
Explanation
@POST − HTTP Get request, used to create/update resource.
Q 20 - Which of the following annotation of JAX RS API is used to annotate a method used to delete resource?
Answer : A
Explanation
@DELETE − HTTP Get request, used to delete resource.
Q 21 - Which of the following annotation of JAX RS API is used to get status of method availability?
Answer : B
Explanation
@HEAD − HTTP HEAD request, used to get status of method availability.
Q 22 - Which of the following annotation of JAX RS API states the HTTP Response generated by web service?
Answer : C
Explanation
@Produces − States the HTTP Response generated by web service, for example APPLICATION/XML, TEXT/HTML, APPLICATION/JSON etc.
Q 23 - Which of the following annotation of JAX RS API states the HTTP Request type?
Answer : D
Explanation
@Consumes − States the HTTP Request type, for example application/x-www-form-urlencoded to accept form data in HTTP body during POST request.
Q 24 - Which of the following annotation of JAX RS API binds the parameter passed to method to a value in path?
Answer : A
Explanation
@PathParam − Binds the parameter passed to method to a value in path.
Q 25 - Which of the following annotation of JAX RS API binds the parameter passed to method to a query parameter in path?
Answer : B
Explanation
@QueryParam − Binds the parameter passed to method to a query parameter in path.
Answer Sheet
Question Number | Answer Key |
---|---|
1 | C |
2 | C |
3 | C |
4 | A |
5 | B |
6 | C |
7 | D |
8 | A |
9 | B |
10 | C |
11 | D |
12 | A |
13 | C |
14 | C |
15 | C |
16 | A |
17 | B |
18 | C |
19 | D |
20 | A |
21 | B |
22 | C |
23 | D |
24 | A |
25 | B |