Sign in to unlock

Get unlimited access to all questions and answers


Get lifetime access


Track progress


Save time

Top 46 API Design interview questions and answers for developers

Web api is an application programming interface ('API') is a computing interface that defines interactions between multiple software intermediaries. Check our list of essential rest api design interview questions and answers that will trend on Design patterns & System Architecture interviews in 2021.

  • 1.

    What REST stands for?


    REST stands for REpresentational State Transfer. REST is web standards based architecture and uses HTTP Protocol for data communication. It revolves around resource where every component is a resource and a resource is accessed by a common interface using HTTP standard methods. REST was first introduced by Roy Fielding in 2000.

    In REST architecture, a REST Server simply provides access to resources and REST client accesses and presents the resources. Here each resource is identified by URIs/ global IDs. REST uses various representations to represent a resource like text, JSON and XML. Now a days JSON is the most popular format being used in web services.

  • 2.

    What are the core components of a HTTP Request?


    A HTTP Request has five major parts −

    • Verb − Indicate HTTP methods such as GET, POST, DELETE, PUT etc.
    • URI − Uniform Resource Identifier (URI) to identify the resource on server.
    • HTTP Version − Indicate HTTP version, for example HTTP v1.1 .
    • 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.
    • Request Body − Message content or Resource representation.
  • 3.

    Define what is SOA


    A Service Oriented Architecture (SOA) is basically defined as an architectural pattern consisting of services. Here application components provide services to the other components using communication protocol over the network. This communication involves data exchanging or some coordination activity between services.

    Some of the key principles on which SOA is based are mentioned below

    • The service contract should be standardized containing all the description of the services.
    • There is loose coupling defining the less dependency between the web services and the client.
    • It should follow Service Abstraction rule, which says the service should not expose the way functionality has been executed to the client application.
    • Services should be reusable in order to work with various application types.
    • Services should be stateless having the feature of discoverability.
    • Services break big problems into little problems and allow diverse subscribers to use the services.
  • 4.

    What are advantages of REST web services?


    Some of the advantages of REST web services are:

    • Learning curve is easy since it works on HTTP protocol
    • Supports multiple technologies for data transfer such as text, xml, json, image etc.
    • No contract defined between server and client, so loosely coupled implementation.
    • REST is a lightweight protocol
    • REST methods can be tested easily over browser.
  • 5.

    Mention some key characteristics of REST?


    Some key characteristics of REST includes

    • REST is stateless, therefore the SERVER has no state (or session data)
    • With a well-applied REST API, the server could be restarted between two calls as every data is passed to the server
    • Web service mostly uses POST method to make operations, whereas REST uses GET to access resources
  • 6.

    Mention whether you can use GET request instead of PUT to create a resource?


    No, you are not supposed to use POST or GET. GET operations should only have view rights

  • 7.

    What is cached response?


    Caching refers to storing server response in client itself so that a client needs not to make server request for same resource again and again. A server response should have information about how a caching is to be done so that a client caches response for a period of time or never caches the server response.

  • 8.

    What are different types of Web Services?


    There are two types of web services:

    • SOAP Web Services: Runs on SOAP protocol and uses XML technology for sending data.
    • Restful Web Services: It’s an architectural style and runs on HTTP/HTTPS protocol almost all the time. REST is a stateless client-server architecture where web services are resources and can be identified by their URIs. Client applications can use HTTP GET/POST methods to invoke Restful web services.
  • 9.

    Mention what are resources in a REST architecture?


    Resources are identified by logical URLs; it is the key element of a RESTful design. Unlike, SOAP web services in REST, you view the product data as a resource and this resource should contain all the required information.

  • 10.

    Explain the architectural style for creating web API?


    The architectural style for creating web api are

    • HTTP for client server communication
    • XML/JSON as formatting language
    • Simple URI as the address for the services
    • Stateless communication
  • 11.

    What are the advantages of Web Services?


    Some of the advantages of web services are:

    • Interoperability: Web services are accessible over network and runs on HTTP/SOAP protocol and uses XML/JSON to transport data, hence it can be developed in any programming language. Web service can be written in java programming and client can be PHP and vice versa.
    • Reusability: One web service can be used by many client applications at the same time.
    • Loose Coupling: Web services client code is totally independent with server code, so we have achieved loose coupling in our application.
    • Easy to deploy and integrate, just like web applications.
    • Multiple service versions can be running at same time.
  • 12.

    What is SOAP?


    SOAP stands for Simple Object Access Protocol. SOAP is an XML based industry standard protocol for designing and developing web services. Since it’s XML based, it’s platform and language independent. So our server can be based on JAVA and client can be on .NET, PHP etc. and vice versa.

