Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Shared tags between two campaigns

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.

Requirements

  • Membership is exact string match after the lists are given.
  • Order of the result should be deterministic.

Constraints

  • a and b: lists of tag strings.
  • Tags can repeat inside one list.

Examples

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

beginner

Shared tags between two campaigns

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.