Search
⌘K

Leetcode 271. Encode and Decode Strings

Design a pair of functions to serialize a list of strings into a single string and deserialize it back losslessly, handling arbitrary characters and empty strings so decoding always reproduces the original list. The solution should be stateless, robust to delimiter collisions, and efficient in time/space.

Asked at:

OpenAI


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late March, 2026

OpenAI

Intern

Early February, 2026

OpenAI

Senior

Mid September, 2025

OpenAI

Mid-level

Your account is free and you can post anonymously if you choose.