Web API – Complete MCQs

Perfect choice 👍
Below is the ENTIRE BOOK converted into MCQs, strictly following 80–20, job + interview focused, simple language, no theory dump, only thinking-based questions.

I’ve organized them part-wise, so you can directly reuse them for:

  • Practice tests

  • Website quizzes

  • YouTube MCQ videos

  • Exam prep


📘 Web API – Complete MCQs (80–20 Edition)


🔹 PART 1: Basics of Web API & HTTP

1️⃣ A Web API is mainly used to:

A. Design websites
B. Communicate between software systems
C. Store images
D. Replace databases

Answer: B


2️⃣ Which of the following best describes a Web API?

A. A webpage for users
B. A database table
C. A URL that returns data
D. A browser plugin

Answer: C


3️⃣ Which component talks directly to the database?

A. Browser
B. Frontend
C. API / Backend
D. User

Answer: C


4️⃣ Which protocol is used by Web APIs?

A. FTP
B. SMTP
C. HTTP
D. TCP only

Answer: C


5️⃣ Which HTTP method is used to fetch data?

A. POST
B. PUT
C. GET
D. DELETE

Answer: C


6️⃣ Which HTTP status code means “Success”?

A. 404
B. 500
C. 200
D. 401

Answer: C


7️⃣ JSON is mainly used for:

A. Styling UI
B. Database indexing
C. Data exchange
D. Authentication

Answer: C


8️⃣ Which is NOT an HTTP method?

A. GET
B. PUSH
C. POST
D. DELETE

Answer: B


🔹 PART 2: REST APIs

9️⃣ REST mainly focuses on:

A. Functions
B. Classes
C. Resources
D. Files

Answer: C


🔟 Which is a RESTful endpoint?

A. /getJobs
B. /fetchAllJobs
C. /jobs
D. /doJob

Answer: C


1️⃣1️⃣ REST APIs mostly use which data format?

A. XML
B. CSV
C. JSON
D. TXT

Answer: C


1️⃣2️⃣ Which HTTP method is used to update partial data?

A. PUT
B. PATCH
C. POST
D. GET

Answer: B


1️⃣3️⃣ REST APIs are:

A. Stateful
B. Stateless
C. Session-based
D. Memory-based

Answer: B


1️⃣4️⃣ Which is the correct way to version an API?

A. /jobs/new
B. /api/latest/jobs
C. /api/v1/jobs
D. /jobs/version1

Answer: C


1️⃣5️⃣ Path parameters are mainly used to:

A. Filter data
B. Sort data
C. Identify a specific resource
D. Send request body

Answer: C


🔹 PART 3: CRUD & Database

1️⃣6️⃣ CRUD stands for:

A. Create, Read, Update, Delete
B. Copy, Remove, Upload, Download
C. Connect, Run, Use, Debug
D. Create, Replace, Undo, Delete

Answer: A


1️⃣7️⃣ Which method is used to create data?

A. GET
B. POST
C. PUT
D. DELETE

Answer: B


1️⃣8️⃣ Which API call fetches a single job with ID 10?

A. GET /jobs?id=10
B. GET /jobs/10
C. POST /jobs/10
D. DELETE /jobs

Answer: B


1️⃣9️⃣ Soft delete means:

A. Deleting data permanently
B. Deleting database
C. Marking data as inactive
D. Removing table

Answer: C


2️⃣0️⃣ Which database type is best for transactions?

A. NoSQL
B. File system
C. SQL
D. Cache

Answer: C


2️⃣1️⃣ ORM is mainly used to:

A. Design UI
B. Write raw SQL
C. Simplify database operations
D. Replace APIs

Answer: C


🔹 PART 4: Authentication, Security & Errors

2️⃣2️⃣ Authentication checks:

A. What you can do
B. Who you are
C. What you see
D. Where you live

Answer: B


2️⃣3️⃣ Authorization checks:

A. Password
B. Email
C. Permissions
D. Token format

Answer: C


2️⃣4️⃣ JWT is mainly used for:

A. Styling
B. Authentication
C. Database indexing
D. Logging

Answer: B


2️⃣5️⃣ JWT token is usually sent in:

A. URL
B. Cookie only
C. Header
D. Response body

Answer: C


2️⃣6️⃣ Which status code means “Unauthorized”?

A. 403
B. 401
C. 404
D. 200

Answer: B


2️⃣7️⃣ Which is the safest practice?

A. Trust frontend validation
B. Store password in plain text
C. Validate input in API
D. Expose admin APIs publicly

Answer: C


🔹 PART 5: Performance & Reliability

2️⃣8️⃣ Pagination is used to:

A. Secure APIs
B. Reduce response size
C. Encrypt data
D. Authenticate users

Answer: B


2️⃣9️⃣ Which is a correct pagination example?

A. /jobs/all
B. /jobs?page=1&limit=10
C. /jobs/10
D. /jobs?all=true

Answer: B


3️⃣0️⃣ Caching helps to:

A. Increase DB load
B. Slow APIs
C. Improve performance
D. Delete data

Answer: C


3️⃣1️⃣ Rate limiting prevents:

A. Data loss
B. API abuse
C. Authentication
D. Pagination

Answer: B


3️⃣2️⃣ Database index improves:

A. Storage
B. Security
C. Query speed
D. UI

Answer: C


🔹 PART 6: Testing, Docs & Deployment

3️⃣3️⃣ API testing is mainly done to:

A. Design UI
B. Find bugs
C. Create database
D. Deploy servers

Answer: B


3️⃣4️⃣ Which should always be tested?

A. Only valid input
B. Only UI
C. Invalid input
D. Only database

Answer: C


3️⃣5️⃣ Swagger is mainly used for:

A. Authentication
B. API documentation
C. Caching
D. Logging

Answer: B


3️⃣6️⃣ Which is NOT an environment?

A. Local
B. Staging
C. Production
D. Compilation

Answer: D


3️⃣7️⃣ Secrets should be stored in:

A. Code files
B. GitHub repo
C. Environment variables
D. Comments

Answer: C


🔹 PART 7: Real-World Patterns & Mistakes

3️⃣8️⃣ Which API should be public?

A. Delete job
B. Add job
C. View jobs
D. Update salary

Answer: C


3️⃣9️⃣ Admin APIs should be:

A. Public
B. Cached only
C. Protected
D. Stateless only

Answer: C


4️⃣0️⃣ Which is a common API mistake?

A. Pagination
B. Versioning
C. Validation
D. No authentication

Answer: D


🎯 FINAL SCORE GUIDE

  • 35+ correct → Production-ready

  • 30–34 → Strong understanding

  • 25–29 → Revise weak parts

  • <25 → Re-read parts 1–3


🔥 What Next?

I can:

  • Convert this into online quiz format (JSON / DB-ready)

  • Create part-wise MCQ tests

  • Add explanations for each answer

  • Localize it into Hindi-English MCQs

Just tell me 👉 next step 🚀

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.