Base CS from zero
Values and types: multiple-choice review
Six questions that cut across the whole unit. None of them is a definition to recite. Each asks you to apply the unit’s one idea — bits mean nothing until a type says how to read them — to a concrete situation.
Confirm you can connect every thread of the unit: a value is raw bits, a type is the rule that interprets them, the same bits decode differently under different rules, and a type system exists to stop the wrong rule from being applied.
A memory cell holds the 8-bit pattern 01000001. Two programs read it: one prints 65, the other prints the letter 'A'. Which statement is correct?
You must store a value and read it back correctly later. The starting address alone is not enough. What else must the reader know?
In JavaScript, both 42 and 36.6 report typeof === 'number'. Why is there no separate integer type?
A teammate writes: 'null and undefined are the same thing — both mean empty.' What is the precise correction?
What is the single underlying problem that every type system — static or dynamic — is built to catch?
The same type-mismatch bug can be caught at compile time or at run time. What is the practical difference between static (TypeScript) and dynamic (JavaScript) checking?
The unit’s spine in one decision chain: a value is a fixed pattern of bits with no inherent meaning; a type supplies the two missing pieces — size and interpretation — that turn bits into a value; the same bits decode to different values under different type rules; JS exposes a small set of primitives (number as one 64-bit IEEE 754 double, string, boolean, and the two distinct absences null and undefined); and a type system exists to stop the wrong rule from being applied — statically before run time, or dynamically at the moment of execution.