Flashcardsfor IT Certifications

D2: Asynchronous Programming

Claude Certified Developer – Foundations exam practice questions · 10 flashcards

Question
Why use async code with the Claude API?
1 / 10

Tip: Space flips the card, ← / → navigate.

Last updated: · Report an error on this page

Show all 10 Asynchronous Programming practice questions and answers
  1. Why use async code with the Claude API?
    API calls are I/O-bound; async lets many requests run concurrently without blocking.
  2. Which Python client supports async?
    AsyncAnthropic, used with await.
  3. How do you run several Claude calls concurrently in Python?
    Use asyncio.gather (or task groups) on multiple async calls.
  4. How do you avoid hitting rate limits with concurrency?
    Cap concurrent requests (e.g. a semaphore) and back off on 429s.
  5. What does async look like in TypeScript?
    The SDK returns Promises; use async/await and Promise.all for concurrency.
  6. Why not block the event loop?
    A blocking call freezes all other work in an async server.
  7. How does async relate to streaming?
    Streams are consumed asynchronously, event by event.
  8. Async concurrency vs Batch API?
    Async: fast, full price. Batch: slower (up to 24h), cheaper.
  9. How should exceptions in concurrent tasks be handled?
    Catch per-task errors so one failure doesn't lose all results; retry failed items.
  10. What is a job queue pattern?
    Requests go into a queue processed by workers, smoothing load and enabling retries.