Candystore Exercise

Top customers and their favourites

Below this introduction, there is a list of customers of a candy store

Your goal is to extract the top customers, and their favourite snacks.

We might change the content of the list of candy below, so your program will need to fetch the data from this page somehow.

Unless otherwise specified, you're completely free to choose which tools to use

Expected Results The Data

1

Extract all customers in the list

2

Find their favourite candy

3

Find their total number of purchases

4

Order the list by total purchases

5

Export to JSON

Expected Results

            
[
    {
        "name": "Jonas",
        "favouriteSnack": "Geisha",
        "totalSnacks": 1982,
    },
    {
        "name": "Annika",
        "favouriteSnack": "Geisha",
        "totalSnacks": 208,
    },
    {
        "name": "Jane",
        "favouriteSnack": "Nötchoklad",
        "totalSnacks": 22,
    },
    {
        "name": "Aadya",
        "favouriteSnack": "Center",
        "totalSnacks": 11,
    }
]
            
        

The Data

Name Favourite
Aadya Center
Annika Geisha
Jonas Geisha
Jane Nötchoklad
Name Candy Eaten
Annika Geisha 100
Jonas Geisha 200
Jonas Kexchoklad 100
Aadya Nötchoklad 2
Jonas Nötchoklad 3
Jane Nötchoklad 17
Annika Geisha 100
Jonas Geisha 700
Jane Nötchoklad 4
Aadya Center 7
Jonas Geisha 900
Jane Nötchoklad 1
Jonas Kexchoklad 12
Jonas Plopp 40
Jonas Center 27
Aadya Center 2
Annika Center 8