Prepare Interview

Exams Attended

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address
Check our LIVE MOCK INTERVIEWS

REST API Interview Questions and Answers

Intermediate / 1 to 5 years experienced level questions & answers

Ques 1. Why is it simple to scale REST services?

Due to their statelessness, which prevents them from storing data from the server even since they are requested, REST services are scalable.

Is it helpful? Add Comment View Comments
 

Ques 2. How big of a payload can you send using POST methods?

There isn't, theoretically, a cap on the size of the payload that can be transmitted via POST methods. Larger payloads, however, may require more bandwidth. As a result, processing the request by the server can take longer.

Is it helpful? Add Comment View Comments
 

Ques 3. What does the REST API's caching do?

In order to quickly obtain a server answer in the future, REST API maintains a copy of the response in a specific region of computer memory. Catching is the term for this brief technique.

Is it helpful? Add Comment View Comments
 

Ques 4. What distinguishes REST and SOAP from one another?

REST(Representational State Transfer): 

  • It is a web service development architectural design pattern.
  • It is more cacheable and speedier in speed.
  • It just takes on the protocol-specific security measures that have been put in place.

SOAP (Simple Object Access Protocol): 

  • It is a stringent protocol that is used to provide safe APIs.\
  • It is not cacheable and moves more slowly.
  • It can specify its own security precautions.

For more differences please check here: REST vs SOAP

Is it helpful? Add Comment View Comments
 

Ques 5. What are a few REST's flaws?

Statelessness is an advantage of REST, but it can also be a drawback.

State is not preserved through REST. In those other words, the server doesn't save a history of previous communications. If maintaining state is required, the client is responsible for doing so.

Developers must exercise caution and only use APIs from reliable, authentic providers as REST has less stringent security controls than SOAP. REST is therefore a bad choice for transmitting private data among servers and clients.

Is it helpful? Add Comment View Comments
 

Ques 6. Mention a few of REST's most important attributes.

REST has a number of important features, including

  • Because REST is stateless, the SERVER has had no state or session data
  • The server might be resumed in between calls thanks to a well-implemented REST API because all data is sent to the server.
  • While REST uses GET to access services, web services often employ POST to carry out tasks.

Is it helpful? Add Comment View Comments
 

Ques 7. What do Web API Media type formatters do?

The Web API's Media type formatter includes:

  • The foundation class used to handle serializing and deserializing solid objects is called MediaTypeFormatter.
  • BufferedMediaTypeFormatter is an utility class that enables asynchronous formatters on top of the infrastructure for asynchronous formatters.

Is it helpful? Add Comment View Comments
 

Ques 8. Please tell most commonly used HTTP status codes.

  • 200 - success/OK
  • 201 - CREATED - used in POST or PUT methods.
  • 304 - NOT MODIFIED - used in conditional GET requests to reduce the bandwidth use of the network. Here, the body of the response sent should be empty.
  • 400 - BAD REQUEST - This can be due to validation errors or missing input data.
  • 401- UNAUTHORIZED - This is returned when there is no valid authentication credentials sent along with the request.
  • 403 - FORBIDDEN - sent when the user does not have access (or is forbidden) to the resource.
  • 404 - NOT FOUND - Resource method is not available.
  • 500 - INTERNAL SERVER ERROR - server threw some exceptions while running the method.
  • 502 - BAD GATEWAY - Server was not able to get the response from another upstream server.

Is it helpful? Add Comment View Comments
 

Ques 9. How does HTTP Basic Authentication work?

While implementing Basic Authentication as part of APIs, the user must provide the username and password which is then concatenated by the browser in the form of “username: password” and then perform base64 encoding on it.

The encoded value is then sent as the value for the “Authorization” header on every HTTP request from the browser. Since the credentials are only encoded, it is advised to use this form when requests are sent over HTTPS as they are not secure and can be intercepted by anyone if secure protocols are not used.

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

Related differences

GraphQL vs RESTful Web Services (REST API)RESTful Web Services (REST API) vs gRPC

Related interview subjects

REST API interview questions and answers - Total 52 questions
Unix interview questions and answers - Total 105 questions
SDLC interview questions and answers - Total 75 questions
Apache Kafka interview questions and answers - Total 38 questions
Language in C interview questions and answers - Total 80 questions
ANT interview questions and answers - Total 10 questions
Nature interview questions and answers - Total 20 questions
Ruby On Rails interview questions and answers - Total 74 questions
Business Analyst interview questions and answers - Total 40 questions
HTML interview questions and answers - Total 27 questions
Hadoop interview questions and answers - Total 40 questions
iOS interview questions and answers - Total 52 questions
HR Questions interview questions and answers - Total 49 questions
C++ interview questions and answers - Total 142 questions
Cryptography interview questions and answers - Total 40 questions
JSON interview questions and answers - Total 16 questions
CSS interview questions and answers - Total 74 questions
XML interview questions and answers - Total 25 questions
Ethical Hacking interview questions and answers - Total 40 questions
Android interview questions and answers - Total 14 questions
ChatGPT interview questions and answers - Total 20 questions
Data Structures interview questions and answers - Total 49 questions
Zend Framework interview questions and answers - Total 24 questions
Fashion Designer interview questions and answers - Total 20 questions
©2023 WithoutBook