Skip to content
LakeBench
ProblemsCommunityPricing
Sign inStart practicing

Counter for warehouse zone visits

Python data engineering interview problem. Difficulty: beginner. Pattern: Dictionaries. About 10 minutes. Part of the Pro drill bank.

Forklifts scan a warehouse zone each time they enter it. A heatmap needs how many visits each zone received.

Count visits per warehouse zone.

Requirements

  • Each occurrence increments that zone.
  • Order of keys should be deterministic if tests compare dicts as strings.

Constraints

  • zones: a list of zone ids in visit order.

Examples

Input: zone_visit_counts(['A', 'B', 'A', 'C', 'B', 'A']) Output: [('A', 3), ('B', 2), ('C', 1)] This input follows the stated rules and produces this output.

Topics: lakebench, python, dictionaries.

More Python interview questions · All interview problems · Learn data engineering

beginner

Counter for warehouse zone visits

Interview-style drill: Given a sequence of warehouse zone visits, return each zone's visit count sorted by frequency.

Count visits per warehouse zone.