HomeSubjectsUniversityBlogAbout

Web APIs & Integration

Topic in Web Development

210 total MCQsShowing 30 with explanations10 Easy10 Medium10 Hard

About This Topic

A web API is an interface that exposes an application's data or functions over HTTP so that other programs, such as front ends or mobile apps, can use them. REST is the main focus: resources identified by URIs, statelessness, correct HTTP verbs and status codes, and JSON payloads. You should compare REST with GraphQL, which lets clients request exactly the fields they need, and with gRPC and SOAP. Expect questions on API keys, OAuth tokens, rate limiting, pagination, versioning strategies, webhooks, OpenAPI documentation and schema validation. Browser-side items cover fetch(), CORS preflight requests, and gateway patterns like Backend for Frontend.

Below are 30 practice questions from a pool of 210 Web APIs & Integration MCQs, one of 17 topics in Web Development. Each shows the correct answer with an explanation; when you are ready, take a timed quiz to test recall under exam conditions.

Practice Questions

Each question below shows the correct answer with a full explanation. Use these to build conceptual understanding before attempting a timed quiz.

Web APIs & IntegrationEasy

Q1. What is a Web API?

  1. A.A JavaScript variable for storing temporary data
  2. B.An interface allowing software to communicate via HTTP✓ Correct
  3. C.A CSS framework for building styled web layouts
  4. D.A NoSQL database for storing document records

Explanation

A Web API provides endpoints that accept HTTP requests and return responses.

Report an error in this question

Web APIs & IntegrationEasy

Q2. What is JSON used for in Web APIs?

  1. A.Storing CSS variables for theming and customization
  2. B.Styling web pages with CSS declarations and rules
  3. C.A lightweight data format for client-server exchange✓ Correct
  4. D.Creating HTML elements for dynamic page rendering

Explanation

JSON is the most common data format for API requests and responses.

Report an error in this question

Web APIs & IntegrationEasy

Q3. What is a GET request?

  1. A.Getting database access for read operations
  2. B.Getting CSS styles for an HTML element
  3. C.An HTTP request that retrieves data without modifying✓ Correct
  4. D.Getting HTML templates from the server cache

Explanation

GET fetches data from a specified resource.

Report an error in this question

Web APIs & IntegrationEasy

Q4. What is a POST request?

  1. A.An HTTP request sending data to create a resource✓ Correct
  2. B.Posting database queries for batch execution
  3. C.Posting CSS updates to a remote style server
  4. D.Posting content on a social media platform

Explanation

POST submits data to a server to create a new resource.

Report an error in this question

Web APIs & IntegrationEasy

Q5. What is an API key?

  1. A.A physical key for server room access control
  2. B.A CSS key for targeting specific styled elements
  3. C.A unique identifier used to authenticate API requests✓ Correct
  4. D.A keyboard shortcut for developer tool actions

Explanation

An API key is a unique token to identify the calling application.

Report an error in this question

Web APIs & IntegrationEasy

Q6. What does REST stand for?

  1. A.Remote Execution of Server Tasks
  2. B.Real-time Event Streaming Technology
  3. C.Responsive State Transition
  4. D.Representational State Transfer✓ Correct

Explanation

REST stands for Representational State Transfer.

Report an error in this question

Web APIs & IntegrationEasy

Q7. What is an API response?

  1. A.Data sent back by server after processing a request✓ Correct
  2. B.A CSS file for styling page components
  3. C.An HTML page always returned from the server
  4. D.A JavaScript function for handling async events

Explanation

An API response contains data, status code, and headers from the server.

Report an error in this question

Web APIs & IntegrationEasy

Q8. What is Postman used for?

  1. A.Managing database records through a visual tool
  2. B.Sending physical mail through the postal service
  3. C.Testing and debugging APIs by sending requests✓ Correct
  4. D.Writing CSS stylesheets for web page elements

Explanation

Postman is a popular tool for testing and documenting APIs.

Report an error in this question

Web APIs & IntegrationEasy

Q9. What is an HTTP status code?

  1. A.A JavaScript error code thrown during execution
  2. B.A database error code from failed query operations
  3. C.A numerical code indicating the result of a request✓ Correct
  4. D.A CSS class name applied to styled elements

Explanation

HTTP status codes indicate whether a request succeeded, failed, or needs action.

