Cross-reference logs to flag spam numbers
PinterestSoftware Engineer · OnsiteLast updated
This question evaluates proficiency with data structures (such as hash maps), parsing and deduplication, frequency counting, input validation, and analysis of time and space complexity.
You are given two data sets: (
- a call log containing phone numbers observed in calls and (
- a list of user reports where each entry is a phone number reported as spam (potentially with duplicates). Parse and cross-reference these inputs to output each spam phone number present in the call log and the number of times it was reported. Describe the algorithm, data structures (e.g., hash maps), handling of invalid numbers, and time/space complexity. Provide code in your preferred language.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.