🌍 Backend Development · subject
Backend Development APIs and Web Services Syllabus
The APIs and Web Services syllabus for Backend Development in full: 6 chapters and 28 topics, every one listed below, plus 51 APIs and Web Services flashcards with answers.
APIs and Web Services syllabus: all 6 chapters
Expand any chapter to see its topics and sub-topics.
-
REST API Design
6 topics- REST Principles and Constraints
- Resources, URIs and HTTP Verbs
- Request and Response Modeling
- Status Codes and Error Responses
- Versioning Strategies
- HATEOAS and Richardson Maturity Model
-
API Documentation and Contracts
4 topics- OpenAPI / Swagger Specification
- API-First Design
- Schema and Contract Testing
- Postman and API Clients
-
GraphQL
5 topics- Schema Definition Language
- Queries, Mutations and Subscriptions
- Resolvers and Data Loaders
- N+1 Problem and Batching
- GraphQL vs REST Tradeoffs
-
RPC and Real-Time Communication
5 topics- gRPC and Protocol Buffers
- JSON-RPC
- WebSockets
- Server-Sent Events
- Long Polling and Webhooks
-
Request Validation and Serialization
4 topics- Input Validation and Sanitization
- Schema Validation Libraries
- Content Negotiation
- Data Serialization Formats
-
API Gateways and Management
4 topics- Rate Limiting and Throttling
- API Keys and Quotas
- Reverse Proxies and Load Balancing
- CORS and Cross-Origin Requests
Backend Development APIs and Web Services flashcards — 51 questions with answers
What does REST stand for, and who introduced it?
REST stands for Representational State Transfer. It was introduced by Roy Fielding in his 2000 doctoral dissertation as an architectural style for distributed hypermedia systems.
List the six architectural constraints of REST.
1) Client-Server, 2) Statelessness, 3) Cacheability, 4) Uniform Interface, 5) Layered System, and 6) Code on Demand (optional). Only Code on Demand is optional; the rest are mandatory for a system to be RESTful.
What does the 'statelessness' constraint of REST require?
Each request from client to server must contain all information needed to understand and process it; the server stores no client session/context between requests. Session state is kept entirely on the client.
What are the four interface guiding principles of REST's 'uniform interface' constraint?
1) Identification of resources (via URIs), 2) Manipulation of resources through representations, 3) Self-descriptive messages, and 4) Hypermedia as the engine of application state (HATEOAS).
In REST, what is the difference between a resource and its representation?
A resource is an abstract concept/entity identified by a URI (e.g., a user). A representation is a concrete serialized snapshot of that resource's state in a particular format (e.g., JSON or XML) exchanged between client and server.
What is the semantic difference between a URI, a URL, and a URN?
A URI (Uniform Resource Identifier) is the general identifier. A URL is a URI that also specifies how/where to locate the resource (includes scheme/host). A URN names a resource by unique name independent of location (e.g., urn:isbn:...). Every URL and URN is a URI.
Which HTTP methods are considered 'safe', and what does safe mean?
Safe methods do not modify server state (read-only): GET, HEAD, OPTIONS, and TRACE. Clients can call them without expecting side effects.
Define idempotency for HTTP methods and classify the standard verbs.
An idempotent method produces the same server state whether called once or many times. Idempotent: GET, HEAD, PUT, DELETE, OPTIONS, TRACE. Not idempotent: POST (and generally PATCH).
What is the difference between PUT and PATCH?
PUT replaces the entire resource with the supplied representation (full update, idempotent). PATCH applies a partial modification to the resource (partial update, not guaranteed idempotent).
Which HTTP verb should create a resource when the server assigns the identifier, and why not PUT?
POST, because the client does not know the resource's URI in advance and POST is non-idempotent (each call creates a new resource). PUT is used when the client specifies the target URI/ID and wants create-or-replace semantics.
What content-negotiation headers let a client and server agree on a representation format?
The client sends Accept (and Accept-Language, Accept-Encoding) to state preferred media types; the server responds with Content-Type describing the returned representation's media type.
What are the five classes of HTTP status codes and their meaning?
1xx Informational, 2xx Success, 3xx Redirection, 4xx Client Error, 5xx Server Error.
Distinguish HTTP 401 from 403.
401 Unauthorized means authentication is missing or invalid (the client is not authenticated). 403 Forbidden means the client is authenticated but lacks permission to access the resource.
When should an API return 200 vs 201 vs 204?
200 OK: successful request with a response body. 201 Created: a new resource was created (typically with a Location header). 204 No Content: success with no response body (e.g., a DELETE or empty PUT).
What does HTTP 422 Unprocessable Entity signify versus 400 Bad Request?
400 Bad Request: the request is malformed/syntactically invalid. 422 Unprocessable Entity: the syntax is valid but the request is semantically wrong (e.g., validation failure on well-formed JSON).
What status code indicates rate limiting, and which header commonly accompanies it?
429 Too Many Requests indicates the client has sent too many requests in a given time. It is often accompanied by a Retry-After header telling the client when to retry.
What is the purpose of RFC 7807 / RFC 9457 'Problem Details'?
It standardizes a machine-readable JSON (or XML) error response format for HTTP APIs, with fields like type, title, status, detail, and instance, using the media type application/problem+json.
Name four common REST API versioning strategies.
1) URI path versioning (/v1/users), 2) Query parameter versioning (?version=1), 3) Custom header versioning (Api-Version: 1), and 4) Media type / content negotiation versioning (Accept: application/vnd.example.v1+json).
What is a key trade-off of URI path versioning versus media-type versioning?
URI path versioning is simple, visible, and cache/browser-friendly but violates the idea that a URI identifies one resource. Media-type versioning keeps URIs stable and is more RESTful/HATEOAS-friendly but is less discoverable and harder to test in a browser.
What does HATEOAS stand for and what does it provide?
HATEOAS = Hypermedia As The Engine Of Application State. Responses include hypermedia links so the client discovers available actions/transitions dynamically at runtime rather than hard-coding URIs.
Show the other 31 APIs and Web Services flashcards
List the four levels of the Richardson Maturity Model.
Level 0: The Swamp of POX (single URI, single verb, RPC-style). Level 1: Resources (multiple URIs, still one verb). Level 2: HTTP Verbs (proper use of methods and status codes). Level 3: Hypermedia Controls (HATEOAS).
At which Richardson Maturity Level do most 'RESTful' APIs actually operate, and which level is considered fully RESTful?
Most APIs operate at Level 2 (proper resources + HTTP verbs). Fielding considered only Level 3 (HATEOAS/hypermedia controls) to be truly RESTful.
What is OpenAPI, and what was its predecessor called?
OpenAPI is a language-agnostic specification for describing RESTful APIs (endpoints, parameters, schemas, responses) in a machine-readable format (YAML/JSON). Its predecessor (up to version 2.0) was called Swagger.
Name the top-level required fields of an OpenAPI 3.x document.
openapi (version string), info (title/version metadata), and paths (the endpoints). Common optional roots include servers, components, security, and tags.
In OpenAPI, what is the purpose of the 'components' section?
It holds reusable definitions—schemas, parameters, responses, request bodies, security schemes, etc.—that are referenced elsewhere via $ref to avoid duplication.
What is API-First design?
An approach where the API contract (e.g., an OpenAPI spec) is designed and agreed upon before any implementation. The spec becomes the single source of truth, enabling parallel frontend/backend work, mocking, and code generation.
What is the difference between schema testing and contract testing?
Schema testing validates that a payload conforms to a defined structure/type (e.g., JSON Schema). Contract testing verifies that a consumer and provider agree on the interaction (requests/responses), ensuring changes don't break integrations.
In consumer-driven contract testing (e.g., Pact), who defines the contract and how is it verified?
The consumer defines expectations of the provider by writing a contract (pact) from its tests. The provider then runs those contracts against its real implementation to verify it satisfies every consumer's expectations.
What is a Postman Collection?
A Postman Collection is a saved, shareable group of API requests (with folders, variables, scripts, and tests) used to organize, document, and automate API testing and workflows.
In Postman, what are pre-request scripts versus test scripts?
Pre-request scripts run before a request is sent (e.g., to set variables, generate auth tokens). Test scripts run after the response is received to assert on status, body, headers, and set environment variables.
What is GraphQL, and what defines the shape of its API?
GraphQL is a query language and runtime for APIs where clients request exactly the data they need. Its Schema Definition Language (SDL) defines the types, fields, queries, mutations, and subscriptions the API exposes—the schema is a strongly-typed contract.
In GraphQL SDL, what are the three special root operation types?
Query (read operations), Mutation (write/side-effecting operations), and Subscription (real-time streaming of updates, typically over WebSockets).
What is the difference between a scalar type and an object type in GraphQL?
Scalar types are leaf values with no sub-fields (Int, Float, String, Boolean, ID, plus custom scalars). Object types are composite, containing fields that resolve to other objects or scalars.
In GraphQL SDL, what do the symbols ! and [] mean in a field type like [User!]!?
! denotes non-null. [] denotes a list. [User!]! means a non-null list (the list itself can't be null) whose elements are each non-null User objects.
What is a resolver in GraphQL?
A resolver is a function that returns the value for a particular field in the schema. It typically receives arguments (parent/source, args, context, info) and fetches or computes the field's data.
What is the GraphQL N+1 problem?
When resolving a list of N parent items and then a related field on each, the naive implementation issues 1 query for the list plus N separate queries for the children—N+1 total round-trips—causing severe performance degradation.
How does a DataLoader solve the N+1 problem?
A DataLoader batches individual key requests made within a single tick of the event loop into one bulk fetch and caches results per request, turning N+1 queries into 1 (list) + 1 (batched) queries.
What two core capabilities does DataLoader provide?
Batching (collecting many individual load(key) calls into a single batched backend call) and Caching (memoizing results per key within a request to avoid duplicate fetches).
Give two advantages of GraphQL over REST.
1) Clients fetch exactly the fields they need in a single request, avoiding over-fetching and under-fetching. 2) A strongly-typed schema with introspection enables tooling, validation, and combining multiple resources in one round-trip.
Give two advantages of REST over GraphQL.
1) Native HTTP caching (via GET + cache headers/CDNs) is straightforward, whereas GraphQL POST queries are harder to cache. 2) Simpler operational model—no risk of expensive arbitrary nested queries, easier monitoring, and lower learning curve.
How does error handling differ between REST and GraphQL by default?
REST signals errors via HTTP status codes (4xx/5xx). GraphQL typically returns HTTP 200 even on errors, placing problem details in a top-level 'errors' array alongside partial 'data'.
What is gRPC, and what serialization format and transport does it use?
gRPC is a high-performance RPC framework from Google. It uses Protocol Buffers (protobuf) as its Interface Definition Language and binary serialization, and runs over HTTP/2 for multiplexing and streaming.
What are Protocol Buffers?
Protocol Buffers (protobuf) are a language-neutral, platform-neutral binary serialization format. Messages are defined in .proto files with typed fields and unique field numbers (tags), then compiled into code for many languages.
Why are field numbers (tags) in a .proto message important?
Field numbers identify fields in the binary wire format instead of names, enabling compact encoding and backward/forward compatibility. Existing field numbers must never be reused or changed to preserve compatibility.
What four kinds of RPC methods does gRPC support?
1) Unary (single request, single response), 2) Server streaming, 3) Client streaming, and 4) Bidirectional streaming.
Give two reasons gRPC often outperforms JSON/REST over HTTP/1.1.
1) Protobuf binary encoding is smaller and faster to (de)serialize than text JSON. 2) HTTP/2 provides multiplexed streams, header compression, and persistent connections, reducing latency and overhead.
What is JSON-RPC and how does it differ from REST?
JSON-RPC is a stateless, transport-agnostic remote procedure call protocol that encodes method calls as JSON objects (method, params, id). Unlike REST, it is action/verb-oriented rather than resource-oriented and typically uses a single endpoint with POST.
What fields make up a JSON-RPC 2.0 request object?
jsonrpc (must be "2.0"), method (the procedure name), params (arguments, by-position array or by-name object; optional), and id (a client-set identifier; omitted for notifications).
What is a JSON-RPC notification?
A JSON-RPC request that omits the 'id' member, signaling the client expects no response. The server processes it but must not reply, making it fire-and-forget.
What are WebSockets and how do they differ from HTTP request/response?
WebSockets provide a persistent, full-duplex, bidirectional communication channel over a single TCP connection. Unlike HTTP's request/response model, either party can send messages at any time without polling, enabling real-time push.
How is a WebSocket connection established?
Via an HTTP Upgrade handshake: the client sends a GET with headers Upgrade: websocket, Connection: Upgrade, and Sec-WebSocket-Key. The server replies with 101 Switching Protocols and a computed Sec-WebSocket-Accept, after which the connection switches to the ws:// (or wss://) protocol.
Backend Development APIs and Web Services FAQ
What is in the Backend Development APIs and Web Services syllabus?
Backend Development APIs and Web Services is split into 6 chapters: REST API Design, API Documentation and Contracts, GraphQL, RPC and Real-Time Communication, Request Validation and Serialization and API Gateways and Management. Together they contain 28 topics.
How many chapters are in Backend Development APIs and Web Services?
6 chapters, containing 28 topics. The largest chapter is REST API Design, with 6 topics.
Are there flashcards for Backend Development APIs and Web Services?
Yes — a 51-card APIs and Web Services deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.