Challenge - 5 Problems
Async Operation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate1:00remaining
What is the HTTP status code returned for an accepted long-running operation?
Consider a REST API that starts a long-running operation and immediately returns a response. What HTTP status code should the server return to indicate the request was accepted but processing is not complete?
Attempts:
2 left
💡 Hint
Think about the status code that means the request is accepted but still processing.
✗ Incorrect
The 202 Accepted status code means the server has accepted the request but the processing is not finished yet. This is common for long-running operations.
❓ Predict Output
intermediate1:00remaining
What is the typical HTTP header used to provide the URL for checking operation status?
When a long-running operation is accepted, the server often provides a URL where the client can check the status. Which HTTP header is commonly used to provide this URL?
Attempts:
2 left
💡 Hint
This header tells the client where to find the resource or status.
✗ Incorrect
The Location header is used to provide the URL where the client can check the status of the long-running operation.
❓ Predict Output
advanced1:30remaining
What is the expected JSON response when polling a long-running operation that is still in progress?
A client polls the status URL of a long-running operation. The operation is still running. What JSON response should the server return to indicate this?
Rest API
HTTP/1.1 200 OK Content-Type: application/json { "status": "InProgress" }
Attempts:
2 left
💡 Hint
The status should clearly say the operation is still running.
✗ Incorrect
When the operation is still running, the server returns a JSON with "status": "InProgress" to indicate the client should keep waiting.
❓ Predict Output
advanced1:30remaining
What is the correct final JSON response when a long-running operation completes successfully?
After polling, the long-running operation finishes successfully. What JSON response should the server return?
Rest API
HTTP/1.1 200 OK Content-Type: application/json { "status": "Succeeded", "result": { "message": "Operation completed" } }
Attempts:
2 left
💡 Hint
The status should indicate success and include the result.
✗ Incorrect
The server returns "status": "Succeeded" and includes the result data when the operation finishes successfully.
🧠 Conceptual
expert2:00remaining
Which HTTP method is best suited for starting a long-running operation that creates a resource asynchronously?
You want to design a REST API where clients start a long-running operation that creates a new resource asynchronously. Which HTTP method should you use to start this operation?
Attempts:
2 left
💡 Hint
Think about which method is used to create resources or trigger actions.
✗ Incorrect
The POST method is used to create resources or trigger operations that may take time. GET is for reading, PUT for replacing, DELETE for removing.