Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Imagine you are a data analyst at a car company, and your mission is to analyze people's interests in car brands. You have a group

Imagine you are a data analyst at a car company, and your mission is to analyze people's interests in car brands. You have a group of car enthusiasts interested in three car brands: Volvo, Volkswagen, and Toyota. Some people in the group are only interested in Volvo cars, some are only interested in Volkswagen cars, some are only interested in Toyota cars, and some are interested in more than one brand. Now you need to create a tool to find certain groups of people from the provided data.
For this purpose, your task is divided into three parts.
Sub-Task 1: People interested in multiple brands (3 points)
In this task, we want to find people interested in more than one car brand.
You need to return a list of people who are interested in multiple car brands.
You need to return an empty list if there are no people who like multiple car brands.
Example:
In the scenario above, Zoe is interested in both Volkswagen and Toyota cars, Alice is interested in Volkswagen and Volvo, while Emma is interested in Volvo and Toyota cars. Bob is interested in all three cars. Other people are only interested in a single brand each. Thus we can say that Bob, Emma, Alice, and Zoe are interested in more than one car brand and they should be in the returned list.
Sub-Task 2: People interested in only one brand (3 points)
Now we want to find people interested only in one car brand.
You need to return a list of the names of people who are interested in only one car brand.
You need to return an empty list if there is no such people.
Example:
In the scenario above, Alex, Giulia, Carla, Franz, Helga, Ingrid, and Jan are only interested in one car brand and they should be in the returned list.
Sub-Task 3: Person interested in largest number of brands (4 points)
For the last task, we want to find the single person who is interested in the largest number of car brands.
Return the name of the person who likes the largest number of different car brands.
If there is more than one person who likes the same number of brands or no person who likes multiple brands, return "N/A".
Example:
In the scenario above, Bob is at the intersection of all three circles. So Bob is interested in the largest number of car brands.
API Description
The following data is available for you to access through the provided API.
Get car brands- Returns list of strings, this method returns a list with all the car brands.
Getpeople interested in brand - Returns list of strings, this method returns a list of people interested in the given car brand.
More details about the API functions and the data they provide can be found under the API tab.
Scoring
Focus on getting the correct output, as this is the major part of your score. You can see your points for each level in the bottom left of the screen when you press 'Run code'. Note that your code will be assessed using other test cases than the levels you see below, so please consider how your code would work for these unknown test cases.
A minor part of your score is calculated through a time-complexity analysis of your solution, so if you have time, try to consider how to make your solution as fast as possible.
A tip to get started is to press "Run code" to see what happens.
NOTES
To get started, simply press Run code to see what happens
The Future Skill system will initialize and call your code
Note that you don't need to initialize the class, add any methods or call any functions
A lot of the code you get at the start must remain unchanged:
Method, parameter, and class names
Note that you can press "Reset code" to get back to the initial state
What you should change:
What you return in the given methods (initially you might see default returns like -2, "foo", etc.)
Typically your solution code should be in the methods already provided (where you see the comment "Write your code here")
You can create your own methods and call them to calculate your answers.
Do not add your own test cases. Each time you press run code, several test levels will be evaluated and you can see the result in the canvas and in the score tab.

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

Step: 3

blur-text-image

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 Ricardo

2nd Edition

1449606008, 978-1449606008

More Books

Students also viewed these Databases questions