Master the fundamental concepts of memory optimization through this focused micro-challenge.
Compilers, JVMs, and Python intern identifiers and literal strings so equality checks become pointer compares. Parsing millions of JSON keys benefits when the same field name like status appears on every row.
Hash table maps string content to canonical storage. On insert, return existing pointer if hash and bytes match.
cLoading…
strcmp on collisionKeep the relevant documentation open while you implement. When your output disagrees with the reference, trace one failing case by hand before changing random lines.
You will implement a string intern table and show reduced memory on repetitive input. This exercise asks you to verify that equal strings share one address.
Implement string interning pool.
Requirements:
Three hints are available for this task, revealed one at a time inside the code workspace so you can struggle productively before seeing them.
All starter code and reference implementations are available for your local setup.
View on Github