Fixed-Range Frequency Count
Updated
Problem statement
Given an array of integers, count how many times each value appears. Every value is in the fixed domain from 0 through 65535, inclusive.
Use a direct frequency array indexed by the input value. Return only values with positive frequency as strings value|count, ordered by numeric value in ascending order.
Function
countFixedRangeFrequencies(values: int[]) → String[]Examples
Example 1
values = [2,65535,2,0,65535,2]return = ["0|1","2|3","65535|2"]The value 0 appears once, 2 appears three times, and the largest domain value appears twice.
Example 2
values = [5,4,5,4,3]return = ["3|1","4|2","5|2"]Results are emitted in numeric value order regardless of the first occurrence order.
Constraints
0 <= values.length <= 200000.0 <= values[i] < 65536.- Every frequency fits in a signed 32-bit integer.
More Waymo Phone Screen questions
- Shortest Travel Time in a Grid with Traffic LightsPHONE SCREEN · Seen Nov 2026
- Fixed-Order Task Run Time With CooldownPHONE SCREEN · Seen Oct 2026
- Reorderable Task Scheduler With CooldownPHONE SCREEN · Seen Oct 2026
- Island Area and Water BoundaryPHONE SCREEN · Seen Sep 2026
- Vehicle Maintenance Event ReadinessPHONE SCREEN · Seen Sep 2026
- Obstacle-Aware Return to OriginPHONE SCREEN · Seen Sep 2026
- Shortest Paths to Multiple TargetsPHONE SCREEN · Seen Sep 2026
- Deterministic Depth-First Graph TraversalPHONE SCREEN · Seen Sep 2026
- Shortest Distance from All BuildingsPHONE SCREEN · Seen Sep 2026
- Insert an Employee into an Organization HierarchyPHONE SCREEN · Seen Aug 2026
Similar questions at other companies
- Best Poker Category with a JokerScale AI · PHONE SCREEN · ONSITE INTERVIEWScale AI interview questions
- Find All Zip Rummy MeldsZip · PHONE SCREEN · ONSITE INTERVIEWZip interview questions
- Cheating CodemakerJane Street · OAJane Street interview questions
- Find Unique ElementsCisco · PHONE SCREENCisco interview questions
- Count Distinct Underwriting PII ValuesAffirm · PHONE SCREEN · ONSITE INTERVIEWAffirm interview questions
- Bounded IPv4 FilterAmazon · PHONE SCREEN
- SimpleRDD Multiset IntersectionDatologyAI · PHONE SCREEN
- Summarize the Latest Event for Each DeviceOneTrust · PHONE SCREEN
- Project JSON Fields into a Target FormatBooking.com · PHONE SCREEN
- Employee Training StatusVanta · PHONE SCREEN