Bird
Raised Fist0
Intro to Computingfundamentals~10 mins

Why understanding hardware builds intuition in Intro to Computing - Test Your Understanding

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print the number of CPU cores available on the system.

Intro to Computing
import os
cores = os.cpu_count()
print('CPU cores:', [1])
Drag options to blanks, or click blank then click option'
Acpu_count
Bos
Ccores
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using the function name instead of the variable.
Trying to print the module name.
2fill in blank
medium

Complete the code to calculate the total memory in bytes using the given hardware info dictionary.

Intro to Computing
hardware_info = {'memory_gb': 8}
total_bytes = hardware_info['memory_gb'] * [1]
print('Total memory in bytes:', total_bytes)
Drag options to blanks, or click blank then click option'
A1024 * 1024 * 1024
B1024 * 1024
C1000 * 1000 * 1000
D1024
Attempts:
3 left
💡 Hint
Common Mistakes
Using 1000 instead of 1024 for conversion.
Multiplying by 1024 only once or twice.
3fill in blank
hard

Fix the error in the code to correctly calculate the CPU speed in MHz from GHz.

Intro to Computing
cpu_speed_ghz = 3.5
cpu_speed_mhz = cpu_speed_ghz [1] 1000
print('CPU speed in MHz:', cpu_speed_mhz)
Drag options to blanks, or click blank then click option'
A/
B-
C+
D*
Attempts:
3 left
💡 Hint
Common Mistakes
Using division or addition instead of multiplication.
Confusing units.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each device name to its RAM size in MB.

Intro to Computing
devices = {'laptop': 8, 'tablet': 4, 'phone': 2}
ram_mb = { [1]: [2] * 1024 for [1] in devices }
Drag options to blanks, or click blank then click option'
Adevice
Bdevices[device]
Cram
Ddevice_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent variable names.
Not multiplying RAM size by 1024.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that includes only devices with RAM greater than 3 GB, converting RAM to MB.

Intro to Computing
devices = {'laptop': 8, 'tablet': 4, 'phone': 2}
filtered_ram = { [1]: devices[[2]] * 1024 for [3] in devices if devices[[2]] > 3 }
Drag options to blanks, or click blank then click option'
Aname
Ddevice
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names inconsistently.
Not filtering correctly.

Practice

(1/5)
1. Why is it helpful to understand computer hardware when learning programming?
easy
A. It helps you understand how software controls physical parts.
B. It allows you to write code without using a computer.
C. It replaces the need to learn programming languages.
D. It makes computers run faster automatically.

Solution

  1. Step 1: Understand the role of hardware

    Hardware consists of physical parts like CPU, memory, and storage that perform tasks.
  2. Step 2: Connect hardware to software

    Software sends instructions to hardware to perform actions, so knowing hardware helps understand software behavior.
  3. Final Answer:

    It helps you understand how software controls physical parts. -> Option A
  4. Quick Check:

    Hardware knowledge = better software understanding [OK]
Hint: Think: software tells hardware what to do [OK]
Common Mistakes:
  • Thinking hardware knowledge replaces programming skills
  • Believing hardware knowledge speeds up computers automatically
  • Assuming hardware knowledge means no need for software
2. Which of the following correctly describes the function of a CPU in a computer?
easy
A. It stores all the data permanently.
B. It displays images on the screen.
C. It connects the computer to the internet.
D. It processes instructions and performs calculations.

Solution

  1. Step 1: Identify CPU's role

    The CPU (Central Processing Unit) is the brain of the computer that processes instructions and calculations.
  2. Step 2: Compare options

    A describes storage, B describes display, and D describes network functions, so only C fits CPU.
  3. Final Answer:

    It processes instructions and performs calculations. -> Option D
  4. Quick Check:

    CPU = processor and calculator [OK]
Hint: CPU = brain that processes instructions [OK]
Common Mistakes:
  • Confusing CPU with storage or display devices
  • Thinking CPU connects to the internet
  • Assuming CPU stores data permanently
3. Consider this simple flowchart of a computer program interacting with hardware:



What is the role of the CPU in this flowchart?
medium
A. To process the input data and produce output.
B. To start and end the program.
C. To display the output result on the screen.
D. To receive input data from the user.

Solution

  1. Step 1: Analyze flowchart steps

    The flowchart shows input, CPU processing, output, and program start/end.
  2. Step 2: Identify CPU's role

    The CPU processes the input data to produce the output result, as shown in the middle step.
  3. Final Answer:

    To process the input data and produce output. -> Option A
  4. Quick Check:

    CPU = data processor in flowchart [OK]
Hint: CPU processes data between input and output [OK]
Common Mistakes:
  • Confusing CPU with input or output devices
  • Thinking CPU controls program start/end
  • Assuming CPU displays output directly
4. A student wrote this description: "The RAM permanently stores all files on the computer." What is wrong with this statement?
medium
A. RAM is used only for displaying images.
B. RAM is temporary memory, not permanent storage.
C. RAM connects the computer to the internet.
D. RAM processes instructions like the CPU.

Solution

  1. Step 1: Understand RAM's function

    RAM (Random Access Memory) temporarily holds data and programs while the computer is on.
  2. Step 2: Identify error in statement

    Permanent storage is done by hard drives or SSDs, not RAM, so the statement is incorrect.
  3. Final Answer:

    RAM is temporary memory, not permanent storage. -> Option B
  4. Quick Check:

    RAM = temporary memory, not permanent [OK]
Hint: RAM loses data when power is off [OK]
Common Mistakes:
  • Thinking RAM saves files permanently
  • Confusing RAM with storage devices
  • Assuming RAM processes instructions
5. Imagine you want to explain to a friend why understanding hardware helps when learning to code. Which example best shows this connection?
hard
A. Knowing the screen size helps you choose font colors.
B. Understanding the keyboard layout helps you type faster.
C. Knowing how the CPU executes instructions helps you write efficient loops.
D. Understanding the internet speed helps you write code.

Solution

  1. Step 1: Identify hardware knowledge related to coding

    Understanding CPU execution helps you know how code runs step-by-step.
  2. Step 2: Evaluate options for relevance

    Knowing how the CPU executes instructions helps you write efficient loops. links CPU knowledge to writing efficient code; others relate to peripherals or network, less relevant.
  3. Final Answer:

    Knowing how the CPU executes instructions helps you write efficient loops. -> Option C
  4. Quick Check:

    CPU knowledge improves coding efficiency [OK]
Hint: CPU knowledge helps optimize code logic [OK]
Common Mistakes:
  • Choosing unrelated hardware knowledge like keyboard or screen
  • Confusing internet speed with coding skills
  • Ignoring how hardware affects code execution