一到面试题 弱弱求解答# JobHunting - 待字闺中
y*k
1 楼
Consider two time series. Each time series contains price and time. Time is
expressed in number of seconds since market open. Every time when price
changes – there is a new entry into time series. Write a program that
receives two inputs: time series 1 and 2, and calculates another time series
containing the price difference (spread) between the two products at fixed
10 seconds interval.
//Each timeseries in represented as a key-value object, where keys are times
and values are prices.
//We simply take two timeseries key-value objects and return one that has
times in 10 second intervals.
std::map Problem7::getSpreadTimeSeries(std::map
ts1, std::map ts2)
{
//Fill this function
std::map pseudo_answer = std::map();
pseudo_answer.insert(std::pair(1, 4.0));
return pseudo_answer;
}
expressed in number of seconds since market open. Every time when price
changes – there is a new entry into time series. Write a program that
receives two inputs: time series 1 and 2, and calculates another time series
containing the price difference (spread) between the two products at fixed
10 seconds interval.
//Each timeseries in represented as a key-value object, where keys are times
and values are prices.
//We simply take two timeseries key-value objects and return one that has
times in 10 second intervals.
std::map
ts1, std::map
{
//Fill this function
std::map
pseudo_answer.insert(std::pair
return pseudo_answer;
}