passdrill

Coding & Computers

29 cards · School · answer each one, then read the explanation. Your score tallies below. Looking for Binary, ASCII & RGB explained: how a byte becomes a letter or a color? Read the explainer.

0 / 29 answered · 0 correct

School · Coding & Computers · Card 001/029 easy

Computers represent everything - text, photos, music - using just two digits, 0 and 1 (binary), instead of the ten digits people use every day. What is the main reason computer hardware is built this way?

  1. Because early programmers found binary easier to type than decimal numbers
  2. Because binary numbers take up less digital storage space than decimal numbers for representing the same value
  3. Because the tiny electronic switches inside a computer chip are far more reliable when built to represent just two clear states, like off and on, than when built to reliably tell apart ten finely graded voltage levels
  4. Because human eyes cannot easily distinguish between ten different symbols on a screen
School · Coding & Computers · Card 002/029 easy

In computer logic, an AND gate takes two inputs and produces one output. Under what condition does an AND gate output a 1 (true)?

  1. Only when both of its inputs are 1
  2. When at least one of its two inputs is 1
  3. When exactly one of its two inputs is 1, but not both
  4. Whenever either input changes value, regardless of what it changes to
School · Coding & Computers · Card 003/029 easy

If you turn a computer completely off and then back on, any unsaved work in a running program disappears - but photos already saved to the hard drive or SSD are still there. What key difference between RAM and long-term storage explains this?

  1. RAM is physically located inside the CPU chip, while storage devices are always external plug-in accessories
  2. RAM can only hold text data, while storage devices are needed for anything else, like photos or video
  3. RAM works only when connected to the internet, while storage devices work fully offline
  4. RAM is volatile memory that needs a constant electrical charge to hold data, so it clears when power is lost, while storage devices like hard drives and SSDs retain data without power
School · Coding & Computers · Card 004/029 easy

A programmer wants to write a recipe app. Instead of writing the whole thing as one giant tangle of code, they break the problem into smaller separate parts, like 'search recipes', 'display a recipe', and 'save a favourite'. What is this problem-solving technique called in computer science?

  1. Encryption
  2. Decomposition
  3. Compilation
  4. Debugging
School · Coding & Computers · Card 005/029 medium

You're looking for a name in a printed phone book with 1,000 sorted pages. Which strategy finds it in far fewer steps: checking every page one by one from the start, or repeatedly opening to the middle of the remaining pages and deciding which half to search next?

  1. Opening the middle page each time and eliminating half the remaining pages at every step, because the pages are already sorted alphabetically, quickly narrows down where the name must be
  2. Checking every page one by one, because binary search only saves time when you already know exactly which page the name is on
  3. Opening the middle page each time, because splitting a list in half always cuts the work equally, whether or not the pages are sorted
  4. Checking every page one by one, because with only 1,000 pages, one-by-one checking and middle-splitting take roughly the same number of steps overall
School · Coding & Computers · Card 006/029 easy

In 1947, engineers working on the Harvard Mark II computer found an actual moth trapped in one of its electromechanical relays, causing a fault, and taped it into their logbook. What computing term is this famous incident credited with popularising?

  1. Byte
  2. Glitch
  3. Bug
  4. Crash
School · Coding & Computers · Card 007/029 medium

Deep inside a computer, the letter 'A' you type isn't stored as a letter at all - it's stored as a number. In the widely used ASCII text-encoding standard, what number represents the uppercase letter 'A'?

  1. 97
  2. 48
  3. 13
  4. 65
School · Coding & Computers · Card 008/029 medium

A programmer writes 'score = 0' at the start of a game's code, then later writes 'score = score + 10' every time points are earned. What does this show about what a 'variable' is in programming?

  1. A variable is a fixed value that, once set in the code, can never be changed while the program runs
  2. A variable is a named container that stores a value which can be read and changed while the program runs, letting 'score' hold different numbers at different points in the game
  3. A variable is a comment left in the code to explain what a line does, which the computer ignores when running the program
  4. A variable is a fixed instruction telling the computer to display a value on the screen
School · Coding & Computers · Card 009/029 hard

Bubble sort repeatedly steps through a list, and on each pass compares each pair of neighbouring elements. What does it do when it finds a pair that is in the wrong order?

  1. It removes one of the two elements from the list entirely
  2. It moves the smaller element all the way to the very front of the whole list immediately
  3. It swaps the two neighbouring elements, then continues comparing the next pair further along the list
  4. It stops the entire sorting process and restarts from the very beginning of the list
School · Coding & Computers · Card 010/029 hard