Report an error in this question

Web APIs & IntegrationEasy

Q10. What is a query parameter in a URL?

  1. A.A CSS query for selecting styled page elements
  2. B.A key-value pair after ? to send data with requests✓ Correct
  3. C.A database query for filtering stored records
  4. D.A JavaScript query for searching DOM tree nodes

Explanation

Query parameters pass additional information to the server in the URL.

Report an error in this question

Web APIs & IntegrationMedium

Q11. What is the difference between REST and GraphQL?

  1. A.REST uses fixed endpoints; GraphQL uses one for exact data✓ Correct
  2. B.They are identical in data fetching approach
  3. C.GraphQL is always faster than REST in every scenario
  4. D.REST is a newer technology than GraphQL overall

Explanation

REST exposes multiple fixed endpoints, while GraphQL provides one endpoint for precise queries.

Report an error in this question

Web APIs & IntegrationMedium

Q12. What is API rate limiting?

  1. A.Restricting requests a client can make per time period✓ Correct
  2. B.Limiting the available API features and endpoints
  3. C.Limiting the number of available API endpoints
  4. D.Limiting the maximum API response payload size

Explanation

Rate limiting caps requests per time window to prevent abuse.

Report an error in this question

Web APIs & IntegrationMedium

Q13. What is API versioning?

  1. A.A JavaScript version number for runtime environments
  2. B.Updating CSS versions for browser compatibility
  3. C.A database version for tracking schema migrations
  4. D.Managing API versions for backward compatibility✓ Correct

Explanation

Versioning allows introducing changes while maintaining older versions.

Report an error in this question

Web APIs & IntegrationMedium

Q14. What is OAuth used for with Web APIs?

  1. A.Delegated authorization for third-party app access✓ Correct
  2. B.A CSS framework for responsive web page layouts
  3. C.A JavaScript library for building authentication forms
  4. D.A database protocol for encrypted connection management

Explanation

OAuth lets users grant third-party apps limited access without sharing passwords.

Report an error in this question

Web APIs & IntegrationMedium

Q15. What is a webhook?

  1. A.A CSS hook for attaching dynamic style rules
  2. B.A JavaScript event listener for DOM interactions
  3. C.A database trigger firing on record changes
  4. D.A callback URL receiving HTTP POST on events✓ Correct

Explanation

A webhook receives automated POST requests when specific events occur.

Report an error in this question

Web APIs & IntegrationMedium

Q16. What is pagination in APIs?

  1. A.A JavaScript page event for tracking navigation
  2. B.Dividing large result sets into smaller pages✓ Correct
  3. C.Page layout and formatting for print media
  4. D.A CSS page break controlling print output layout

Explanation

Pagination breaks large datasets into manageable pages.

Report an error in this question

Web APIs & IntegrationMedium

Q17. What is HATEOAS in REST?

  1. A.A database concept for relating tables together
  2. B.A CSS framework for building grid layouts
  3. C.Responses include links to related resources✓ Correct
  4. D.A JavaScript pattern for managing app state

Explanation

HATEOAS means responses include hyperlinks to related resources.

Report an error in this question

Web APIs & IntegrationMedium

Q18. What is API documentation?

  1. A.Writing CSS comments for code documentation
  2. B.Database documentation for schema design decisions
  3. C.Detailed descriptions of endpoints and parameters✓ Correct
  4. D.HTML documentation for browser compatibility

Explanation

API documentation describes endpoints, formats, authentication, and examples.

Report an error in this question

Web APIs & IntegrationMedium

Q19. What is the purpose of request headers in API calls?

  1. A.Database headers for defining column schema types
  2. B.Providing metadata like auth tokens and content type✓ Correct
  3. C.Styling the request with CSS formatting rules
  4. D.Creating HTML headers for page title and navigation

Explanation

Request headers carry metadata like Content-Type and Authorization.

Report an error in this question

Web APIs & IntegrationMedium

Q20. What is a RESTful resource?

  1. A.A server resource like CPU or memory allocation
  2. B.A CSS resource like a stylesheet or font file
  3. C.A JavaScript resource loaded via script elements
  4. D.An entity identified by URL manipulated via HTTP✓ Correct

Explanation

A RESTful resource represents a data entity accessible via a URL.

Report an error in this question

Web APIs & IntegrationHard

