CS FundamentalsHardProduct-company API design interview
An API accepts a video for transcoding, which takes several minutes. What is the most appropriate immediate response?
- A. 200 OK after waiting until transcoding finishes
- B. 201 Created with the finished video
- C. 202 Accepted, with a URL the client can poll (or a callback) for the job's status
- D. 204 No Content
Correct answer: C. 202 Accepted, with a URL the client can poll (or a callback) for the job's status
202 says the request was accepted but processing is not complete. Holding the connection open for minutes risks timeouts; 201 would claim the resource already exists.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- What is the difference between the HTTP headers Cache-Control: no-cache and Cache-Control: no-store?
- A web app at https://app.example.com sends a PUT request with a JSON body to https://api.example.com. Before the PUT, the browser sends…
- An API uses self-contained JWT access tokens that are valid for 24 hours and are verified only by signature. A user's laptop is stolen and…
- A token-bucket rate limiter holds up to 10 tokens and refills 2 tokens per second; it starts full. A client fires requests as fast as…
- main has A-B-C. feature1 branched from C with commits D-E, and feature2 branched from E with commits F-G. feature1 is abandoned, but…
- A developer edits a tracked file app.py, creates a new file util.py, and runs git commit -a -m "update". What is committed?