Practice Data Representation in CS Thinking

Use these practice problems to test your method after reviewing the concept explanation and worked examples.

Quick Recap

The way information—numbers, text, images, and sound—is encoded as binary digits (0s and 1s) inside a computer. Different encoding schemes map real-world data to binary patterns, such as ASCII/Unicode for text, RGB for colors, and sampling for audio.

Turning real-world things (text, images, sound) into numbers a computer can process.

Showing a random 20 of 50 problems.

Example 1

medium
Convert 11111211111_2 to decimal.

Example 2

easy
A pixel uses 11 byte for grayscale brightness (00=black, 255255=white). How many distinct shades are possible?

Example 3

easy
True or false: the same image can be stored as PNG or JPEG with different trade-offs.

Example 4

easy
In ASCII, 'A' is 6565. What decimal code is 'D'?

Example 5

hard
A song is 33 minutes long, sampled at 4410044100 Hz, stereo (2 channels), 1616 bits/sample. What is the uncompressed file size in megabytes (use 11 MB =106= 10^6 bytes)?

Example 6

medium
Convert decimal 100100 to binary.

Example 7

medium
The word 'CAT' is stored in ASCII with C=67, A=65, T=84. How many bytes does it take using 11 byte per character?

Example 8

easy
What is 255255 in binary (8 bits)?

Example 9

medium
A grayscale image is 640×480640 \times 480 with 88 bits per pixel. What is its uncompressed size in kilobytes (use 11 KB =1000= 1000 bytes)?

Example 10

medium
A color stored as 1616-bit RGB uses 55 bits each for R and B and 66 for G. How many distinct greens are possible?

Example 11

medium
UTF-16 uses 2 bytes per character; ASCII uses 1. Storing 100 ASCII letters in each, how many more bytes does UTF-16 use?

Example 12

medium
Convert decimal 2626 to binary.

Example 13

challenge
You design a 3-bit code for 88 symbols, but later need a 9th symbol. What is the minimum number of bits needed now, and what is the cost in storage for 10001000 symbols?

Example 14

medium
Add 1102+1012110_2 + 101_2. Give the binary result.

Example 15

easy
How many distinct values can 44 bits represent?

Example 16

hard
Convert decimal 200200 to binary (8 bits).

Example 17

easy
Doubling the bits per audio sample tends to do what to file size?

Example 18

easy
Convert decimal 55 to binary.

Example 19

medium
How many bits are needed to represent at least 10001000 distinct values?

Example 20

easy
True or false: doubling the sample rate of an audio file roughly doubles its size.