Common Backend Interview Questions
Common Backend Interview Questions
A payload refers to the data sent with a request or response. In a REST API,
request payload can be in the form of JSON, XML, or other formats. The
payload contains the information necessary for the server or client to
process the message.
REST messages consist of requests from clients to servers and responses from
servers to clients. A REST message often contains an HTTP method, headers,
URI, and payload.
● Status Line: Contains the protocol version, status code, and status
description.
● Headers: Metadata associated with the response.
● Body: The data being returned from the server.
Idempotent methods are those that have no additional effect if called more
than once with the same input parameters. They are crucial for reliability
and consistency, particularly in network environments where failures are
commonplace.
Middleware functions are those that have access to the request object,
response object, and the next function in the application's request-response
cycle. They can execute any code, modify the request and response objects,
end the request-response cycle, or call the next function in the stack.
The CAP theorem states that it's impossible for a distributed data store to
simultaneously provide more than two out of the following three guarantees:
Consistency, Availability, and Partition tolerance.
22. What are the Different Types of Database Indexes and How Do They
Work?
Indexes are database structures that improve query speed. Types include:
24. What Strategies Would You Use for Efficient Logging and Monitoring
in Distributed Systems?