Choose whatever language you're most comfortable with to solve these problems.
The ACME inc. tool supply company manages its operations with 3 csv files:
customers.csv
keeps customer information:id
is a numeric customer idfirstname
is the customer's first namelastname
is the customer's last name
products.csv
keeps product info:id
is a numeric product idname
is the human-readable namecost
is the product cost in euros
orders.csv
keeps order information:id
is a numeric order idcustomer
is the numeric id of the customer who created the orderproducts
is a space-separated list of product ids ordered by the customer
Manually dealing with those files is hard and error-prone, and they've asked for your help writing some code to make their lives easier.
Right now the orders.csv
doesn't have total order cost information.
We need to use the data in these files to emit a order_prices.csv
file with the following columns:
id
the numeric id of the ordereuros
the total cost of the order
The marketing department wants to know which customers are interested in each product; they've asked for a product_customers.csv
file that, for each product, gives the list of customers who have purchased this product:
id
numeric product idcustomer_ids
a space-separated list of customer ids of the customers who have purchased this product
To evaluate our customers, we need a customer_ranking.csv
containing the following columns, ranked in descending order by total_euros:
id
numeric id of the customerfirstname
customer first namelastname
customer last nametotal_euros
total euros this customer has spent on products