dsa2 min read
Encode and Decode Strings — Delimiter and Length-Prefix Schemes
Design an encode/decode scheme for a list of strings. Length-prefix encoding (4-byte header per string) is collision-proof unlike delimiter-based approaches.
Read →
webcoderspeed.com
2 articles
Design an encode/decode scheme for a list of strings. Length-prefix encoding (4-byte header per string) is collision-proof unlike delimiter-based approaches.
Design a URL shortener like TinyURL that encodes long URLs to short codes and decodes them back. Uses base-62 encoding with a counter or random string generation.