One tip that got me hired by Google, Microsoft, and Stripe

I've worked for Microsoft, Google, Stripe, and received offers from many other companies. One thing I learned when I was interviewing myself is that standard interview tips are woefully inadequate.

Reverse Tech Interview: Questions to Stump an Interviewer

Few people want to get into an uncomfortable environment or an unprofitable company with no prospects. If you’re wondering how to get a real feel for a company during an interview, you’re welcome. I’ll give a list of questions that interviewers don’t usually expect...

How to become a programmer, move to the US, and get a dream job

Are you curious about what you need to do to earn more than $15.000 a month, drive a Tesla, live in sunny California, and work at Google, Apple, Facebook, or Amazon?

11 Reactive Systems interview questions and answers for software engineers

Reactive systems are an architectural style that allows multiple individual applications to blend into one unit, reacting to their environment, while staying aware of each other. Here is a list of coding interview questions on Reactive Systems to help you get ready for your next data struc...

. Reactive Systems
34 Microservices interview questions and answers for software engineers

Microservice architecture – a variant of the service-oriented architecture structural style – arranges an application as a collection of loosely coupled services. In a microservices architecture, services are fine-grained and the protocols are lightweight. Here is a list of coding intervie...

. Microservices
7 Layering & Middleware interview questions for developers

Middleware in the context of distributed applications is software that provides services beyond those provided by the operating system to enable the various components of a distributed system to communicate and manage data. Middleware supports and simplifies complex distributed application...

. Layering & Middleware
55 Docker interview questions and answers for software engineers

Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. Here is a list of coding interview questions on Docker to help you get ready for your next data structures interview in 2021.

. Docker
23 Databases interview questions and answers for software engineers

A database is an organized collection of data, generally stored and accessed electronically from a computer system. Where databases are more complex they are often developed using formal design and modeling techniques. Here is a list of coding interview questions on Databases to help you g...

. Databases
21 Concurrency interview questions and answers for software engineers

In computer science, concurrency is the ability of different parts or units of a program, algorithm, or problem to be executed out-of-order or in partial order, without affecting the final outcome. Here is a list of coding interview questions on Concurrency to help you get ready for your n...

. Concurrency
13 CAP Theorem interview questions and answers for software engineers

In theoretical computer science, the CAP theorem, also named Brewer's theorem after computer scientist Eric Brewer, states that it is impossible for a distributed data store to simultaneously provide more than two out of the following three guarantees: Consistency: Every read receives the ...

. CAP Theorem
Load more posts


folder icon

Access all answers

Get the inside track on what to expect in your next tech interview. We offer you a collection of high quality technical interview questions to help you prepare for your next coding interview.

graph icon

Track progress

A smart interface helps you track your progress and focus on the topics you need. You can search through questions or sort them by difficulty or type.

clock icon

Save time

Save tens of hours searching for information on hundreds of low-quality sites designed to drive traffic and make money from advertising.

Land a six-figure job at one of the top companies.

amazon logo facebook logo google logo microsoft logo uber logo
Prepare for a technical interview

Get hired with our
tech interview questions & answers