Sig

Interview Question

Software Developer Interview
Sig

A group of friends are tracking the miles per gallon (MPG) for each of their cars. Each time they fill up their gas tank, they record the following in a CSV file: person name, car name, miles driven since last fill-up (float), gallons filled at this fill-up (integer), and the fill-up date. Write a program that lets a group member determine the MPG for each of their cars during a specific time range. The principal function for querying MPG is: GetRangeMPG(PersonName, StartDate, EndDate), which returns a list of objects containing (CarName, MPG), where MPG is calculated as (total miles driven during the time period) / (total gallons filled during that time period). The query's date range should be treated inclusively.

Unlock the Full Solution

Enter your email to get instant access to the complete solution, explanation, and similar practice problems.

Insights on 100+ quant firms, understand where to apply, and maximize your chances.

Get the official 2025 QB Quant Firm Tier List

Check your email inbox — you should get the interview in 1-2 minutes!