← Pinterest Interview Insights
The typo thing ('vedio') is the kind of thing you either catch or you don't.
Start by outlining a clear data cleaning pipeline: filter video pins with case-insensitive and fuzzy matching, map categories using the provided dictionary, and exclude invalid time values. Then compute average time spent per canonical category and return the top category with its rounded average. Emphasize robustness and reproducibility in your code.
Pro tip: Mention that you would validate the category mapping by checking for unmapped values and log them for review, ensuring data quality before aggregation. Also, consider using vectorized operations for efficiency with large datasets.
Use case-insensitive string matching and handle common typos like 'vedio' by normalizing the pin type column (e.g., lowercasing and applying fuzzy matching or a predefined correction map).
Apply the provided dictionary to map raw category values to canonical categories, ensuring all values are covered and handling any unmapped entries appropriately.
Remove rows where time spent is missing, negative, or non-numeric, and consider setting a reasonable upper bound to exclude outliers if necessary.
Group the cleaned data by canonical category and calculate the mean time spent for each category.
Identify the category with the highest average time spent and return it along with the average rounded to two decimal places.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.