✅ API & Web Services – Web Development Interview Q&A 🌐💬
1️⃣ What is an API?
Answer:
API (Application Programming Interface) allows communication between two software systems. It defines how requests and responses should be formatted.
2️⃣ REST vs SOAP – What's the difference?
Answer:
- REST: Lightweight, uses HTTP, supports JSON/XML
- SOAP: Protocol-based, strict standards, uses XML
REST is more common for modern web services.
3️⃣ What is RESTful API?
Answer:
An API that follows REST principles:
- Uses HTTP methods (GET, POST, PUT, DELETE)
- Stateless
- Has structured endpoints
- Supports caching
4️⃣ What are HTTP status codes?
Answer:
Codes returned in response:
- 200: OK
- 201: Created
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 500: Server Error
5️⃣ What is GraphQL?
Answer:
A query language for APIs by Facebook.
- Client defines the structure of the response
- Single endpoint
- Reduces over-fetching and under-fetching of data
6️⃣ What is CORS?
Answer:
Cross-Origin Resource Sharing – A security feature in browsers that blocks requests from other origins unless explicitly allowed by the server.
7️⃣ What is rate limiting?
Answer:
Limits the number of API requests a user/client can make within a time frame to prevent abuse.
8️⃣ What is an API key and how is it used?
Answer:
An API key is a token used to authenticate and authorize access to APIs. It’s passed in headers or query strings.
9️⃣ Difference between PUT and PATCH?
Answer:
- PUT: Replaces the entire resource
- PATCH: Updates only specified fields
🔟 What is a webhook?
Answer:
A way for servers to send data automatically to other services (e.g., when an event happens). It’s push-based, unlike APIs which are pull-based.
💬 Tap ❤️ if you found this useful!
Post #1201
596
- ❤ 4