Space-time tradeoff Emoji Note

Sung M. Kim - Mar 24 '19 - - Dev Community

Anthony has shared wonderful tips on interviewing at Google.

Within the fourth tip, Brainstorm solutions and their time/space complexity, Anthony stressed on "space-time tradeoff principle", which I was vaguely familiar with.

While attempting to understand it, I drew a sketchnote.

sketchnote

As it's not sharable, I came up with emoji version.

Space-time Tradeoff Table

⏰🔽💽🔼 (faster + more space) vs ⏰🔼💽🔽 (slower + less space)
🙄📑 (Lookup table) 🔃💻 (Recalculation)
💾 x 1 (Uncompressed Data) 💾 x 0.5 (Compressed Data)
🏪🖼 (Stored Image) 🔃📜 (Re-render)
➿➡➰ (Loop Unrolling) 👨‍💻 x 0.5 (Smaller code)

Gist of each tradeoff

  1. 🙄📑(Lookup table) vs. 🔃💻 (Recalculation)
    Saving computed data in memory saves time but increases the space usage.

  2. 💾 x 1 (Uncompressed Data) vs. 💾 x 0.5 (Compressed Data)
    Faster to access uncompressed data as no decompression step is needed but requires more space.

  3. 🏪🖼 (Stored Image) vs. 🔃📜 (Re-render)
    Storing image in cache is faster than re-rendering but requires more space (in disk/memory).

  4. ➿➡➰ (Loop Unrolling) vs. 👨‍💻 x 0.5 (Smaller code)
    Loop unrolling can optimize execution speed at the cost of increased binary size.

It might be a bit too much of emojis but helped me to understand a bit better what tradeoffs are available.

Feel free to share your version of table or sketchnote 🙂

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player