快门飞 code challenge
24590
收到一个code challenge立刻分享起来。
[align="left"]One way to analyze acquisition strategy and estimate marketing cost is to calculate the Lifetime Value (“LTV”) of a customer. Simply speaking, LTV is the projected revenue that customer will generate during their lifetime.[/align][align="left"]A simple LTV can be calculated using the following equation: 52(a) x t. Where a is the average customer value per week (customer expenditures per visit (USD) x number of site visits per week) and t is the average customer lifespan. The average lifespan for Shutterfly is 10 years.[/align][float="left"][/float]Code Requirements[align="left"]Write a program that ingests event data and implements one analytic method, below. You are expected to write clean, well-documented and well-tested code. Be sure to think about performance - what the performance characteristic of the code is and how it could be improved in the future.[/align][align="left"]You may use one of the following OO languages: Java, Python, Scala.[/align][float="left"][/float]Ingest(e, D)[align="left"]Given event e, update data D[/align][float="left"][/float]TopXSimpleLTVCustomers(x, D)[align="left"]Return the top x customers with the highest Simple Lifetime Value from data D.[/align][align="left"]Please note that the timeframe for this calculation should come from D. That is, use the data that was ingested into D to calculate the LTV to frame the start and end dates of your LTV calculation. You should not be using external data (in particular "now") for this calculation.[/align][float="left"][/float]Events[align="left"]Please use the following sample events the Data Warehouse collects from Shutterfly’s public sites. All events have a key and event_time, but are received with no guaranteed order and with fluctuating frequency.[/align][align="left"]See sample_input directory for a sample of each event.[/align][float="left"][/float]Customer
[align="left"]One way to analyze acquisition strategy and estimate marketing cost is to calculate the Lifetime Value (“LTV”) of a customer. Simply speaking, LTV is the projected revenue that customer will generate during their lifetime.[/align][align="left"]A simple LTV can be calculated using the following equation: 52(a) x t. Where a is the average customer value per week (customer expenditures per visit (USD) x number of site visits per week) and t is the average customer lifespan. The average lifespan for Shutterfly is 10 years.[/align][float="left"][/float]Code Requirements[align="left"]Write a program that ingests event data and implements one analytic method, below. You are expected to write clean, well-documented and well-tested code. Be sure to think about performance - what the performance characteristic of the code is and how it could be improved in the future.[/align][align="left"]You may use one of the following OO languages: Java, Python, Scala.[/align][float="left"][/float]Ingest(e, D)[align="left"]Given event e, update data D[/align][float="left"][/float]TopXSimpleLTVCustomers(x, D)[align="left"]Return the top x customers with the highest Simple Lifetime Value from data D.[/align][align="left"]Please note that the timeframe for this calculation should come from D. That is, use the data that was ingested into D to calculate the LTV to frame the start and end dates of your LTV calculation. You should not be using external data (in particular "now") for this calculation.[/align][float="left"][/float]Events[align="left"]Please use the following sample events the Data Warehouse collects from Shutterfly’s public sites. All events have a key and event_time, but are received with no guaranteed order and with fluctuating frequency.[/align][align="left"]See sample_input directory for a sample of each event.[/align][float="left"][/float]Customer
- type
- CUSTOMER
- CUSTOMER
- verb
- NEW
- UPDATE
- Additional Data
- key(customer_id)
- event_time
- last_name
- adr_city
- adr_state
- type
- SITE_VISIT
- SITE_VISIT
- verb
- NEW
- NEW
- Additional Data
- key(page_id)
- event_time
- customer_id
- tags (array of name/value properties)
- type
- IMAGE
- IMAGE
- verb
- UPLOAD
- UPLOAD
- Additional Data
- key(image_id)
- event_time
- customer_id
- camera_make
- camera_model
- type
- ORDER
- ORDER
- verb
- NEW
- UPDATE
- Additional Data
- key(order_id)
- event_time
- customer_id
- total_amount
- 2
0条回复