← All Python interview questions

Validate a join before you trust the numbers

MediumPandas — JoinsRazorpayDeloitte

Revenue looked 30% too high after a join because the customer table had duplicate IDs.

Write safe_merge(orders, customers) that returns a dict with keys rows, unmatched and duplicate_keys: the row count of a left join on customer_id, the number of orders with no matching customer, and the number of customer_id values that appear more than once in customers.

Practising alone only goes so far — our live cohorts pair Python and Pandas depth with dashboards, agentic analytics projects and mock interviews.

Explore the program