๐ Introduction:
Letโs be honestโinterviews can be nerve-wracking. Youโve prepared your DSA, brushed up on system design, and revised Java or JavaScript. But then comes that one simple-sounding question:
โCan you explain how an API works?โ
And suddenly, you’re stuck between buzzwords like REST, JWT, and OAuth.
Sound familiar?
Whether you’re a fresher preparing for your first job or an experienced developer switching companies, API knowledge isnโt optional anymoreโitโs essential. APIs are the glue holding modern apps together, and interviewers love to test how well you understand that glue.
In this article, weโll break down 20 must-know API terms in simple language, with relatable examples. No jargon. No fluff. Just clear explanations to help you answer confidently in interviews and understand what you actually work with daily.
๐ฅ 1. API (Application Programming Interface)
An API is a bridge that allows two software systems to communicate. It exposes functions or data, often over HTTP, which clients (like web apps or mobile apps) can consume.
๐ Example: A weather app fetches data from an external weather API to show current temperature and forecast.
๐ 2. Endpoint
An endpoint is a specific URL where an API resource can be accessed. It’s like a door into a specific piece of data or functionality.
๐ Example:
GET /users
โ Returns a list of usersGET /users/123
โ Returns user with ID 123
๐งญ 3. HTTP Methods (GET, POST, PUT, DELETE, PATCH)
These are operations used to interact with resources:
GET
โ Fetch data (read-only)POST
โ Create new dataPUT
โ Replace existing dataPATCH
โ Partially update dataDELETE
โ Remove data
๐ Example:POST /users
creates a new user with the data in the request body.
๐ 4. REST (Representational State Transfer)
REST is a popular architectural style using standard HTTP methods and stateless communication. REST APIs expose resources via URIs and often use JSON.
๐ Example:
- REST endpoint:
GET /products/201
returns product with ID 201 - Stateless: Each request is independent โ no session state is stored on the server.
๐งผ 5. SOAP (Simple Object Access Protocol)
SOAP is a protocol with strict standards and XML-based messages. Used mostly in older enterprise systems where transactional security and reliability are needed.
๐ Example: A banking system using SOAP to handle money transfers securely.
๐ฆ 6. JSON (JavaScript Object Notation)
A lightweight format to send and receive structured data in an API. Easy for humans to read and machines to parse.
๐ Example Response:
{ "name": "Alice", "email": "alice@example.com" }
๐งพ 7. XML (eXtensible Markup Language)
Like JSON, but more verbose and commonly used in SOAP. XML allows defining custom tags and supports complex data types.
๐ Example:
<user><name>Alice</name><email>alice@example.com</email></user>
๐ 8. Authentication
Verifying who the user is. Common techniques:
- API keys
- OAuth 2.0
- JWT (JSON Web Tokens)
๐ Example: A client includes a JWT token in theAuthorization
header to prove their identity.
๐ก๏ธ 9. Authorization
Decides what an authenticated user is allowed to do.
๐ Example:
- Authenticated user can access
/profile
- But only an admin can access
/admin/deleteUser
๐ซ 10. API Key
A simple token (often passed in headers) to identify and authenticate a client.
๐ Example:
GET /data
Authorization: Api-Key abc123xyz
๐ 11. Rate Limiting
Controls how many requests a client can make in a given time.
๐ Example: Free users can make 60 API calls per hour. Premium users get 1000/hour.
Helps prevent abuse and protects server resources.
๐ 12. Pagination
Used when fetching large datasets from an API by dividing the results into smaller “pages”.
๐ Example:GET /users?page=2&limit=10
โ Fetches the 2nd page with 10 users per page.
๐ 13. CORS (Cross-Origin Resource Sharing)
A browser security feature that restricts cross-origin HTTP requests.
๐ Example: A React frontend on localhost:3000
tries to call an API on api.example.com
โ it needs CORS headers like Access-Control-Allow-Origin
.
โ๏ธ 14. Webhooks
Instead of polling the server repeatedly, webhooks let the server send real-time updates to a clientโs specified endpoint.
๐ Example: Stripe uses webhooks to notify your backend when a payment is successful.
๐ 15. OAuth 2.0
An authorization framework for third-party access without sharing credentials.
๐ Example: A user logs into your app using their Google account via OAuth, which returns an access token.
๐งพ 16. JWT (JSON Web Token)
A compact, signed token for securely transmitting data between parties. Often used for stateless authentication.
๐ Example:
After login, the server sends a JWT like eyJhbGciOiJIUzI1NiIs...
The frontend includes it in future requests.
๐ 17. Swagger / OpenAPI Specification
A standard to define REST APIs with human- and machine-readable documentation. Tools like Swagger UI allow interactive testing.
๐ Example: A Swagger UI lets developers test POST /login
by entering username and password directly in the browser.
๐ 18. Idempotent Methods
An operation is idempotent if repeating it produces the same result.
๐ Example:
GET /users/1
โ Always returns the same dataDELETE /users/1
โ Deletes user once; repeated requests still return success but have no further effect
๐ 19. Headers
Headers carry metadata in API requests/responses.
๐ Common headers:
Content-Type: application/json
Authorization: Bearer <token>
X-RateLimit-Remaining: 25
๐งช 20. Status Codes
HTTP status codes indicate the result of a request:
200 OK
โ Success201 Created
โ Resource successfully created400 Bad Request
โ Client error401 Unauthorized
โ Auth needed500 Internal Server Error
โ Server crashed
๐ Example: After a successful user registration:201 Created
๐ Conclusion:
APIs arenโt just a โbackend thingโ or something only big tech companies useโtheyโre part of almost every app you build, test, or consume. Knowing how they work, what common terms mean, and how to communicate that knowledge clearly gives you a real edgeโnot just in interviews, but on the job too.
So next time someone throws around words like โrate limiting,โ โwebhooks,โ or โCORS,โ you wonโt blink. Youโll explain it like a proโand maybe even teach them something new.
Keep learning, stay curious, and remember: Itโs not about memorizing definitions, itโs about understanding the โwhyโ behind them. Thatโs what makes you a better developer.