Parse and expand an IPv6 address
Company: Liftoff
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: medium
Interview Round: Onsite
Overview: This question evaluates proficiency in IPv6 address parsing, string validation, and canonicalization, testing understanding of hexadecimal hextets and the zero-compression (::) rule within the Coding & Algorithms domain.
Constraints
- Inputs are Python literals matching the function signature.
- Return a deterministic exact-match value.
Examples
Input: ('2001:db8::1',)
Expected Output: '2001:0db8:0000:0000:0000:0000:0000:0001'
Explanation: Compressed example.
Input: ('::',)
Expected Output: '0000:0000:0000:0000:0000:0000:0000:0000'
Explanation: All zeros.
Hints
- Model object-style prompts as operation streams when needed.
- Handle empty and boundary cases before the main logic.