Python data engineering interview problem. Difficulty: intermediate. Pattern: Recursion. About 15 minutes. Part of the Pro drill bank.
A webhook payload nests email addresses several layers down. A support tool should collect every address without the caller knowing the shape.
Extract all email addresses from a nested payload (dict/list mix).
Input: collect_emails({'a': 'x@y.com', 'b': ['no', {'c': 'a@b.co'}]}) Output: ['a@b.co', 'x@y.com'] This input follows the stated rules and produces this output.
Topics: lakebench, python, nested-structures.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Given an arbitrarily nested dict/list structure, collect every value that looks like an email address.
Extract all email addresses from a nested payload (dict/list mix).