API styles
How two programs agree to talk: resource-oriented requests, remote procedure calls, client-shaped queries and server push. Interviewers check that you pick a style for a reason, not out of habit.
on this pageshowhide
guide
overview
~2 minAPI styles are the choices you make about how two programs talk: who starts the conversation, who decides what comes back, how long the connection lives, and which document states the agreement. Interviewers probe this area to see whether you pick a style for a reason. A candidate who answers every brief with REST, or every "live" requirement with a socket, has shown a habit rather than a judgement. The stronger answer names the requirement doing the choosing (browser clients, many internal services, a one-way feed, an AI agent calling tools) and the cost the chosen style brings with it. The sections fall into four groups. Request/response over HTTP: [REST](/topics/proto-rest), the default most candidates claim and few apply fully; [GraphQL](/topics/proto-graphql), which hands control of the response shape to the client; and [OData](/topics/proto-odata), a standardised query layer over REST. The remote-call family: the general [RPC](/topics/proto-rpc) idea and the failures its local illusion hides, [gRPC](/topics/proto-grpc) as the contract-first choice between internal services, [SOAP](/topics/proto-soap) where legacy and regulated integrations still depend on it, and the [Model Context Protocol](/topics/proto-mcp) that connects LLM applications to tools. Push and realtime: [WebSockets](/topics/proto-websockets), [Server-Sent Events](/topics/proto-sse) and [WebRTC](/topics/proto-webrtc), with the transport-agnostic [realtime delivery patterns](/topics/found-system-design-realtime-fanout) that system-design rounds actually grade. Finally, the contract format: [OpenAPI](/topics/proto-openapi), with the Swagger tooling that renders and generates from it. Start with the HTTP semantics REST rests on (methods, status codes, idempotency, statelessness), because every other style is explained partly by how it departs from them. Then learn one contract format, one RPC framework and one push mechanism well enough to compare them rather than recite them. Questions run from a junior choosing between PUT and PATCH to a principal weighing schema federation or a plan for scaling held connections. GraphQL, REST and MCP carry the most depth; the realtime sections are where system-design questions land.
primer
A few ideas cut across every style in this hub. Hold them and each protocol becomes one particular set of answers to the same questions. - **A style is a bundle of decisions, not a technology.** Who initiates (the client only, or either side), who shapes the response (the server's fixed resource, or the client's selection), how long a connection lives (one exchange, or hours), and how tightly the two ends share a schema. REST, GraphQL, gRPC and WebSockets are different combinations of those answers, and comparing them means comparing the combinations. - **The contract is the real product.** Most styles have an artifact that states what a client may send and what it will get back: URIs with methods and status codes, a GraphQL schema, a Protocol Buffers service definition, an OpenAPI document, a WSDL file, a tool's JSON Schema. Interviewers ask who owns that artifact, whether code is generated from it or it from code, and how it changes without breaking clients already deployed. - **A remote call is not a local call.** Whatever the syntax hides, the network can lose the request, lose the reply, or deliver either late. That is why timeouts, retry policy and idempotency recur in the REST, RPC, gRPC and MCP sections alike: a retry is safe only when repeating the operation cannot repeat its effect, and a caller that waits forever turns one slow dependency into an outage. - **Whoever shapes the response inherits its cost.** When the server fixes the representation, HTTP caches, CDNs and rate limits work on URLs with little extra effort. When the client chooses fields, as with GraphQL selections or OData query options, over- and under-fetching shrink, but caching, query cost limits and batching become the server's problem to solve deliberately. - **Held connections change the operational model.** A stateless request can go to any instance; a socket or an event stream belongs to one instance for its whole life. The hard questions move to authentication after the connection opens, detecting dead peers, resuming after a drop, slow consumers, and fanning one message out across many nodes. The protocol supplies the pipe; delivery guarantees are yours to build. - **Intermediaries are part of the protocol.** Almost every style rides HTTP, so proxies, load balancers, caches and browsers sit on the path and apply their own rules: buffering, header handling, idle timeouts, what a page's script is allowed to set. Many of the harder questions here describe an intermediary doing exactly what it was built to do. - **Errors need a place in the contract.** HTTP status codes, gRPC status codes, a GraphQL errors list beside partial data, and tool-level failures in MCP are distinct error channels. Knowing which layer reports which failure, and designing error bodies a client can act on, separates an API that can be debugged from one that answers 200 to everything.
- Resource
- The thing a REST API names with a URI and exposes through representations; the unit that methods act on and that caches store.
- Safe method
- An HTTP method whose request is not meant to change server state, which is what lets crawlers, caches and prefetchers issue it freely.
- Idempotent operation
- An operation that ends in the same server state whether it runs once or several times, which is what makes a blind retry after a timeout safe.
- Idempotency key
- A unique client-generated value sent with a non-idempotent request so the server can recognise a retry and return the first result instead of acting twice.
- Application state
- The client's position in a multi-step interaction. REST keeps it in each request rather than in server memory; the durable data an API stores is a different thing.
- Interface definition language
- A language-neutral way to declare services, methods and message types, from which stubs and serializers are generated; Protocol Buffers' schema language is the common example.
- Stub
- Generated client-side code that exposes a remote operation as an ordinary function call, handling serialization and transport underneath.
- GraphQL schema
- The typed description of every object, field and entry point a GraphQL service exposes; a client may ask only for what it declares.
- Resolver
- The function a GraphQL server runs to produce one field's value, invoked for every object that field is selected on.
- N+1 problem
- One call to fetch a list followed by one further call per item for related data; the typical performance defect of naive per-field resolution.
- Deadline
- An absolute point in time by which a caller needs an answer, passed along a chain of calls so downstream work can stop once nobody is waiting.
- Long polling
- A request the server holds open until it has something to report or a hold period ends, giving near-push latency over ordinary HTTP.
- Full duplex
- A connection on which both ends may send at any moment, independently of each other, as on a WebSocket; contrasted with one-way streams and strict request/response.
- Backpressure
- Signalling or policy that stops a fast producer overwhelming a slow consumer, by slowing it, buffering, dropping messages or disconnecting.
- Fan-out
- Delivering one published message to every subscriber interested in it, often across many server nodes that each hold different connections.
- Signaling
- The exchange, over a channel the application chooses, in which WebRTC peers trade session descriptions and network candidates before connecting directly.
- JSON-RPC
- A transport-independent remote-call format: a request names a method, params and an id, a notification omits the id, and a response echoes the id with a result or an error; MCP's message layer.
The sections are easier to learn as families than as a list, because each family answers the same question differently and interviewers usually ask you to compare within one. ### Request/response over HTTP [REST](/topics/proto-rest) sets the baseline: resources named by URIs, HTTP methods as the verbs, status codes as outcomes, and statelessness that lets any instance answer. [OData](/topics/proto-odata) keeps that model and standardises how a client filters, projects and expands it, with a metadata document for discovery. [GraphQL](/topics/proto-graphql) leaves resource URLs behind for one typed schema that a client queries field by field; its sections on batching, caching and security are largely about paying back what that flexibility costs. [OpenAPI](/topics/proto-openapi) describes HTTP APIs in a machine-readable form; Swagger, its name before 3.0, now labels only the tooling that edits, renders and generates from it, a distinction interviewers do check. ### Calling a procedure [RPC](/topics/proto-rpc) is the underlying idea: a stub makes a remote function look local, and the failure semantics are what that illusion hides. [SOAP](/topics/proto-soap) is the XML, WSDL-described generation of it, still the incumbent in many enterprise integrations. [gRPC](/topics/proto-grpc) is the common internal-service answer: a schema generates both ends, calls share long-lived HTTP/2 connections, and streaming is part of the method definition. The [Model Context Protocol](/topics/proto-mcp) applies [JSON-RPC](/topics/proto-rpc-json-rpc) to one specific job, letting an LLM application discover and invoke tools, data and prompts, and its security section is about the fact that a model, not a person, chooses the calls. ### Pushing data to the client Polling is the baseline every push mechanism is measured against; its trade-offs sit inside the [WebSockets](/topics/proto-websockets) section. [Server-Sent Events](/topics/proto-sse) stream one way over an ordinary HTTP response; WebSockets give either side the right to send at any time; [WebRTC](/topics/proto-webrtc) goes peer to peer for media and low-latency data but still needs servers to introduce peers and to relay when no direct path exists. Fan-out, presence, backpressure, resumption and ordering sit above all three and are the same problems whichever transport carries the bytes; they are taught in [Real-Time Fanout & Feeds](/topics/found-system-design-realtime-fanout) and [Backpressure](/topics/found-reactive-programming-backpressure), and they are what chat, feed and dashboard design rounds are scored on. The families also meet. GraphQL subscriptions and MCP's HTTP transport ride server-sent streams or sockets, gRPC reaches browsers through a translating layer, and the idempotency and error-design sections of REST describe problems that gRPC, RPC and MCP solve in their own vocabulary.
- HTTP Verbs and Status Codes →
Methods, status codes and the safe versus idempotent distinction are the vocabulary every other style is explained against, so learn them first.
- OpenAPI →
One contract format studied closely shows what an API promises in writing and how a spec becomes generated clients, tests and documentation.
- gRPC →
The contract-first counterpart to REST: generated stubs, streaming method kinds, deadlines and status codes, and the internal-service trade-offs they buy.
- GraphQL →
Client-shaped responses and the problems they create, from resolver fan-out to caching and query cost, make the deepest comparison in this hub.
- Short and Long Polling →
Polling is the baseline every push mechanism is judged against; know what short and long polling cost before reaching for a socket.
- SSE vs WebSockets →
The comparison that settles most live-feature questions: a one-way stream over plain HTTP versus a full-duplex connection you manage yourself.
Picking a style from habit, REST for every API or a WebSocket for anything described as live, without naming the requirement that decided it.
Retrying a non-idempotent call after a timeout with no idempotency key; the first attempt may have succeeded, and the retry repeats its effect.
Calling an API RESTful because it sends JSON over HTTP, while it puts verbs in its paths and answers every outcome with 200.
Presenting GraphQL as a free fix for over-fetching without mentioning resolver fan-out, query cost limits and the URL-keyed caching a single endpoint gives up.
Making remote calls with no timeout or deadline, so one stalled dependency ties up threads and connections in every caller upstream.
Opening a WebSocket for a one-way feed, then hand-building the reconnection and resumption a server-sent stream would have provided.
Authorising a long-lived connection once at open and never again, so an expired token or a revoked permission keeps receiving data.
Forgetting the intermediaries on the path: proxies that buffer streams or drop upgrade headers, and load balancers that close idle connections.
Treating Swagger and OpenAPI as the same thing; one is a specification, the other a set of tools that read and write it.
Shipping a contract change that looks harmless but breaks deployed clients, such as renaming a field, tightening nullability or adding a required input.
Most questions in this hub reduce to one of a few recurring choices. Name the one you are making and the requirement that decides it. - **Server-shaped versus client-shaped responses.** Fixed resources are simple to cache, rate-limit and reason about; client-chosen selections cut round trips and payload size for varied clients, at the price of cost control and caching work on the server. - **Text versus a schema-bound binary encoding.** JSON can be read in a browser tab and inspected with generic tools; a compact binary format with generated types is smaller, cheaper to parse and strictly typed, but opaque without its schema. - **Contract-first versus code-first.** Writing the contract first lets reviewers shape the design before code exists and lets client and server teams work in parallel; generating it from code keeps it current for free but tends to publish whatever the implementation happens to do. - **Pull versus push.** Polling works through nearly any proxy and needs no connection state, but wastes requests and adds latency; push delivers promptly but holds a connection per client and brings reconnection, authentication and scaling work with it. - **One-way versus two-way.** A server-to-client stream covers feeds, notifications and progress updates; full duplex earns its cost when the client also sends a steady flow of messages, as in chat, collaborative editing or games. - **Public versus internal audience.** Browsers, third parties and caches favour plain HTTP, discoverable resources and conservative change; services inside one organisation can afford generated clients, binary encodings and coordinated upgrades. - **Evolving versus versioning.** Additive, backwards-compatible change keeps one contract alive; an explicit new version gives freedom to break things but leaves you running old and new side by side until the last client moves.
Some shapes recur under different names in almost every section. Recognising them lets you answer a question about an unfamiliar protocol by analogy with one you know. - **Make repetition harmless.** Idempotent methods, client-supplied idempotency keys and conditional requests with entity tags all exist so a client can retry after an ambiguous failure without doubling the effect. - **Resume from a position.** Cursor pagination, the event id a server-sent stream replays from, and the resume token of a reconnecting realtime client share one idea: the client holds a marker, and the server continues from it instead of starting over. - **Batch to stop fan-out.** Batching loaders under GraphQL resolvers, OData batch requests and bulk REST endpoints answer the same problem: many small calls where one larger one would do. - **Describe once, generate both ends.** Protocol Buffers definitions, OpenAPI documents, WSDL files and GraphQL schemas each let a toolchain produce clients, server skeletons, validation and documentation from a single source. - **Keep the outcome apart from the transport status.** A gRPC status in trailers, a GraphQL errors list next to partial data, and an MCP tool result flagged as an error each carry the real result somewhere other than the HTTP status line. - **Prove the peer is alive.** Ping and pong frames, presence heartbeats and health-check services exist because an open connection or a listening port says little about whether the other side can still do work.
explore
- REST120 questions
- Resources and URIs16 questions
- HTTP Verbs and Status Codes22 questions
- Statelessness9 questions
- Caching and Conditional Requests12 questions
- API Versioning9 questions
- HATEOAS10 questions
- Pagination, Filtering, and Field Selection13 questions
- Error Design16 questions
- Concurrency and Idempotency13 questions
- GraphQL (has its own guide)394 questions
- Type System & SDL38 questions
- Operations & Documents34 questions
- Execution & Resolvers29 questions
- Batching & the N+1 Problem19 questions
- Caching & Persisted Queries32 questions
- Federation & Composition43 questions
- Errors & Null Propagation28 questions
- Pagination & Object Identity30 questions
- Schema Design & Evolution37 questions
- Security & Abuse Control37 questions
- Transports & Subscriptions35 questions
- Tooling & Observability32 questions
- gRPC45 questions
- Service Definitions and Stubs5 questions
- Call Types and Streaming5 questions
- HTTP/2 Transport Layer6 questions
- Deadlines and Metadata7 questions
- Interceptors and Middleware5 questions
- Load Balancing and Discovery7 questions
- Browser Clients and Trailers5 questions
- Reflection and Health Checking5 questions
- SOAP31 questions
- Envelope and Faults5 questions
- WSDL Contracts5 questions
- Bindings and Message Encoding6 questions
- WS-Security6 questions
- WS-* Extensions4 questions
- SOAP vs REST Trade-offs5 questions
- Remote Procedure Calls23 questions
- Stubs, Marshalling and Dispatch6 questions
- Invocation Semantics Under Failure6 questions
- JSON-RPC 2.06 questions
- Choosing an Interface Paradigm5 questions
- OData33 questions
- Entity Data Model6 questions
- Metadata Document5 questions
- System Query Options6 questions
- URL and HTTP Conventions6 questions
- Batch Requests5 questions
- Version Lineage and Migration5 questions
- WebSockets (has its own guide)45 questions
- HTTP Upgrade Handshake4 questions
- Extended CONNECT Bootstrap5 questions
- Frame Format and Masking5 questions
- Bidirectional Messaging6 questions
- Subprotocols and Extensions5 questions
- Ping/Pong and Close4 questions
- Origin, TLS, and Proxies5 questions
- Short and Long Polling5 questions
- Connection Authentication6 questions
- Server-Sent Events (has its own guide)33 questions
- Wire Format5 questions
- Client Tolerance Rules4 questions
- Retry and Resumption5 questions
- Holding the Response Open5 questions
- SSE vs WebSockets5 questions
- Proxy and Buffering Pitfalls5 questions
- Authenticating the Stream4 questions
- Model Context Protocol (MCP)116 questions
- Hosts, Clients & Servers14 questions
- Request Metadata and Discovery16 questions
- Server Primitives17 questions
- Interaction Patterns10 questions
- Transports17 questions
- Server-Requested Sampling11 questions
- Security Model21 questions
- Optional Extensions10 questions
- OpenAPI32 questions
- Spec Structure5 questions
- Schema Objects6 questions
- Parameters & Request Body5 questions
- Security Schemes5 questions
- Reuse & $ref5 questions
- Codegen & Tooling6 questions
- WebRTC26 questions
- Peer Connection Model4 questions
- Signaling and SDP Offer/Answer6 questions
- ICE, STUN and TURN6 questions
- Data Channels vs Tracks5 questions
- Mesh, SFU and MCU5 questions
→ has its own guide
- AI Red Teamingroleanchors this topic
- API Designskillanchors this topic
- Forward Deployed Engineerroleanchors this topic
- Server-Side Game Developerroleanchors this topic
- Software Architectroleanchors this topic
- AI Agentsskill
- AI Engineerrole
- API Testingskill
- Android Developerrole
- Backend Developerrole
- Computer Scienceskill
- Frontend Developerrole
- Full Stack Developerrole
- GraphQLskill
- Java Backend Developerrole
- Java SDETrole
- Kotlin Backend Developerrole
- MLOps Engineerrole
- QA Engineerrole
- iOS Developerrole
questions
898 · 11 sectionsREST lists 'cacheable' as one of its architectural constraints. What does that constraint actually require of an API's responses, and which responses in a typical HTTP API can be cached at all?
basics
~20 sIt requires every response to say, implicitly or explicitly, whether it may be reused and for how long. In practice GET and HEAD responses are the cacheable ones; POST responses only with explicit freshness; PUT, PATCH and DELETE responses are never cached.
What is the Idempotency-Key HTTP header pattern used by payment and other write APIs, who generates the key, and which requests should carry one?
basics
~20 sThe client generates a unique key (usually a UUID) per logical operation and sends it as the Idempotency-Key request header. The server records the key with the result; if the same key arrives again it returns the stored response instead of re-executing. It makes retrying a POST safe.
Why is it a problem for an HTTP API to return stack traces, SQL fragments, framework class names or internal database identifiers in an error response body, and what do you return instead?
basics
~20 sThose details leak your internals to attackers — stack, framework versions, table names, ID ranges — and are useless to callers. Return a stable code, a safe message and a request id; keep the trace server-side in logs, keyed by that id.
What is the application/problem+json media type defined by RFC 9457, and which members does a problem document define?
basics
~20 sIt is a standard JSON format for HTTP error bodies, media type application/problem+json. Its members are type (a URI identifying the problem kind), title, status, detail and instance — all optional, plus your own extension members.
What does the HTTP Retry-After response header mean, what value formats does it accept, and on which responses should an API send it?
basics
~20 sRetry-After tells the client how long to wait before trying again. It takes either delay seconds (Retry-After: 120) or an HTTP-date. Send it on 429 and 503, and on 3xx redirects that ask the client to wait.
Why does returning the updated object from a GraphQL mutation refresh a normalized client cache?
basics
~20 sA normalized store keys objects by type and id, not by the operation that fetched them. When a mutation's response carries the same id with new field values, the store overwrites that entity, and every view reading it updates.
Why does a normalized client cache store one entry per argument set for a paginated list field?
basics
~20 sA cached field is stored under a key made of the field name plus the arguments it was fetched with, because different arguments mean a different answer. Each page, fetched with a different cursor argument, therefore lands in its own entry.
What does a normalized GraphQL client cache store, and how does it differ from a document cache?
basics
~20 sA normalized client cache shreds each response into individual objects stored under an identity key, usually the object's __typename plus its id, with nested objects replaced by references. A document cache instead stores a whole response under the operation plus its variables.
With a build-time persisted document registry, what does a GraphQL request carry instead of the document text?
basics
~20 sAn identifier for a document the server already holds, plus the variables. A build step extracts every operation from the client source into a manifest and publishes it ahead of the release; the shipped client carries identifiers, never query text.
Why can't an HTTP cache reuse a GraphQL response when every operation is POSTed to one URL?
basics
~20 sHTTP caches key stored responses on the request method and target URL. Every GraphQL operation is POSTed to the same path, so the discriminator — the document and its variables — sits in a body no cache reads.
What are the four gRPC method kinds, and which one fits a device that uploads a sample every few seconds for hours?
basics
~10 sgRPC methods come in four kinds: unary (one request, one response), server-streaming (one request, many responses), client-streaming (many requests, one response) and bidirectional streaming. A device uploading samples for hours fits client-streaming.
A gRPC client makes a unary call and sets no deadline. What does the server assume, and why is that dangerous?
basics
~20 sWith no deadline the call carries no grpc-timeout request field, and the gRPC specification tells the server to assume an infinite timeout. One stalled dependency then holds caller threads and memory until something else breaks.
What does a gRPC call look like as an HTTP/2 request, and how does the server know which method is wanted?
basics
~10 sEvery gRPC call is an HTTP/2 POST whose :path is /{package}.{Service}/{Method}, with content-type application/grpc and te: trailers. The request body carries length-prefixed messages; nothing about the call lives in a query string.
In gRPC, what is an interceptor and where does it run relative to the service method it wraps?
basics
~20 sAn interceptor is a wrapper around a gRPC call that runs before and after the service method, on the client side or the server side, so cross-cutting work like authentication, audit logging, timing and tracing lives in one place.
Why does a caller ask a gRPC server's grpc.health.v1 Health service whether it is serving instead of trusting that the connection was accepted?
basics
~20 sAccepting a connection only proves a process bound its port. The grpc.health.v1 Health service's Check call returns a ServingStatus for a named service, so a caller learns whether the server can actually answer work rather than merely that it is listening.
What does a SOAP envelope contain, which of its parts are mandatory, and how does it tell a receiver which SOAP version it uses?
basics
~20 sA SOAP envelope is the root element: an optional Header of namespace-qualified header blocks, then a mandatory Body. The Envelope's namespace URI, not a version number, says SOAP 1.1 or 1.2; an unsupported one draws a VersionMismatch fault.
What is the core difference between SOAP and REST, and why is comparing the two not quite like-for-like?
basics
~20 sSOAP is a messaging protocol: an XML envelope carrying operations, usually described by a WSDL contract, over HTTP or other transports. REST is an architectural style: resources at URIs, acted on through HTTP's uniform methods and status codes.
What does a WSDL 1.1 document describe, and which of its elements say what a service does, how to reach it and where?
basics
~20 sA WSDL 1.1 document is an XML contract for a web service: types and message define the data, portType lists the abstract operations, binding fixes protocol and format, and service groups ports, each a binding at one address.
In WS-Security, what is the wsse:Security SOAP header block, and what kinds of security information does it carry?
basics
~20 swsse:Security is the SOAP header block WS-Security defines for security data aimed at one recipient: tokens such as a UsernameToken, an X.509 certificate or a SAML assertion, a wsu:Timestamp, and the signatures and encryption keys protecting chosen parts.
When the same operation moves from SOAP 1.1 to SOAP 1.2 over HTTP, what changes in the HTTP request and response?
basics
~20 sSOAP 1.1 sends text/xml with a mandatory SOAPAction header and returns faults with HTTP 500. SOAP 1.2 sends application/soap+xml with an optional action parameter, returns Sender faults with 400 and other faults with 500, and also permits GET.
A remote procedure call to transfer funds times out with no reply. What can the caller conclude about whether the transfer happened?
basics
~20 sNothing certain: a timeout only says no reply arrived in time. The request may have been lost before running, the transfer may have run and its reply been lost, or it may still be running, so the outcome is unknown.
What members make up a JSON-RPC 2.0 request and its response, and how does the client match one to the other?
basics
~20 sA JSON-RPC 2.0 request carries jsonrpc "2.0", a method, optional params (an Array or an Object) and an id. The response echoes that id and carries exactly one of result or error, so the client correlates by id.
In a remote procedure call system, what do the client stub and the server-side skeleton each do during one call?
basics
~20 sThe client stub poses as the local procedure: it marshals the arguments into a request and hands it to the transport. The server skeleton unmarshals them, dispatches to the real procedure and marshals the result back.
When designing one API surface, how do action-oriented RPC, resource-oriented REST and query-oriented GraphQL differ in what the interface is built around?
basics
~20 sRPC exposes named procedures the client calls with arguments; REST exposes addressable resources handled through HTTP's fixed methods; GraphQL exposes one typed graph the client queries for exactly the fields it wants. That organising choice drives caching, coupling and tooling.
In an RPC system, what distinguishes maybe, at-most-once and at-least-once invocation semantics, and what does each need from client and server?
basics
~20 sMaybe sends once and never resends, so the call ran zero or one times. At-least-once resends until a reply arrives, so it may run repeatedly. At-most-once also resends, but the server spots duplicates by request identifier and replays its saved reply.
In OData 4.01, how does a client write the URL for one entity by its key, including composite and string-valued keys?
basics
~10 sAppend a key predicate to the entity set: Products(1), Employees('A1245'), OrderItems(OrderID=1,ItemNo=2). Inside a quoted string a single quote is doubled and a slash percent-encoded; OData 4.01 services may also accept Employees/A1245.
In OData, how does the service document at the service root differ from the $metadata document, and what does a client use each one for?
basics
~20 sThe OData service document at the service root lists entry points: entity sets, singletons and opted-in function imports, each with a name and URL. The $metadata document describes the whole model in CSDL: types, keys, relationships, operations and annotations.
Given the OData 4.01 request `GET Customers?$filter=City eq 'Lyon'&$orderby=Name&$top=10&$skip=20&$count=true`, what comes back, and in what order are the options applied?
basics
~20 sCustomers 21 to 30 of those in Lyon, sorted by Name, plus the total number of Lyon customers. The service evaluates $filter, then $count, then $orderby, $skip and $top, whatever their order in the URL.
In OData's multipart $batch format, how do you create an order and its lines so that they succeed or fail together?
basics
~20 sPut both inserts in one change set, a nested multipart/mixed part whose operations each carry a Content-ID. POST the order as Content-ID 1, then POST the lines to $1/Items; the service applies all of them or none.
How does an OData 4.01 client obtain an entity's ETag and use it with If-Match to update that entity safely?
basics
~20 sAn entity's ETag comes from the ETag header of a single-entity response or, per entity, the @etag control information (@odata.etag in 4.0). It goes back unchanged in If-Match on PATCH, PUT, DELETE or a bound action; stale gets 412, missing-but-required 428.
In the WebSocket protocol, why can a browser page not set an HTTP Authorization request header on the upgrade?
basics
~20 sThe upgrade is an ordinary HTTP GET issued by the browser itself, and the page's socket API accepts only a URL and a list of subprotocol names. There is no place to add a request field, so no Authorization.
In a WebSocket data frame, what do the FIN bit and the 4-bit opcode in the first byte tell the receiver?
basics
~20 sFIN says whether this frame is the last of its message; the 4-bit opcode says what the frame is: %x0 continuation, %x1 text, %x2 binary, %x8 close, %x9 ping, %xA pong. Three RSV bits sit between them.
What does a WebSocket client send in its HTTP/1.1 upgrade request, and which response means the socket is open?
basics
~20 sA WebSocket client opens with an ordinary HTTP/1.1 GET carrying Host, Upgrade: websocket, Connection: Upgrade, a random Sec-WebSocket-Key and Sec-WebSocket-Version: 13. A 101 Switching Protocols response with a matching Sec-WebSocket-Accept means the socket is open.
In the WebSocket protocol, what must an endpoint do when it receives a Ping control frame, and what does that exchange prove?
basics
~20 sA WebSocket endpoint that receives a Ping frame (opcode %x9) must answer with a Pong frame (opcode %xA) carrying identical application data. A completed round trip proves the peer's process read a frame and wrote one back.
In a WebSocket connection, what does the protocol guarantee about a text message that it does not guarantee about a binary one?
basics
~20 sA WebSocket text message must carry valid UTF-8, and an endpoint receiving invalid UTF-8 in one fails the connection with close status 1007. A binary message is an opaque sequence of octets the protocol never inspects.
In a Server-Sent Events stream, what does a `retry:` field sent by the server tell the client to do?
basics
~10 sA retry field sets, in milliseconds, how long a client waits before re-opening a dropped Server-Sent Events stream. Until the server sends one, the client uses an implementation-defined default of a few seconds.
How does a handler that emits a Server-Sent Events stream differ from one that returns an ordinary JSON response?
basics
~20 sAn event-stream handler never finishes its response. It answers with 200 OK and Content-Type: text/event-stream, declares no body length, writes each event as that event happens, flushes, and holds the response open instead of returning a document.
What does Server-Sent Events define for you that a WebSocket connection leaves you to build, and what can it never do?
basics
~20 sServer-Sent Events defines automatic reconnection and a text event grammar over one ordinary HTTP response; a WebSocket connection defines neither, so you build them. The stream is server-to-client only, so anything the client sends needs a separate request.
In a Server-Sent Events feed of elevator car positions, what media type does the response carry, and what ends one event?
basics
~20 sThe response is served as text/event-stream. Its body is a stream of field lines - data, event, id and retry - and a single blank line ends the current block and dispatches it as one event.
In a Server-Sent Events stream, when is the response authorized, and what re-checks that authorization while it stays open for hours?
basics
~20 sAuthorization happens once, when the server answers the opening GET with 200 OK and a text/event-stream body. Nothing in the protocol re-checks it afterwards; the body is only data lines, so a fresh decision needs a fresh request.
In MCP, what is elicitation and when does a server use it?
basics
~20 sElicitation is MCP's way for a server to ask the human user for structured input while it is handling a request — a missing parameter, a confirmation, a choice between accounts. The client shows the ask and returns the user's answer.
In MCP, what are the host, the client, and the server, and how do they relate?
basics
~10 sThe host is the AI application the user runs. Inside it, one client per server speaks the protocol. Each server exposes one integration's tools, resources and prompts. Clients never talk to each other.
What must every MCP request carry in params._meta now that initialize is gone?
basics
~10 sEvery MCP request must put io.modelcontextprotocol/protocolVersion and io.modelcontextprotocol/clientCapabilities inside params._meta. An empty capabilities object is legal, but the key itself is not optional. clientInfo is optional and SHOULD be sent.
In MCP, what does server/discover return, and which side is required to implement it?
basics
~10 sserver/discover returns a DiscoverResult holding supportedVersions, the server's capabilities, optional instructions, and the required cache hints ttlMs and cacheScope, with serverInfo in _meta. Servers MUST implement it; clients MAY call it.
In MCP, what does a protocol version like 2026-07-28 mean, and when is it bumped?
basics
~10 sMCP protocol versions are dates in YYYY-MM-DD form naming the day of the last backwards-incompatible change to the specification. The current revision is 2026-07-28. Backwards-compatible additions do not bump the version.
In an OpenAPI 3.x document, what are the four values of a parameter's in field, and how do they differ?
basics
~20 sOpenAPI parameter objects declare inputs outside the body using in: path, query, header, or cookie. A parameter is identified by name plus in. Path parameters must set required: true and must match a template variable in the path string.
In an OpenAPI document, what does a $ref such as '#/components/schemas/Pet' resolve to?
basics
~10 sIt is a JSON Pointer into the same document: it resolves to the Pet entry under components.schemas, and tooling substitutes that definition wherever the reference appears, so one definition can serve many operations.
Where does required live in an OpenAPI schema object, and what does it actually guarantee?
basics
~20 sIn an OpenAPI schema, required is an array of property names declared on the object schema itself, not a boolean on each property. It only guarantees the key is present — a required property can still hold null if the schema allows null.
In an OpenAPI schema, what is the difference between type and format?
basics
~20 sIn an OpenAPI schema, type is the JSON data type — string, number, integer, boolean, array, object — and is enforced by validators. format is an open-ended hint refining that type, such as int64 or date-time; validators may ignore unknown formats, but code generators use them for type mapping.
In OpenAPI 3.x, where are security schemes declared and what type values may they have?
basics
~20 sSecurity schemes live under components.securitySchemes as named entries. OpenAPI 3.0 defines four types — apiKey, http, oauth2 and openIdConnect — and 3.1 adds mutualTLS. Operations then reference a scheme by its name in a security requirement.
A one-to-one WebRTC video call is pitched as 'serverless'; which server roles does it still need, and why does each one exist?
basics
~20 sWebRTC still needs a signalling service to carry offers, answers and candidates, which the standards leave to the application; STUN to learn public addresses; TURN to relay when no direct path works; and media servers only for groups, recording or gateways.
In WebRTC, when would a browser game send player inputs over an RTCDataChannel rather than over a WebSocket to a server?
basics
~20 sPick an RTCDataChannel when late inputs are worth dropping: it sends SCTP messages over DTLS and UDP, optionally unordered and partially reliable, often peer to peer. A WebSocket is one ordered, fully reliable TCP stream to a server, simpler to set up.
In WebRTC, how do you list STUN and TURN servers in an RTCPeerConnection's iceServers, and why must a TURN entry carry a username and credential?
basics
~20 sEach RTCIceServer entry in RTCConfiguration.iceServers names a server by a stun:, turn: or turns: URI. A STUN entry needs nothing more; a TURN entry must also carry username and credential, because the TURN server authenticates every Allocate before it spends relay capacity.
In WebRTC, what do an SDP offer and an SDP answer contain, and what must the application carry between the peers itself?
basics
~20 sAn SDP offer lists the media and data sections a peer proposes, with codecs, directions, ICE credentials and a DTLS fingerprint; the answer accepts or rejects each one. WebRTC never transports them: the application's own signalling channel carries offer, answer and candidates.
In WebRTC's RTCDataChannelInit, what do ordered, maxRetransmits and maxPacketLifeTime control, and why may only one limit be set?
basics
~20 sThe ordered option chooses send-order or arrival-order delivery; maxRetransmits caps how often a lost message is resent, and maxPacketLifeTime caps how many milliseconds it may be sent or resent. Neither gives a reliable channel; both throws a TypeError.