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
Recall & Review
beginner
What is data compression?
Data compression is the process of making a file or data smaller so it takes up less space or can be sent faster.
Click to reveal answer
beginner
What is the difference between lossless and lossy compression?
Lossless compression keeps all original data and can be reversed exactly. Lossy compression removes some data to make files smaller but loses some detail permanently.
Click to reveal answer
beginner
Give a real-life example of data compression.
Zipping a folder on your computer to send it by email is like packing a suitcase tightly to fit more clothes in less space.
Click to reveal answer
beginner
Why do we use data compression?
We use data compression to save storage space, reduce internet data use, and speed up file transfer.
Click to reveal answer
beginner
What is an example of a lossless compression format?
PNG images and ZIP files use lossless compression, so no data is lost when compressed.
Click to reveal answer
Which of these is a key goal of data compression?
AMake files smaller
BMake files larger
CChange file format
DDelete files
✗ Incorrect
Data compression aims to reduce file size to save space or speed up transfer.
Which type of compression removes some data permanently?
ALossless
BNone
CBoth
DLossy
✗ Incorrect
Lossy compression removes some data to reduce size but cannot restore it exactly.
Which file format uses lossless compression?
AMP3
BPNG
CJPEG
DMP4
✗ Incorrect
PNG images use lossless compression, preserving all original data.
What is a real-world analogy for data compression?
AThrowing clothes away
BBuying a bigger suitcase
CFilling a suitcase tightly
DWashing clothes
✗ Incorrect
Packing a suitcase tightly is like compressing data to fit more in less space.
Why is data compression important for internet use?
AIt reduces data usage and speeds up transfer
BIt uses more data
CIt slows down downloads
DIt changes file colors
✗ Incorrect
Compression reduces file size, saving data and making downloads faster.
Explain the difference between lossless and lossy compression with examples.
Think about whether the original file can be perfectly restored.
You got /3 concepts.
Describe why data compression is useful in everyday computer use.
Consider what happens when you send or save large files.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of data compression?
easy
A. To make files smaller so they use less space
B. To make files larger for better quality
C. To change file formats randomly
D. To delete important parts of a file
Solution
Step 1: Understand the goal of compression
Compression reduces file size by encoding data more efficiently.
Step 2: Compare options to the goal
Only To make files smaller so they use less space correctly states making files smaller to save space.
Final Answer:
To make files smaller so they use less space -> Option A
Quick Check:
Compression = smaller files [OK]
Hint: Compression means smaller files to save space [OK]
Common Mistakes:
Thinking compression increases file size
Confusing compression with file format change
Believing compression deletes data
2. Which of the following is a correct description of lossless compression?
easy
A. It removes some data permanently to reduce size
B. It compresses data without losing any original information
C. It changes file format to a different type
D. It only works on images, not text
Solution
Step 1: Define lossless compression
Lossless compression reduces size but keeps all original data intact.
Step 2: Match definitions to options
It compresses data without losing any original information correctly describes lossless compression as no data loss.
Final Answer:
It compresses data without losing any original information -> Option B
Quick Check:
Lossless = no data lost [OK]
Hint: Lossless means no data is lost during compression [OK]
Common Mistakes:
Confusing lossless with lossy compression
Thinking lossless deletes data
Believing lossless only works on images
3. Consider this simple compression example: The string "AAAABBBCCDAA" is compressed by replacing repeated letters with the letter and count (e.g., A4 for AAAA). What is the compressed form?
medium
A. A4B3C2D1A2
B. 4A3B2C1D2A
C. AAAABBBCCDAA
D. ABCD
Solution
Step 1: Identify repeated letters and counts
"AAAABBBCCDAA" has A repeated 4 times, B 3 times, C 2 times, D 1 time, A 2 times.
Step 2: Write compressed form as letter + count
Following the pattern, compressed string is A4B3C2D1A2.
Final Answer:
A4B3C2D1A2 -> Option A
Quick Check:
Repeated letters + counts = A4B3C2D1A2 [OK]
Hint: Count repeats and write letter then number [OK]
Common Mistakes:
Writing count before letter
Not counting single letters
Leaving string uncompressed
4. A compression program replaces repeated words with a code but forgets to store the code mapping. What problem will occur when decompressing?
medium
A. The program will run faster
B. The file size will increase instead of decrease
C. The original data cannot be restored correctly
D. The compressed file will be empty
Solution
Step 1: Understand the role of code mapping
Code mapping links codes to original data for decompression.
Step 2: Identify impact of missing mapping
Without mapping, decompression cannot restore original data correctly.
Final Answer:
The original data cannot be restored correctly -> Option C
Quick Check:
Missing mapping = wrong decompression [OK]
Hint: Mapping needed to restore original data [OK]
Common Mistakes:
Thinking file size increases due to missing mapping
Assuming program runs faster without mapping
Believing compressed file becomes empty
5. You have a text file with many repeated phrases. Which compression method is best to reduce its size without losing any information?
hard
A. Lossy compression that removes repeated phrases
B. Deleting repeated phrases manually
C. Changing the file format to a different type
D. Lossless compression that replaces repeated phrases with codes
Solution
Step 1: Identify need for no data loss
The question requires no information loss, so lossy methods are unsuitable.
Step 2: Choose method that compresses repeated phrases without loss
Lossless compression replaces repeated phrases with codes, preserving data.
Step 3: Eliminate other options
Changing format or deleting phrases manually does not guarantee compression or data safety.
Final Answer:
Lossless compression that replaces repeated phrases with codes -> Option D
Quick Check:
No data loss + repeated phrases = lossless compression [OK]
Hint: Use lossless for repeated data without losing info [OK]
Common Mistakes:
Choosing lossy compression when data loss is not allowed