APIs Mastery Quiz

10:00

HTTP semantics, REST design, authentication, FastAPI, pagination and webhooks. · 10 questions

Question 1 of 10
Which status code best fits a successful POST that created a new resource?
Question 2 of 10
Which status code tells a client it is sending too many requests?
Question 3 of 10
Which URL follows REST naming conventions for fetching one order?
Question 4 of 10
What are the three dot-separated parts of a JWT?
Question 5 of 10
Which HTTP method is NOT idempotent by definition?
Question 6 of 10
A logged-in user requests an admin-only endpoint. Which status code is correct?
Question 7 of 10
What does FastAPI return if this endpoint receives `{"qty": "abc"}`?
class Item(BaseModel):
    qty: int

@app.post('/items')
def add(item: Item):
    return item
Question 8 of 10
Which OAuth2 flow suits a backend service calling another API with no user involved?
Question 9 of 10
Why is cursor (keyset) pagination preferred over large offsets on big tables?
Question 10 of 10
Why does this webhook check use `hmac.compare_digest` instead of `==`?
expected = hmac.new(secret, body, hashlib.sha256).hexdigest()
ok = hmac.compare_digest(expected, received)