In 1843, Ada Lovelace published notes on Charles Babbage's proposed Analytical Engine, a mechanical general-purpose computer that was never actually built in her lifetime. What is she most credited with, based on those notes?

  1. Writing what is widely considered the first published algorithm intended to be carried out by a machine, for computing a sequence of Bernoulli numbers
  2. Physically building the first working general-purpose computer using gears and steam power
  3. Inventing the modern binary number system that all computers now use internally
  4. Coining the term 'computer' to describe a machine rather than a human calculator
School · Coding & Computers · Card 011/029 easy

A programmer wants to solve a problem, like sorting a list of names into alphabetical order. Before writing any actual code, they write down the exact, ordered sequence of steps needed to solve it — steps that would work no matter which programming language is used later. What is this step-by-step problem-solving plan called?

  1. An algorithm
  2. A variable
  3. A compiler
  4. A database
School · Coding & Computers · Card 012/029 easy

A programmer needs their game to print 'Get ready!' three times in a row before the game starts. Instead of writing the same 'print' instruction three separate times, they write it once inside a block of code that repeats it exactly three times. What programming concept lets code run more than once without retyping it?

  1. A variable
  2. A loop
  3. A comment
  4. An argument
School · Coding & Computers · Card 013/029 easy

In a simple quiz game, the code needs to display 'Correct!' if the player's answer matches the right answer, and 'Try again' if it doesn't. What programming structure lets the code choose between two different actions depending on whether something is true or false?

  1. A loop
  2. A function
  3. An if/else (conditional) statement
  4. A variable
School · Coding & Computers · Card 014/029 easy

A laptop's keyboard, screen, and internal circuit boards are all physical parts you can touch. The web browser and word processor running on that laptop are not physical — they're instructions the machine follows. What are these two general categories called?

  1. Input and output
  2. Data and information
  3. Analog and digital
  4. Hardware and software
School · Coding & Computers · Card 015/029 easy

A single binary digit, a 0 or a 1, is called a bit. Computers group these bits together into a standard-sized chunk to represent things like a single character of text. How many bits make up one of these standard chunks, called a byte?

  1. 8
  2. 4
  3. 16
  4. 2
School · Coding & Computers · Card 016/029 medium

One kind of translator program converts an entire piece of source code into machine code all at once, before the program is run, producing a separate file that then runs on its own. Another kind translates and executes the code one line at a time, stopping immediately if it hits a line it can't run. What is the first, whole-program-at-once kind of translator called?

  1. An interpreter
  2. A compiler
  3. A debugger
  4. An operating system
School · Coding & Computers · Card 017/029 medium

A digital photo is made of thousands of tiny squares called pixels. To store the exact colour of just one pixel, a typical image file uses three separate numbers, each from 0 to 255. What do these three numbers represent?

  1. The pixel's exact position on the screen (row and column)
  2. The file's total size in bytes
  3. The amount of red, green, and blue light mixed to create that pixel's colour
  4. The image's resolution in pixels per inch
School · Coding & Computers · Card 018/029 medium

Before writing real Python or Java code, a programmer first sketches their plan using plain, structured wording like 'INPUT the user's age' and 'IF age is less than 18 THEN print refused', without worrying about a real language's exact punctuation or syntax rules. What is this halfway-between-English-and-code planning tool called?

  1. Machine code
  2. A flowchart
  3. Source code
  4. Pseudocode
School · Coding & Computers · Card 019/029 hard

A programmer writes a function to calculate a number's factorial (e.g., 5! = 5×4×3×2×1). Instead of using a loop, the function is written so that, inside its own code, it calls itself with a smaller number each time, until it reaches a stopping point (like reaching 1) that returns an answer directly without calling itself again. What is this technique, where a function calls itself, called?

  1. Recursion
  2. Iteration
  3. Inheritance
  4. Abstraction
School · Coding & Computers · Card 020/029 hard

In 1989, Tim Berners-Lee, working at CERN, proposed a new way to link and browse documents stored on computers around the world, and built the first working version in 1990. People often call his invention 'the internet' — but the global network of connected computers had already existed for two decades by then. What did Berners-Lee actually invent, which runs on top of that existing network?

  1. Email
  2. The World Wide Web
  3. The first personal computer
  4. The first web browser
School · Coding & Computers · Card 021/029 easy

In 1957, Grace Hopper's team developed a program that could translate instructions written in English-like words, instead of mathematical symbols, into machine code for business data-processing tasks like payroll. What is this program, one of the first English-language data-processing compilers and a direct forerunner of COBOL, called?

  1. FORTRAN, a scientific and engineering programming language developed by IBM around the same period
  2. Flow-Matic, an English-language compiler whose design directly inspired COBOL
  3. UNIVAC, the first commercially sold electronic computer, which Hopper had helped develop earlier in her career
  4. A-0, an earlier 1952 tool that translated symbolic mathematical code using a library of call-numbered subroutines, rather than English words
School · Coding & Computers · Card 022/029 medium

