CarGurus interview question

Coding challenge: Metrics ingesting program via CodePen. JSON objects are streamed in, which include a metric name, source, and value. Implement a method that can give you the average of all the metrics of a given name and source.

Interview Answer

Anonymous

28 Jan 2026

Rather than logging all metric objects, keep a running tally of the count and value totals of each metric name+source combination. Be prepared to talk about how you would use mutexes to achieve "eventual consistency."