Bird
Raised Fist0
Postmantesting~20 mins

Example requests and responses in Postman - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Postman Testing Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
1:00remaining
What is the response status code for a successful GET request?

In Postman, you send a GET request to a valid API endpoint. What status code do you expect in the response for a successful request?

A200
B404
C500
D302
Attempts:
2 left
💡 Hint

Think about the standard HTTP status code for success.

❓ assertion
intermediate
1:30remaining
Which Postman test script correctly asserts the response body contains a specific key?

You want to check if the JSON response body has a key named userId. Which test script is correct?

Apm.test('Response has userId', () => { pm.response.json().has('userId'); });
Bpm.test('Response has userId', () => { pm.expect(pm.response.json()).to.have.property('userId'); });
Cpm.test('Response has userId', () => { pm.expect(pm.response.body).to.include('userId'); });
Dpm.test('Response has userId', () => { pm.expect(pm.response.json().userId).to.exist; });
Attempts:
2 left
💡 Hint

Use pm.expect with to.have.property to check keys in JSON.

🧠 Conceptual
advanced
1:00remaining
What does a 401 HTTP response code indicate in API testing?

When testing an API, you receive a 401 status code. What does this mean?

AThe request was successful and data is returned.
BThe requested resource was not found on the server.
CThe client is not authorized to access the requested resource.
DThe server encountered an internal error.
Attempts:
2 left
💡 Hint

Think about authentication and permission errors.

🔧 Debug
advanced
1:30remaining
Why does this Postman test script fail with an error?

Look at this test script:

pm.test('Check name', () => { pm.expect(pm.response.json().name).to.equal; });

Why does it fail?

Postman
pm.test('Check name', () => { pm.expect(pm.response.json().name).to.equal; });
AThe <code>to.equal</code> assertion is missing the expected value argument.
BThe test script is missing a semicolon at the end.
CThe <code>pm.response.json()</code> method is incorrect and should be <code>pm.response.body</code>.
DThe <code>pm.expect</code> function cannot be used inside <code>pm.test</code>.
Attempts:
2 left
💡 Hint

Check the syntax of the assertion method.

❓ framework
expert
2:00remaining
Which Postman feature allows running a collection of requests with different data sets automatically?

You want to test an API with many input values without manually changing each request. Which Postman feature helps you do this?

AMock Server to simulate responses
BPre-request scripts to modify headers
CMonitor to schedule requests
DCollection Runner with data files (CSV or JSON)
Attempts:
2 left
💡 Hint

Think about running many tests automatically with different inputs.

Practice

(1/5)
1. What is the main purpose of example requests and responses in Postman?
easy
A. To design website layouts
B. To create new APIs automatically
C. To write backend server code
D. To show how to use an API step-by-step

Solution

  1. Step 1: Understand the role of example requests

    Example requests demonstrate how to call an API with real data.
  2. Step 2: Understand the role of example responses

    Example responses show what the API returns for those requests.
  3. Final Answer:

    To show how to use an API step-by-step -> Option D
  4. Quick Check:

    Example requests + responses = API usage guide [OK]
Hint: Examples explain API use clearly and simply [OK]
Common Mistakes:
  • Thinking examples create APIs
  • Confusing examples with coding
  • Assuming examples design UI
2. Which of the following is the correct way to add an example response in Postman?
easy
A. Change the request method to POST
B. Click 'Save Response' after sending a request
C. Edit the URL in the Params tab
D. Write code in the Tests tab

Solution

  1. Step 1: Identify how to save example responses

    After sending a request, Postman allows saving the response as an example.
  2. Step 2: Confirm the correct action

    Clicking 'Save Response' saves the current response as an example for future reference.
  3. Final Answer:

    Click 'Save Response' after sending a request -> Option B
  4. Quick Check:

    Save response = example response [OK]
Hint: Save response after request to create example [OK]
Common Mistakes:
  • Trying to add examples by editing URL
  • Confusing Tests tab with examples
  • Changing method does not save examples
3. Given this example request in Postman:
{
  "name": "Alice",
  "age": 30
}

And this example response:
{
  "id": 101,
  "name": "Alice",
  "age": 30
}

What does the response show?
medium
A. The API ignores the age field
B. The API returns an error because of missing fields
C. The API returns the user data with a new ID
D. The API returns only the ID

Solution

  1. Step 1: Compare request and response fields

    The request sends name and age; the response adds an id field.
  2. Step 2: Understand the meaning of added id

    The id is usually a unique identifier assigned by the API to the new user.
  3. Final Answer:

    The API returns the user data with a new ID -> Option C
  4. Quick Check:

    Response adds id to request data [OK]
Hint: Response adds new info like ID to request data [OK]
Common Mistakes:
  • Assuming error without error message
  • Ignoring added id field
  • Thinking age is removed
4. You saved an example response in Postman, but it shows outdated data. What is the best way to fix this?
medium
A. Send the request again and save the new response as example
B. Edit the example response manually in the editor
C. Delete the request and create a new one
D. Change the request URL to a different API

Solution

  1. Step 1: Identify how to update example responses

    Example responses reflect saved data; to update, you must get fresh data from the API.
  2. Step 2: Choose the correct update method

    Sending the request again gets current data; saving it updates the example correctly.
  3. Final Answer:

    Send the request again and save the new response as example -> Option A
  4. Quick Check:

    Refresh example by resending and saving response [OK]
Hint: Resend request and save response to update example [OK]
Common Mistakes:
  • Editing example manually can cause errors
  • Deleting request is unnecessary
  • Changing URL changes API, not example
5. You want to create an example request and response in Postman to show how to update a user's email. Which steps should you follow?
hard
A. Send a PUT request with new email, then save the response as example
B. Write the new email in the Tests tab and save the request
C. Change the request method to GET and save the response
D. Delete the user and create a new example request

Solution

  1. Step 1: Use the correct HTTP method for update

    PUT is the standard method to update existing data like email.
  2. Step 2: Save the response after sending the update request

    Saving the response as example shows the API's reply to the update.
  3. Final Answer:

    Send a PUT request with new email, then save the response as example -> Option A
  4. Quick Check:

    Update with PUT + save response example [OK]
Hint: Use PUT for update, then save response example [OK]
Common Mistakes:
  • Using GET instead of PUT for update
  • Editing Tests tab does not create examples
  • Deleting user is unrelated
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