SIG (Susquehanna)–styleSoftware EngineerSoftware DeveloperQuestion #41

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.

Build Your Approach

State the assumptions, try a simple case, then work toward a general solution. Check the result and explain how it changes if an assumption changes.

Try the free diagnostic with worked solutions →

Get Free Interview Prep Resources

Practice the Reasoning Behind the Answer

Bring your target roles and interview timeline to a free quant consult. Discuss your preparation priorities and how Quant Blueprint’s lessons, practice and mock interviews can help.

Book a Free Quant Consult

Your goals · your preparation · your next steps