Q21. What is GraphQL's N+1 problem and how is it solved?

  1. A.A math problem related to computational complexity
  2. B.A REST limitation with fixed endpoint over-fetching
  3. C.A CSS specificity issue with deeply nested selectors
  4. D.Nested field queries solved by DataLoader batching✓ Correct

Explanation

DataLoader batches and caches queries to solve GraphQL's N+1 problem.

Report an error in this question

Web APIs & IntegrationHard

Q22. What is an API gateway?

  1. A.A single entry point routing requests to microservices✓ Correct
  2. B.A JavaScript gateway for module import resolution
  3. C.A database gateway for managing connection pooling
  4. D.A CSS gate for controlling style cascade flow

Explanation

An API gateway centralizes request handling for microservices.

Report an error in this question

Web APIs & IntegrationHard

Q23. What is the difference between idempotent and non-idempotent methods?

  1. A.They are identical in request handling behavior
  2. B.Idempotent methods produce same result on repetition; POST may differ✓ Correct
  3. C.All HTTP methods are non-idempotent in their behavior always
  4. D.All HTTP methods are idempotent without any exceptions at all

Explanation

Idempotent methods produce the same outcome regardless of repetition.

Report an error in this question

Web APIs & IntegrationHard

Q24. What is content negotiation in APIs?

  1. A.A CSS negotiation for determining style precedence
  2. B.A database negotiation for connection pool allocation
  3. C.Negotiating API pricing for commercial usage plans
  4. D.Client and server agree on response format via headers✓ Correct

Explanation

Content negotiation uses headers to agree on the response format.

Report an error in this question

Web APIs & IntegrationHard

Q25. What is gRPC and when is it preferred over REST?

  1. A.A high-performance RPC framework using Protocol Buffers✓ Correct
  2. B.A JavaScript library for real-time data streaming
  3. C.A database protocol for distributed query execution
  4. D.A CSS framework for responsive web design layouts

Explanation

gRPC uses Protocol Buffers for efficient binary serialization and HTTP/2 for streaming.

Report an error in this question

Web APIs & IntegrationHard

Q26. What is the purpose of API throttling?

  1. A.Controlling request rates to prevent abuse and ensure fairness✓ Correct
  2. B.A CSS technique for limiting animation frame rates on pages
  3. C.A database optimization for throttling query execution speed
  4. D.Speeding up API response times with caching

Explanation

API throttling limits request rates to protect servers from overload.

Report an error in this question

Web APIs & IntegrationHard

Q27. What is the difference between polling and SSE?

  1. A.Polling is more efficient than SSE for real-time data delivery
  2. B.SSE requires WebSocket protocol to function properly always
  3. C.They are identical in data delivery approach
  4. D.Polling makes repeated requests; SSE maintains persistent connection✓ Correct

Explanation

Polling repeatedly requests data, while SSE maintains a persistent connection for server push.

Report an error in this question

Web APIs & IntegrationHard

Q28. What are API error handling best practices?

  1. A.Use appropriate status codes, consistent format, and messages✓ Correct
  2. B.Return 200 for all responses regardless of outcome
  3. C.Ignore errors and let the client handle all failures
  4. D.Use CSS error styles to display formatted error pages

Explanation

Good API error handling uses proper status codes and consistent error formats.

Report an error in this question

Web APIs & IntegrationHard

Q29. What is hypermedia-driven API design?

  1. A.A CSS animation API for creating interactive effects
  2. B.A multimedia API for playing audio and video
  3. C.An API where responses include links guiding transitions✓ Correct
  4. D.A video streaming API for delivering live content

Explanation

Hypermedia-driven APIs embed links telling clients what actions are available.

Report an error in this question

Web APIs & IntegrationHard

Q30. What is the Backend for Frontend (BFF) pattern?

  1. A.A best friend API for social networking features
  2. B.A CSS pattern for frontend-specific responsive styling
  3. C.Each frontend has its own backend aggregating services✓ Correct
  4. D.A database pattern for frontend-optimized query caching

Explanation

BFF creates tailored API layers for each frontend, aggregating microservice data.

Report an error in this question

Ready to test yourself on Web APIs & Integration?

Take a timed quiz drawn from 210+ questions on this topic. No signup required — your progress saves in your browser.

Start Web APIs & Integration Quiz