Bird
Raised Fist0
Postmantesting~20 mins

REST API fundamentals review in Postman - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
REST API Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding HTTP Methods in REST APIs

Which HTTP method is typically used to update an existing resource partially in a REST API?

APUT
BPOST
CPATCH
DGET
Attempts:
2 left
💡 Hint

Think about the method that allows partial updates without replacing the entire resource.

❓ Predict Output
intermediate
1:30remaining
Response Status Code Interpretation

What is the expected HTTP status code returned by a REST API after successfully creating a new resource?

A201 Created
B200 OK
C204 No Content
D400 Bad Request
Attempts:
2 left
💡 Hint

It indicates that a new resource was successfully created.

❓ assertion
advanced
2:00remaining
Validating JSON Response Structure

You receive this JSON response from a REST API call:

{"userId": 123, "name": "Alice", "email": "alice@example.com"}

Which Postman test script assertion correctly verifies the presence of the email field?

Apm.test('Email field exists', () => { pm.response.to.have.jsonBody('email'); });
Bpm.test('Email field exists', () => { pm.response.body.email !== null; });
Cpm.test('Email field exists', () => { pm.response.json().email !== undefined; });
Dpm.test('Email field exists', () => { pm.expect(pm.response.json()).to.have.property('email'); });
Attempts:
2 left
💡 Hint

Use Postman's pm.expect with to.have.property to check JSON keys.

🔧 Debug
advanced
1:30remaining
Identifying the Cause of a 401 Unauthorized Error

You send a GET request to a protected REST API endpoint using Postman but receive a 401 Unauthorized response. Which of the following is the most likely cause?

AAuthentication credentials are missing or invalid.
BThe server is down.
CThe request body is missing required fields.
DThe API endpoint URL is incorrect.
Attempts:
2 left
💡 Hint

401 status means the server refuses access due to authentication issues.

❓ framework
expert
2:00remaining
Automating REST API Tests in Postman Collections

Which Postman feature allows you to run a series of API requests with tests automatically and generate a detailed report?

APostman Monitor
BPostman Collection Runner
CPostman Runner
DPostman Console
Attempts:
2 left
💡 Hint

It runs multiple requests in sequence and shows test results.

Practice

(1/5)
1. Which HTTP method is typically used to retrieve data from a REST API without changing it?
easy
A. POST
B. GET
C. PUT
D. DELETE

Solution

  1. Step 1: Understand HTTP methods

    GET is used to request data without modifying it, while POST, PUT, DELETE change data.
  2. Step 2: Identify method for data retrieval

    Since we want to retrieve data without changes, GET is the correct method.
  3. Final Answer:

    GET -> Option B
  4. Quick Check:

    Retrieve data = GET [OK]
Hint: GET is for reading data, others modify it [OK]
Common Mistakes:
  • Confusing POST with GET for data retrieval
  • Using DELETE to get data
  • Thinking PUT retrieves data
2. Which of the following is the correct way to set the HTTP method to POST in Postman?
easy
A. Add 'method: POST' in the Headers tab
B. Type 'POST' in the URL field
C. Select POST from the dropdown next to the URL input
D. Use the Body tab to set method to POST

Solution

  1. Step 1: Locate HTTP method selector in Postman

    Postman has a dropdown menu next to the URL field to choose HTTP methods.
  2. Step 2: Confirm correct method selection

    Selecting POST from this dropdown sets the request method properly.
  3. Final Answer:

    Select POST from the dropdown next to the URL input -> Option C
  4. Quick Check:

    Method dropdown sets HTTP method [OK]
Hint: Use dropdown near URL to pick method [OK]
Common Mistakes:
  • Typing method name in URL field
  • Trying to set method in Headers
  • Confusing Body tab with method setting
3. What will be the status code returned by a successful DELETE request in a REST API?
medium
A. 404 Not Found
B. 201 Created
C. 200 OK
D. 204 No Content

Solution

  1. Step 1: Understand DELETE success responses

    A successful DELETE often returns 204 No Content, meaning the resource was deleted and no content is returned.
  2. Step 2: Compare other status codes

    200 OK means success with content, 201 Created is for new resource creation, 404 Not Found means resource missing.
  3. Final Answer:

    204 No Content -> Option D
  4. Quick Check:

    DELETE success = 204 No Content [OK]
Hint: DELETE success usually returns 204 No Content [OK]
Common Mistakes:
  • Choosing 201 Created for DELETE
  • Assuming 200 OK always returns content
  • Confusing 404 with success
4. You send a POST request in Postman but get a 405 Method Not Allowed error. What is the most likely cause?
medium
A. The API endpoint does not support POST method
B. The URL is incorrect
C. The request body is empty
D. The server is down

Solution

  1. Step 1: Understand 405 error meaning

    405 Method Not Allowed means the server recognizes the URL but the HTTP method used is not supported on that endpoint.
  2. Step 2: Eliminate other options

    Incorrect URL usually gives 404, empty body usually does not cause 405, server down causes no response or 5xx errors.
  3. Final Answer:

    The API endpoint does not support POST method -> Option A
  4. Quick Check:

    405 = Method not allowed on endpoint [OK]
Hint: 405 means method not allowed on URL [OK]
Common Mistakes:
  • Confusing 405 with 404 Not Found
  • Assuming empty body causes 405
  • Thinking server down causes 405
5. You want to test a REST API endpoint that updates user data. Which combination of HTTP method and Postman feature is best to use?
hard
A. PUT method with Body tab to send JSON data
B. GET method with Params tab to send JSON data
C. DELETE method with Headers tab to send JSON data
D. POST method with URL query parameters

Solution

  1. Step 1: Identify method for updating data

    PUT is the standard HTTP method to update existing data in REST APIs.
  2. Step 2: Choose Postman feature to send data

    The Body tab allows sending JSON data payload, which is needed to update user data.
  3. Step 3: Evaluate other options

    GET does not update data, DELETE removes data, and URL query parameters are not suitable for sending JSON update data.
  4. Final Answer:

    PUT method with Body tab to send JSON data -> Option A
  5. Quick Check:

    Update data = PUT + Body JSON [OK]
Hint: Use PUT with Body for updates in Postman [OK]
Common Mistakes:
  • Using GET to update data
  • Sending JSON in URL parameters
  • Confusing DELETE with update
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard