← Google Interview Insights

Google·Software Engineer·Technical Phone Screen·Intermediate

IntermediatePrefer not to say
May 2026

Summary

Google interview question on compression, the kind that sounds like a CS 101 warmup until you're actually in it trying to explain DCT coefficients and entropy coding in the same breath.

Questions Asked (1)

Q1

How do image compression and text compression work, and what are the similarities and differences between them?

Technical Trade-offsSystem DesignAlgorithms & Data Structures
Author's notes

I started with the easy stuff, run-length encoding for text, lossy vs lossless for images, but then kind of trailed off when trying to connect them.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Start by defining compression and its two main types: lossless and lossy. Then explain how each applies to text and images, highlighting key algorithms and trade-offs. Conclude with a comparison of similarities and differences, focusing on data characteristics and use cases.

Pro tip: Emphasize that text compression is typically lossless due to exactness requirements, while image compression often leverages human perception for lossy methods. Mention real-world examples like JPEG and ZIP to show practical understanding.

1. Define Compression and Its Types

Explain that compression reduces data size by encoding information more efficiently. Distinguish between lossless (exact reconstruction) and lossy (approximate reconstruction) compression.

2. Explain Text Compression

Describe common lossless algorithms like Huffman coding, LZ77/LZ78 (used in ZIP, gzip), and Burrows-Wheeler transform. Note that text compression must be lossless to preserve exact meaning.

3. Explain Image Compression

Cover lossless formats (PNG, GIF) using techniques like DEFLATE, and lossy formats (JPEG, WebP) using DCT, quantization, and chroma subsampling. Highlight perceptual models.

4. Compare Similarities and Differences

Similarities: both exploit redundancy, use entropy coding, and involve trade-offs between size and quality/speed. Differences: text is discrete and requires lossless; images are continuous and can tolerate lossy compression due to human perception.

5. Discuss Trade-offs and Use Cases

Mention when to use each: lossless for text, medical images; lossy for web images, streaming. Consider factors like compression ratio, speed, and quality.

Key Points to Mention

  • Lossless vs. lossy compression and their applicability to text and images
  • Common algorithms: Huffman coding, LZ77/LZ78, DCT, quantization
  • Redundancy exploitation: statistical, spatial, and perceptual
  • Trade-offs: compression ratio, computational complexity, quality loss
  • Human visual perception in lossy image compression
  • Real-world formats: ZIP, gzip, PNG, JPEG, WebP

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.