Python
#6

Fast Deduplication and Set Operations in Python

Easy
Interview Question #6

Given two lists of customer IDs representing visitors to Campaign A and Campaign B, find all customers who visited both campaigns. Explain the time complexity versus nested loops.

Input Table: campaigns
1 rows preview
campaign_acampaign_b
101,102,103,104103,104,105,106
Expected Output Structure1 rows
both_campaigns
103,104
Interview Context

Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.

Python 3.10 (Pandas)
Environment Ready

Click "Run & Test" to execute your Pandas code against the test assertions.

Chat with us