Data Structures and Algorithms:
Amazon will start a new marketing
campaign targeting customers
according to their purchasing
profiles.
This campaign has 3 kinds of
messages each one targeting one
group of customers:
Message 1 - targets the 25% of
customers that spend the most at the
site
Message 2 - targets the 25% of
customers that spend the least at the
site
Message 3 - targets the rest of the
customers.
Given a list of purchases made during
a period of time, write a program that
sends the correct message to each
customer that purchased
anything during that period.
Each purchase in this list features
the customer id, the purchase
amount among other information.
The API to send messages to customers
follows below:
MessageSender.send(customerId, messageId)
Any thoughts about data structures?