REST API Lessons

Step-by-step lessons to build your understanding.

  1. What Makes an API RESTful? REST Constraints

    What makes an API RESTful? Learn Roy Fielding's six REST constraints — statelessness, uniform interface, HATEOAS, cacheability — and how to nail the interview answer.

    5 min
  2. HTTP Methods & Status Codes Explained

    HTTP methods and status codes explained: GET, POST, PUT, PATCH, DELETE semantics, safe vs idempotent methods, and choosing the right 2xx/4xx/5xx code for REST APIs.

    5 min
  3. API Idempotency & Safe Retries

    API idempotency explained: how idempotency keys make POST retries safe, dedupe duplicate requests, and survive network failures without double-charging in REST APIs.

    4 min
  4. REST Resource Modeling & URI Design

    REST resource modeling and URI design: nouns over verbs, collections vs sub-resources, nesting depth, naming conventions, and clean URL patterns for scalable APIs.

    6 min
  5. REST API Versioning Strategies

    REST API versioning strategies compared: URI path /v1 vs header and media-type versioning, breaking vs non-breaking changes, deprecation, and evolving APIs safely.

    6 min
  6. API Pagination at Scale: Cursor vs Offset

    API pagination at scale: why offset pagination breaks on large changing datasets, how cursor and keyset pagination work, and stable page design for REST APIs.

    10 min
  7. HTTP Caching & Conditional Requests (ETags)

    HTTP caching for REST APIs: Cache-Control directives, ETags and Last-Modified, conditional GET with If-None-Match, 304 responses, and optimistic concurrency control.

    6 min
  8. API Authentication & Authorization (OAuth2/JWT)

    API authentication and authorization: AuthN vs AuthZ, OAuth2 flows, JWT vs opaque tokens, scopes and RBAC, and securing REST endpoints against common attacks.

    6 min
  9. API Error Design, Rate Limiting & Observability

    API error design, rate limiting, and observability: consistent error contracts (RFC 7807), 429 with Retry-After, token-bucket throttling, logs, metrics, and tracing.

    7 min
  10. Async & Long-Running REST Operations

    Async and long-running REST operations: the 202 Accepted pattern, status polling, job resources, webhooks vs polling, and designing APIs for exports and batch jobs.

    6 min
  11. REST API Design Mock Interview

    A REST API design mock interview walkthrough: scope the problem, model resources and URIs, pick status codes, and handle auth, pagination, idempotency, and errors live.

    9 min