Datadog·Software Engineer·Technical Phone Screen
- Given a sorted array of integers, a bucket width, and a number of buckets, distribute the values into buckets and return the count per bucket. The last bucket is a catch-all for anything that overflows the regular range.
“The linear scan approach is pretty clean once you realize you can just do v divided by bucket_width and clamp to the last index.”