Python
All Top 50 Python & Pandas Interview Questions#1
Calculate Frequency of Items in Python (Dictionary & Counter)
EasyAmazonInterview Question #1
Asked at AmazonGiven a list of customer search query tags, write a Python function that returns a dictionary mapping each unique tag to its count frequency. Do not use external third-party libraries.
Input Table: tags list
1 rows preview| input_list |
|---|
| laptop,mouse,laptop,keyboard,mouse,laptop |
Expected Output Structure3 rows
| tag | count |
|---|---|
| laptop | 3 |
| mouse | 2 |
| keyboard | 1 |
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.