QA
🔌
Backend

REST APIs & Web Services Interview Questions

API design patterns, HTTP verbs, payload pagination, caching headers, error contracts, rate limiting algorithms, and gRPC/GraphQL trade-offs.

🎯 Ready to test your knowledge?

Take REST APIs & Web Services Skill Assessment Quiz

First prepare from the 100 learning questions below, then test your skills with 15 random MCQs categorized into Beginner, Intermediate, and Senior levels.

Launch 15-MCQ Quiz →
Experience Level:

Showing 100 Questions

Beginner LevelREST APIs & Web Services

1. What is HTTP Method Idempotency and how do you implement Idempotency Keys for REST APIs?

❓ Context: Which HTTP methods are idempotent? How do Payment APIs (like Stripe) use Idempotency-Key headers to prevent double billing?

An HTTP method is idempotent if making multiple identical requests has the same side-effect on the server as making a single request.

HTTP Method Breakdown:

•
Idempotent: 'GET', 'PUT', 'DELETE', 'HEAD', 'OPTIONS'.
•
NOT Idempotent: 'POST' (submitting twice creates two distinct resources).

Idempotency Keys:

To make 'POST' endpoints (like charging a credit card) safe against retries due to network timeouts, clients send a unique 'Idempotency-Key' UUID in headers. The API checks Redis/DB for the key and returns cached responses on duplicate requests.

typescript
import { Request, Response, NextFunction } from 'express';

export async function idempotencyMiddleware(req: Request, res: Response, next: NextFunction) {
  const idempotencyKey = req.header('Idempotency-Key');
  if (!idempotencyKey) return next();

  const cacheKey = 'idempotency:\${idempotencyKey}';
  const cachedResponse = await redis.get(cacheKey);
  if (cachedResponse) {
    const { status, body } = JSON.parse(cachedResponse);
    return res.status(status).json(body);
  }
  // Intercept and cache POST execution responses...
  next();
}
💡Idempotency key middleware pattern.
🎯 Interview Key Takeaway

Idempotency keys ensure critical non-idempotent POST operations are safe against retries in distributed systems.

#REST API#HTTP#Idempotency#Backend#Beginner
Permalink
Beginner LevelREST APIs & Web Services

2. What are standard HTTP Status Codes (200, 201, 204, 400, 401, 403, 404, 409, 429, 500, 503)?

Beginner LevelREST APIs & Web Services

3. What are HTTP Verbs (GET, POST, PUT, PATCH, DELETE) and when to use PUT vs PATCH?

Beginner LevelREST APIs & Web Services

4. What is the Statelessness constraint in REST architecture?

Beginner LevelREST APIs & Web Services

5. What are RESTful Resource Naming Conventions and URL path structures?

Beginner LevelREST APIs & Web Services

6. How does Content-Type and Accept Header Negotiation work in REST APIs?

Beginner LevelREST APIs & Web Services

7. What is Cross-Origin Resource Sharing (CORS) and how do preflight OPTIONS requests work?

Beginner LevelREST APIs & Web Services

8. Compare Offset-based Pagination vs Cursor-based Pagination for large REST collections.

Beginner LevelREST APIs & Web Services

9. What are API Versioning strategies (URI path vs Query parameter vs Custom Header)?

Beginner LevelREST APIs & Web Services

10. How does HTTP Rate Limiting work with 429 Too Many Requests and X-RateLimit headers?

Beginner LevelREST APIs & Web Services

11. What is HATEOAS (Hypermedia As The Engine Of Application State)?

Beginner LevelREST APIs & Web Services

12. What is OpenAPI 3.0 (Swagger) and why is contract-first API design important?

Beginner LevelREST APIs & Web Services

13. How do Cache-Control headers, ETag, and If-None-Match enable HTTP response caching?

Beginner LevelREST APIs & Web Services

14. How do you design query parameter filtering, sorting, and field selection in REST URIs?

Beginner LevelREST APIs & Web Services

15. How does Bearer Token authentication work in HTTP Authorization headers?

Beginner LevelREST APIs & Web Services

16. What is RFC 7807 Problem Details for HTTP APIs?

Beginner LevelREST APIs & Web Services

17. How do multi-part form uploads (multipart/form-data) work in REST APIs?

Beginner LevelREST APIs & Web Services

18. What are the main differences and trade-offs between REST and GraphQL?

Beginner LevelREST APIs & Web Services

19. What is gRPC and how does Protocol Buffers (Protobuf) compare to REST/JSON?

Beginner LevelREST APIs & Web Services

20. How do Webhook HTTP Callbacks deliver real-time event notifications?

Beginner LevelREST APIs & Web Services

21. How do you handle Batch or Bulk POST requests in REST APIs?

Beginner LevelREST APIs & Web Services

22. How does Content-Encoding (gzip, br) compress HTTP API responses?

Beginner LevelREST APIs & Web Services

23. Why is strict Request Payload Schema Validation essential for REST APIs?

Beginner LevelREST APIs & Web Services

24. How do Server-Sent Events (SSE) stream text/event-stream data to clients?

Beginner LevelREST APIs & Web Services

25. How does HTTP 206 Partial Content and Range headers handle file streaming?

