SIG Interview Questions
SIG Interview Questions
SIG Interview Questions
multiple
millions of trade requests if the number of servers wasn't a question? The one manager kept on following
up my answers with, "Well what if that wasn't available?"
1 Answer
Ultimately, I think they were looking for: "I would use a queue." Although I'm not really sure. I was trying
to figure out what the one manager was getting at, but there was a question of clarity in the questions he
was asking that was absent. By no means was this a perfect interview --on either side.
Coding Question A group of friends are tracking the miles per gallon for each of their cars. Each time one
of them fills up their gas tank, they record the following in a file:
His or her name
The type of car they drove
How many miles driven since they last filled up
How many gallons purchased at this fill up
Date of the fill
Their data is formatted as a comma separate value (csv) file with the following format for each
row:(#person,carName,milesDriven,gallonsFilled,fillupDate)
Note: person may have more than one so a time range query
might need to output data for one or more cars.
A skeleton class will be provided;
your job will be to complete the program.
The principal function for querying MPG is of the form
(the exact name, data types, etc., can be learned by inspecting the "solution" class in the skeleton code):
MPG is calculated as (total miles traveled during time period)/ (total gallons filled during time period.
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
unordered_map<int, unordered_map<string, vector<string>>> m;
class movie {
public:
string name;
string genre;
int year;
movie (string n, string g, int y):name(n), genre(g), year(y){}
};