Flowcharts use a standard set of shapes to map out a program's logic before any real code is written, and each shape carries its own specific meaning. What does a diamond shape represent in a flowchart?

  1. The very first or very last step of the whole algorithm, marking exactly where it begins or ends
  2. A single calculation or action being carried out, with no branching or choice involved at that step
  3. A decision point, where the flow splits into two different paths depending on whether a condition is true or false
  4. Information being typed in by a user, or a result being displayed back out to them
School · Coding & Computers · Card 023/029 medium

A programmer writes a function called addNumbers. Each time it is called, it is given two separate numbers, adds them together, and hands the resulting sum back to whichever part of the code called it. What is the general term for the two numbers it is given, and what is the term for the sum it hands back afterward?

  1. The numbers it is given are called return values, and the sum it hands back is called a parameter
  2. The numbers it is given are called variables, and functions never hand anything back — only procedures return values
  3. The numbers it is given are called arguments, and the act of handing a value back is itself called recursion
  4. The numbers it is given are called parameters, and the sum it hands back is called the return value
School · Coding & Computers · Card 024/029 hard

ASCII can represent the English alphabet, the digits 0-9, and basic punctuation using just 7 bits — 128 possible codes — but it has no way to represent an emoji, a Chinese character, or an accented letter like 'é'. What later character-encoding standard was developed to represent characters from essentially every written language, plus symbols and emoji, by using more bits per character?

  1. Extended ASCII, which reuses the exact same 128 codes as standard ASCII without adding any new ones
  2. Unicode, which uses 16 or more bits per character to cover far more symbols than ASCII's 128 codes, including accented letters, non-Latin scripts, and emoji
  3. Machine code, the lowest-level binary instructions that a computer's processor executes directly
  4. Pseudocode, a plain-English way of planning a program's logic before writing real code
School · Coding & Computers · Card 025/029 easy

An OR gate also takes two inputs and produces one output, but it uses a different rule from an AND gate for deciding when to output a 1 (true). Under what condition does an OR gate output a 1?

  1. Only when both of its two inputs are 1
  2. When exactly one of its two inputs is 1, but not both
  3. Only when neither of its two inputs is 1
  4. When at least one of its two inputs is 1
School · Coding & Computers · Card 026/029 easy

A programmer writes a loop meant to keep asking 'Enter your password:' until the user types the correct one, but makes a mistake so the condition controlling the loop is never updated and never becomes false. The program keeps asking forever and never moves on to anything else. What is this common bug, where a loop never meets its own stopping condition and runs forever, called?

  1. A syntax error
  2. An infinite loop
  3. A recursive function
  4. A compiler error
School · Coding & Computers · Card 027/029 medium

A web designer picks a colour using a code like #1A2B3C, and a technician reading a crashed program's memory sees values written like 'FF 00 3C'. Both are using hexadecimal (base 16) instead of writing out the actual binary that the computer stores internally. What is the main practical reason hexadecimal is used as a human-friendly stand-in for binary in situations like these?

  1. Hexadecimal numbers take up less storage space inside the computer than the binary values they represent
  2. Computer chips can only process data in base 16, so hexadecimal must be used anywhere data is shown
  3. Each hexadecimal digit represents exactly four binary digits, so a long string of binary digits can be written as a much shorter hexadecimal string that still converts back and forth exactly
  4. Hexadecimal was chosen arbitrarily by early programmers purely as a stylistic preference, with no mathematical relationship to binary
School · Coding & Computers · Card 028/029 medium

A student writes a program meant to calculate the average of three test scores, but mistakenly adds the three scores together and forgets to divide by three. When they run the program, it runs successfully from start to finish and prints a number on screen — just the wrong one. What type of programming error is this, where the code is grammatically valid and runs without crashing but still produces an incorrect result because of a flaw in its reasoning?

  1. A syntax error, because the program only produces wrong output when its code breaks a language's grammar rules
  2. A runtime error, because the program's operating system forcibly halts it partway through execution
  3. A compiler error, because translating the source code into machine code failed partway through
  4. A logic error, because the program's structure and grammar are both valid and it runs to completion, but a mistake in its reasoning produces an incorrect result
School · Coding & Computers · Card 029/029 hard

In a 1965 magazine article titled 'Cramming More Components onto Integrated Circuits,' engineer Gordon Moore looked at how many transistors could be packed onto a silicon chip and noticed the number had been roughly doubling at a regular interval. Updated a decade later into its now-famous form, what trend does the observation popularly known as 'Moore's Law' describe?

  1. The amount of electricity a computer chip consumes doubles every two years as chips get more powerful
  2. The number of transistors that can be fitted onto a chip of a given size roughly doubles about every two years
  3. The price of a finished computer halves every two years as manufacturing techniques improve
  4. The speed of home internet connections doubles every two years as network hardware improves