By Fatskills Exam Guides Team — the exam nerds behind 28,500+ quizzes and 2.1M practice questions across 500+ global exams.
Input-Output (I/O) is the mechanism by which a computer system receives data (input) and produces results (output). It bridges the gap between human-readable information and machine-executable operations.
Why it’s on your exam: - Tests your ability to trace data flow through a system. - Appears in programming, systems design, and hardware exams (e.g., GCSE/A-Level Computing, AP Computer Science, CompTIA A+, job interviews for software roles). - Questions typically ask: - "What is the output of this code given input X?" - "Which I/O device is best suited for task Y?" - "Explain the role of buffers in I/O operations."
What the examiner wants: - You to predict outputs from given inputs. - You to select the right I/O device for a scenario. - You to explain I/O bottlenecks (e.g., why a keyboard is slower than a hard drive).
Master these before attempting questions:
Examiner trap: A touchscreen is both input and output.
I/O Devices vs. I/O Operations
Key distinction: A USB drive is a device; copying a file to it is an operation.
Buffers and Latency
Exam warning: If a question mentions "buffer overflow", it’s testing your understanding of memory limits.
Synchronous vs. Asynchronous I/O
input()
Exam clue: If a question says "non-blocking", it’s asynchronous.
Standard Streams
input("Enter name: ")-process (store in variable)-print("Hello, " + name)
[Input Device]-[Buffer]-[CPU]-[Buffer]-[Output Device]
Violation: Printing a variable before it’s defined-runtime error.
Buffer Size Formula (for numerical questions): Buffer Size (bytes) = Data Rate (bytes/sec) × Latency (sec)
Buffer Size (bytes) = Data Rate (bytes/sec) × Latency (sec)
Example: A printer outputs 100 bytes/sec with a 2-second delay-buffer = 200 bytes.
Standard I/O Streams (for programming questions):
scanf()
print()
printf()
sys.stderr.write()
Question: What is the output of the following Python code if the user enters 5?
5
x = input("Enter a number: ") print(x + 3)
Step-by-Step:1. input() returns a string, not an integer.2. x stores "5" (not 5).3. "5" + 3-TypeError (can’t add string + integer).4. Key rule: input() always returns a string unless converted.
x
"5"
"5" + 3
Answer: Error (TypeError: can only concatenate str to str).
Question: A hospital needs to monitor a patient’s heart rate in real-time. Which I/O device is most appropriate? A) Keyboard B) ECG Sensor C) Printer D) Hard Drive
Step-by-Step:1. Input or output? Monitoring-input (data from patient to system).2. Real-time? Must capture data continuously-rules out keyboard (manual) and hard drive (storage, not live).3. ECG Sensor is designed for biometric input.4. Printer is output-eliminate.
Answer: B) ECG Sensor
Question: A network router receives data at 10 MB/sec but can only process 8 MB/sec. What is the minimum buffer size needed to avoid data loss if the processing delay is 0.5 seconds?
Step-by-Step:1. Data rate difference: 10 MB/sec (in) - 8 MB/sec (out) = 2 MB/sec excess.2. Buffer size formula: Buffer = Excess Rate × Delay = 2 MB/sec × 0.5 sec = 1 MB.3. Key rule: Buffer must hold the overflow during the delay.
Buffer = Excess Rate × Delay
Answer: 1 MB
x = input("Enter number: "); print(x + 5)
10
x = int(input())
stdout
stderr
2>
x = input()
print(x)
Ask: "Is this a string or number?"
For device questions:
Both?-Touchscreen, game controller.
Buffer questions:
Buffer = (Input Rate - Output Rate) × Delay
Mnemonic: "B = (I - O) × D" (like "BID").
Eliminate absurd options:
7
What is the output of the following Python code if the user enters 4?
4
num = input("Enter a number: ") print(num * 2)
A) 8 B) 44 C) TypeError D) 4
8
44
TypeError
Correct Answer: B) 44 Explanation: input() returns a string, so "4" * 2 repeats the string ("44"). Why Distractors Are Tempting: - A) Assumes num is an integer. - C) Thinks * is invalid for strings (but it’s valid for repetition). - D) Thinks input() returns the same value.
"4" * 2
"44"
num
*
Which I/O device is not primarily an input device? A) Microphone B) Scanner C) Projector D) Barcode Reader
Correct Answer: C) Projector Explanation: A projector displays output; the others capture input. Why Distractors Are Tempting: - A/B/D) All are clearly input devices. - C) Some projectors have input ports, but their primary function is output.
A program reads data from a file and prints it to the screen. Which standard streams are used? A) stdin and stdout B) stdout and stderr C) stdin and stderr D) Only stdout
Correct Answer: A) stdin and stdout Explanation: - File-stdin (input stream). - Screen-stdout (output stream). Why Distractors Are Tempting: - B) stderr is for errors, not normal output. - C) stderr is irrelevant here. - D) Ignores the input step.
A printer can output 120 pages/minute, but the computer sends data at 200 pages/minute. What is the minimum buffer size needed to avoid data loss if the printer takes 1 second to start? A) 80 pages B) 1.33 pages C) 1 page D) 0.8 pages
Correct Answer: B) 1.33 pages Explanation:1. Excess rate: 200 - 120 = 80 pages/minute.2. Convert to pages/sec: 80 ÷ 60-1.33 pages/sec.3. Buffer size: 1.33 pages/sec × 1 sec = 1.33 pages. Why Distractors Are Tempting: - A) Uses pages/minute instead of pages/sec. - C) Assumes no delay. - D) Reverses the calculation.
Which of the following is an example of asynchronous I/O? A) A Python program using input() to wait for user input. B) A web browser downloading a file while the user scrolls. C) A printer printing a document after receiving all data. D) A keyboard sending keystrokes to a text editor.
Correct Answer: B) A web browser downloading a file while the user scrolls. Explanation: Asynchronous I/O allows the program to continue running while I/O happens in the background. Why Distractors Are Tempting: - A) input() is synchronous (blocks execution). - C) Printers typically use synchronous I/O. - D) Keyboard input is synchronous (program waits for keystrokes).
int
float
List 10 I/O devices and classify them as input/output/both.
Day 1 (Core Rules):
Solve device selection questions (e.g., "Which device for X?").
Day 2 (Practice):
Take timed MCQs (aim for <1 min per question).
Day 2 (Mock Exam):
open()
read()
write()
Join 4M+ learners. Unlock unlimited quizzes, wrong-answer tracking, flashcards + reminders, study guides, and 1-on-1 challenges.