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 111112 to decimal.

Example 2

easy
A pixel uses 1 byte for grayscale brightness (0=black, 255=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 65. What decimal code is 'D'?

Example 5

hard
A song is 3 minutes long, sampled at 44100 Hz, stereo (2 channels), 16 bits/sample. What is the uncompressed file size in megabytes (use 1 MB =106 bytes)?

Example 6

medium
Convert decimal 100 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 1 byte per character?

Example 8

easy
What is 255 in binary (8 bits)?

Example 9

medium
A grayscale image is 640×480 with 8 bits per pixel. What is its uncompressed size in kilobytes (use 1 KB =1000 bytes)?

Example 10

medium
A color stored as 16-bit RGB uses 5 bits each for R and B and 6 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 26 to binary.

Example 13

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

Example 14

medium
Add 1102+1012. Give the binary result.

Example 15

easy
How many distinct values can 4 bits represent?

Example 16

hard
Convert decimal 200 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 5 to binary.

Example 19

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

Example 20

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