Python data engineering interview problem. Difficulty: beginner. Pattern: Dictionaries. About 10 minutes. Part of the Pro drill bank.
Two marketing campaigns each carry a list of tags. The growth team wants the tags that both campaigns already use so they do not invent a third spelling of the same theme.
Return the tags that appear in both input lists.
Input: shared_tags(['a', 'b', 'c'], ['b', 'c', 'd']) Output: ['b', 'c'] This input follows the stated rules and produces this output.
Topics: lakebench, python, sets.
More Python interview questions · All interview problems · Learn data engineering
Interview-style drill: Given two lists of campaign tags, return the tags that appear in both.
Return the tags that appear in both input lists.