Katkat

Compute most popular location with weights

MicrosoftSoftware Engineer · Technical Screen

Last updated

This question evaluates a candidate's ability to perform weighted aggregation, data cleaning, tie-breaking logic, and handling of malformed or missing text fields using SQL and/or Python.

You are given a dataset of voting records for concert locations. Each record includes voter_id, location_text, and an optional numeric weight (default 1). Write SQL and/or Python to compute the most popular location by total vote weight. Explain how you handle ties, missing or malformed location_text, and verify correctness with a small example. Analyze the time and space complexity of your solution.