Coding

Encode and Decode Strings

Encode a list of strings into a single string and decode it back.

Input: strs = ["","hello",""]

Output: ["","hello",""]

Explanation: Prepends chunk lengths and a delimiter (e.g., "0#5#hello0#") to safely encode and perfectly restore empty strings.

Was asked at

Practice this question with AI

First session is free - no credit card required.

Go Premium

More interviews, more skills, more success.

Community Answers

1 answer from the community

Expert Answer

Unlock Full Access

Answer any un-answered question from our database to unlock all community answers for 30 days.

Give & Take

Practice More Questions

1 answer published. Last candidate submission on Nov 20 2026, 9:29pm PDT. Interview question asked to Software Engineers interviewing at LiveRamp, Swiggy, Paytm and other companies. Original question asked: Encode and Decode Strings. Question last reported by a candidate interviewing at Vodafone for a Software Engineer interview on Nov 19 2026, 9:52am PDT.