Data Compression MCQ Practice

Question 1 of 10

Original: XXXYYXX. Compressed with run lengths: (X,3)(Y,2)(X,2).

What is true after decompression?

  1. A. Run-length data cannot represent Y.
  2. B. The string becomes XYX only.
  3. C. The original XXXYYXX is restored exactly.
  4. D. One X is permanently missing.

Question 2 of 10

A color image stores 24 bits per pixel. A compressor keeps only 8 bits per pixel by dropping fine color differences that many viewers barely notice.

A print shop needs every original 24-bit pixel back from the compressed file alone. Is that possible?

  1. A. Yes, by repeating each 8-bit value three times.
  2. B. Only if the image depicts text.
  3. C. Yes; viewers cannot tell, so the bits must still be present.
  4. D. No; dropped color bits are not stored, so the original 24-bit pixels cannot be reconstructed.

Question 3 of 10

A CSV of repeated city names shrinks from 80 KB to 22 KB with a lossless zipper tool and then expands to a byte-identical CSV.

Which explanation fits?

  1. A. Redundancy in repeated names allowed a shorter encoding that still reconstructs every byte.
  2. B. Any shrink from 80 KB to 22 KB must discard meaning.
  3. C. Lossless tools never reduce size below half.
  4. D. The tool deleted unused rows permanently.

Question 4 of 10

Two candidates for sending a raw telescope image (scientific analysis needs exact pixel values) and a social-media crop of the same image (fast upload matters most):

Option Approach
1 Lossless for science file; lossy for social crop
2 Lossy for both
3 Lossless for social crop only
4 Lossy for science; lossless for social

Which option is most appropriate?

  1. A. 4
  2. B. 1
  3. C. 2
  4. D. 3

Question 5 of 10

Before: playlist tags [rock, rock, rock, jazz, jazz]. After encoding: rock*3, jazz*2, which expands identically.

A second encoder stores only [rock, jazz] with no counts. Expansion is ambiguous.

Which encoder is lossless for the original list?

  1. A. Both
  2. B. Neither
  3. C. Only the first encoder
  4. D. Only the second encoder

Question 6 of 10

Why can a lossy algorithm often produce a smaller file than a lossless algorithm on the same photo?

  1. A. Lossless methods always store more copies of each pixel than the original.
  2. B. Lossy methods are forbidden from using dictionaries.
  3. C. File size depends only on the file name.
  4. D. Lossy methods may discard detail permanently, removing information that lossless methods must keep.

Question 7 of 10

A student records a piano MIDI file listing each note exactly, then creates an MP3-style recording that approximates the sound wave and cannot regenerate the MIDI note list.

For recovering the exact sequence of MIDI notes, which file is usable?

  1. A. Only the MIDI file
  2. B. Only the MP3-style file
  3. C. Either file
  4. D. Neither file stores notes

Question 8 of 10

An algorithm replaces every pair of identical adjacent bytes with a single byte plus a flag. For data with no adjacent duplicates, the "compressed" output is slightly larger than the original, but expanding still returns the original bytes.

Which statement is accurate?

  1. A. The algorithm is lossy because the output can be larger.
  2. B. The algorithm is still lossless because the original bytes are fully recoverable.
  3. C. Compression is defined only when size decreases for every input.
  4. D. Flags make reconstruction impossible.

Question 9 of 10

A drone video is needed for (1) a court exhibit requiring unaltered frames and (2) a rough live preview over a weak radio link.

Which pairing is best?

  1. A. Delete the exhibit after making the preview
  2. B. Lossy exhibit, lossless preview
  3. C. Lossless exhibit file retained; lossy stream for the preview
  4. D. Lossy for both with identical settings

Question 10 of 10

Original bitmap row: WWBWWWBB. A compressor stores colors W and B and the pattern of runs. Expansion yields WWBWWWBB again.

What does this before/after example demonstrate?

  1. A. That compression always changes at least one pixel
  2. B. That bitmaps cannot be compressed
  3. C. Lossy compression because letters are abbreviated
  4. D. Lossless compression: size can fall while the original row returns