Beginner LevelREST APIs & Web Services

26. What are the HTTP HEAD and OPTIONS methods used for in REST APIs?

Beginner LevelREST APIs & Web Services

27. Why should client applications send descriptive User-Agent headers?

Beginner LevelREST APIs & Web Services

28. What is the Circuit Breaker Pattern in REST API client integrations?

Beginner LevelREST APIs & Web Services

29. How does API Mocking (MSW, WireMock) streamline frontend development?

Beginner LevelREST APIs & Web Services

30. What is an API Gateway and what roles does it perform in backend architecture?

Intermediate LevelREST APIs & Web Services

31. How does the OAuth 2.0 Authorization Code Grant Flow with PKCE operate?

Intermediate LevelREST APIs & Web Services

32. What is the internal structure of a JSON Web Token (Header, Payload, Signature)?

Intermediate LevelREST APIs & Web Services

33. How do you implement Token Revocation and Blacklisting for stateless JWTs?

Intermediate LevelREST APIs & Web Services

34. How do Refresh Token Rotation and Sliding Sessions maintain secure login state?

Intermediate LevelREST APIs & Web Services

35. Compare Token Bucket vs Leaky Bucket vs Fixed Window Rate Limiting algorithms.

Intermediate LevelREST APIs & Web Services

36. How does Distributed Tracing work using W3C Trace Context (traceparent) headers?

Intermediate LevelREST APIs & Web Services

37. How does gRPC-Web and Envoy gRPC Transcoding bridge browser clients to gRPC backends?

Intermediate LevelREST APIs & Web Services

38. How does the DataLoader pattern solve N+1 Query Problems in GraphQL resolvers?

Intermediate LevelREST APIs & Web Services

39. How do OpenAPI Code Generators auto-generate strongly-typed TypeScript SDKs?

Intermediate LevelREST APIs & Web Services

40. How do CDN Cache Invalidation and Surrogate-Key (Cache-Tags) headers operate?

Intermediate LevelREST APIs & Web Services

41. What are the OWASP API Security Top 10 vulnerabilities (BOLA, BFLA, Mass Assignment)?

Intermediate LevelREST APIs & Web Services

42. How do DTOs (Data Transfer Objects) and strict property whitelisting prevent Mass Assignment?

Intermediate LevelREST APIs & Web Services

43. How does HTTP/2 Flow Control handle Backpressure between client and server?

Intermediate LevelREST APIs & Web Services

44. How do Exponential Backoff and Full Jitter algorithms optimize client retry strategies?

Intermediate LevelREST APIs & Web Services

45. What is Mutual TLS (mTLS) and how does it secure service-to-service REST calls?

Intermediate LevelREST APIs & Web Services

46. What is HTTP/3 (QUIC) and how does UDP multiplexing improve API latency?

Intermediate LevelREST APIs & Web Services

47. Compare Schema-First API Design vs Code-First API Generation.

Intermediate LevelREST APIs & Web Services

48. What HTTP Security Headers (HSTS, CSP, X-Frame-Options, X-Content-Type-Options) protect APIs?

Intermediate LevelREST APIs & Web Services

49. How does Content-Disposition header control file download filenames and inline viewing?

Intermediate LevelREST APIs & Web Services

51. What is JSON Web Encryption (JWE) and how does it encrypt sensitive payload data?

Intermediate LevelREST APIs & Web Services

52. What is Consumer-Driven Contract Testing (Pact) for REST microservices?

Intermediate LevelREST APIs & Web Services

53. How does Transfer-Encoding: chunked stream data without knowing content length?

Intermediate LevelREST APIs & Web Services

54. How do Fallback Responses and Graceful Degradation maintain client availability during outages?

Intermediate LevelREST APIs & Web Services

55. How do If-Match headers and ETags prevent Lost Update problems during concurrent updates?

Intermediate LevelREST APIs & Web Services

56. What are Shadow APIs and Zombie APIs, and how do you discover un-documented endpoints?

Intermediate LevelREST APIs & Web Services

57. How do you design API Usage-Based Billing using meter events and Stripe?

Intermediate LevelREST APIs & Web Services

58. How do you implement Multi-Tenant routing via subdomains vs header paths?

Intermediate LevelREST APIs & Web Services

59. Why was HTTP/2 Server Push deprecated and replaced by 103 Early Hints?

Intermediate LevelREST APIs & Web Services

60. How does the Asynchronous Request-Reply Pattern work with HTTP 202 Accepted?

Intermediate LevelREST APIs & Web Services

61. How does the PROXY protocol preserve true client IP addresses through load balancers?

Intermediate LevelREST APIs & Web Services

62. How does the Sunset HTTP Header (RFC 8594) communicate API endpoint deprecation dates?

Intermediate LevelREST APIs & Web Services

63. How do Automatic Persisted Queries (APQ) optimize bandwidth and secure GraphQL endpoints?

Intermediate LevelREST APIs & Web Services

64. How does gRPC Server Reflection enable CLI debugging with grpcurl?

Intermediate LevelREST APIs & Web Services

65. Compare JSON Patch (RFC 6902) vs JSON Merge Patch (RFC 7396) for REST updates.

