Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Programming Challenge Description: IBM is implementing a streaming analytics service for an online retailer to provide data on the best time to sell specific products.

Programming Challenge Description:

IBM is implementing a streaming analytics service for an online retailer to provide data on the best time to sell specific products. To accomplish this goal, the service needs a very fast way to calculate a number of basic formulas for a series of dates, quantity and product id.

Assumptions:

In production, the list of data could be in the hundreds of thousands of dates with quantities and product ids.

The service will be called frequently as the user explores different data models.

The data may not be normalized. There could be multiple lines with the same date and product id. In these cases you should sum all the quantity on input and work on that.

Product ids are case sensitive.

Input:

Each line will contain a comma separated list of text date (yyyy-mm-dd), quantity, product id. For example:

2017-06-02,5,Apples 2017-06-02,2,pears 2017-06-03,3,pineapples

Output:

For each date create a line of this format: date, total items sold for date, average quantity of all items (to 2 decimal places), count of unique parts sold. For example:

2017-06-02,7,3.50,2 2017-06-03,3,3.00,1

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions