Stop or Go? A Friendly Quiz on Synchronous vs Asynchronous I/O Quiz

  1. Blocking Behavior Defined

    Which statement best describes synchronous I/O in a simple program that reads a file before updating the screen?

    1. The program waits for the file read to finish before updating the screen.
    2. The program updates the screen while the file is still being read automatically.
    3. Synchronous I/O always uses many threds behind the scenes.
    4. Synchronous I/O is guaranteed to be faster than asynchronous I/O in all cases.
    5. Synchronous I/O means the code is asyncronous but spelled differently.
  2. Non-Blocking Concept

    When a program sends a network request using asynchronous I/O and then continues handling user input, what is happening?

    1. The program can continue processing user input while the network request is in progress.
    2. The program must stop until the network request finishes because all I/O is blocking.
    3. The program creates a new window for each request by default.
    4. The program switches from I/O-bound to CPU-bound automatically.
    5. The program is using syncronous behavior.
  3. Keeping a UI Responsive

    In a single-threaded app that loads images from disk without freezing the buttons, which approach should you choose?

    1. Use asynchronous I/O for the image loads so the UI stays responsive.
    2. Use synchronous I/O everywhere and expect the UI to remain smooth.
    3. Use a busy-wait loop to check the disk repeatedly.
    4. Disable all user input until loading finishes to avoid bugs.
    5. Rely on disk caching and keep using blocking reads.
  4. Simplicity vs Concurrency

    For a short sequence like open file, read data, and close file, which approach is usually simplest to write and understand?

    1. Synchronous I/O with straightforward step-by-step code.
    2. Asynchronous I/O with multiple nested callbaks.
    3. Asyncronous I/O with random delays inserted.
    4. Using a custom scheduler and event loop for everything.
    5. A busy-wait that polls the disk constantly.
  5. Completion Notification

    When an asynchronous file read finishes, how do programs commonly find out that the data is ready?

    1. A callback, promise, or future is triggered to deliver the result.
    2. A syntax error appears in the source code automatically.
    3. The result replaces the source file name by magic.
    4. Only by repeatedly polling with a tight loop is it possible.
    5. The process is terminated and restarted with the data.
  6. What Blocking Means for a Thread

    In blocking (synchronous) I/O, what does the active thread do while waiting for data from the network?

    1. It pauses and cannot perform other tasks until the operation completes.
    2. It continues running other unrelated tasks automatically.
    3. It hands the work to the GPU to finish instantly.
    4. It silently converts the operation into asyncronous mode.
    5. It saves and loads the entire program state every millisecond.
  7. Scalability With Many Connections

    When a server must handle thousands of mostly idle connections, which I/O model typically scales better with fewer threads?

    1. Asynchronous I/O with event-driven handling.
    2. Synchronous I/O with one thread per connection.
    3. Synchronous I/O using busy waiting on every socket.
    4. A single blocking thread that loops through connections in order.
    5. Asyncronous I/O that blocks on every read call.
  8. I/O-Bound vs CPU-Bound

    What is a true statement about using asynchronous I/O for a CPU-bound task such as large number crunching?

    1. Asynchronous I/O does not speed up CPU-bound work; it mainly helps overlap waiting for I/O.
    2. Asynchronous I/O automatically parallelizes CPU calculations.
    3. Asynchronous I/O reduces the number of CPU instructions required.
    4. Asynchronous I/O guarantees lower power usage for all tasks.
    5. Asynchronous I/O increases numeric precision during math operations.
  9. Completion Order

    If you start two asynchronous network requests A and then B, what completion order can occur in practice?

    1. B can finish before A depending on timing and network conditions.
    2. They must finish at exactly the same time by design.
    3. They always finish in the order started because async is ordered.
    4. A never finishes if B is started after it.
    5. The operating system renames them to enforce order.
  10. Error Handling Differences

    Compared to synchronous I/O that might throw an error immediately at the call site, how are errors typically delivered in asynchronous I/O?

    1. Errors are delivered later through a completion mechanism such as a callback or a rejected future.
    2. Errors are never reported in asynchronous I/O.
    3. Errors only appear as typos in variable names.
    4. Errors are converted into successful results automatically.
    5. Errors always crash the computer instantly.