Intermediate LevelREST APIs & Web Services

67. What is the Backend-For-Frontend (BFF) pattern and when should you use it?

Intermediate LevelREST APIs & Web Services

68. How do you implement Optimistic Concurrency Control using ETag middleware in Express?

Intermediate LevelREST APIs & Web Services

69. How do you implement a Sliding Window Log Rate Limiter using Redis sorted sets (ZSET)?

Senior LevelREST APIs & Web Services

71. How do SPIFFE/SPIRE establish cryptographic workload identity across microservice REST APIs?

Senior LevelREST APIs & Web Services

72. How do you write a custom High-Performance Lua Plugin for Kong API Gateway?

Senior LevelREST APIs & Web Services

73. How does Apollo Federation v2 compose multiple microservice GraphQL subgraphs into a unified supergraph?

Senior LevelREST APIs & Web Services

74. How does the Saga Pattern manage distributed transactions across microservice REST APIs?

Senior LevelREST APIs & Web Services

75. Why does TCP Head-of-Line blocking degrade HTTP/2 under high packet loss networks?

Senior LevelREST APIs & Web Services

76. How does Automated API Fuzz Testing (Schemathesis, RESTler) discover edge-case crash vulnerabilities?

Senior LevelREST APIs & Web Services

77. What is OAuth 2.0 Token Exchange (RFC 8693) and how is it used in microservice delegation?

Senior LevelREST APIs & Web Services

78. How does TLS 1.3 0-RTT (Zero Round-Trip Time) session resumption accelerate mobile API connections?

Senior LevelREST APIs & Web Services

79. How do you tune Brotli compression quality settings to balance CPU vs network payload bandwidth?

Senior LevelREST APIs & Web Services

80. How do API Gateways execute Canary Deployments with weighted percentage traffic splitting?

Senior LevelREST APIs & Web Services

81. How do you enforce API Governance across teams using Spectral OpenAPI Linters in CI/CD?

Senior LevelREST APIs & Web Services

82. How do you architect REST APIs to comply with GDPR Right to be Forgotten across microservices?

Senior LevelREST APIs & Web Services

83. How do you build resilient Webhook delivery systems with Dead Letter Queues (DLQ)?

Senior LevelREST APIs & Web Services

84. Compare gRPC Server Streaming vs WebSockets for high-frequency real-time telemetry.

Senior LevelREST APIs & Web Services

85. How does the sendfile() system call enable Zero-Copy file streaming in web servers?

Senior LevelREST APIs & Web Services

86. How does the OpenTelemetry Collector process, batch, and export API trace telemetry?

Senior LevelREST APIs & Web Services

87. How do JSON Web Key Sets (JWKS) enable seamless zero-downtime JWT key rotation?

Senior LevelREST APIs & Web Services

88. What is the AsyncAPI specification and how does it document event-driven microservices?

Senior LevelREST APIs & Web Services

89. How do you enforce Semantic Versioning (SemVer) rules on public REST APIs?

Senior LevelREST APIs & Web Services

90. How does the Redlock algorithm implement Distributed Locking across independent Redis nodes?

Senior LevelREST APIs & Web Services

91. How do custom Protobuf serializers minimize binary wire size compared to JSON?

Senior LevelREST APIs & Web Services

92. How do you execute long-duration Soak Testing using k6 or Locust to uncover memory leaks?

Senior LevelREST APIs & Web Services

93. What is the future trajectory of REST APIs and Web Services (HTTP/3 adoption, WebAssembly at the Edge, AI Agent Protocols)?

Senior LevelREST APIs & Web Services

94. How do you scale Rate Limiting across a multi-region Redis Cluster without atomic lock bottlenecks?

Senior LevelREST APIs & Web Services

95. How do you configure resilience parameters for database connection pools in high-throughput APIs?

Senior LevelREST APIs & Web Services

96. How do origin reflection vulnerabilities compromise CORS security and how do you prevent them?

Senior LevelREST APIs & Web Services

97. How do CQRS and Event Sourcing transform API data read and write models?

Senior LevelREST APIs & Web Services

98. How do Multi-Factor Authentication (MFA) TOTP and WebAuthn flows integrate into REST login APIs?

Senior LevelREST APIs & Web Services

99. How do you profile event-loop latency and CPU bottlenecks in Node.js REST APIs using Clinic.js Flame?

Senior LevelREST APIs & Web Services

100. What is the future trajectory of REST APIs and Web Services (HTTP/3 adoption, WebAssembly at the Edge, AI Agent Protocols)?

How to Prepare for REST APIs & Web Services Technical Interviews in 2026

When interviewing for software engineering positions that utilize REST APIs & Web Services, hiring managers look for a combination of fundamental syntax proficiency, architectural understanding, code optimization techniques, and practical debugging skills.

🌱 Beginner FocusCore syntax, default configurations, standard API definitions, and avoiding common basic errors.
⚡ Intermediate FocusAsync execution patterns, performance profiling, component lifecycle, and state management.
🏆 Senior FocusInternal runtime mechanics, memory leaks, scalability bottlenecks, system design trade-offs, and security mitigation.