This is a verified interview question from Dream-11-sde. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Dream11 Cricket Team Selection" covers key patterns like Other.
"### Problem Cricket is a team sport comprised of 11 player each team has four types of player: Batsman, Bowler, All-Rounder, and Wicket Keeper. Dream11 is a fantasy cricket platform where users create their own cricket teams. You have decided to participate in Dream11 during the IPL season. The platform rewards prizes based on the maximum total value of your team. Your task is to create a cricket team based on certain constraints to win the reward. Write a program to do so while adhering to the following constraints: 1. Your team must consist of 11 players. 2. You have a budget of B to spend on selecting players. 3. Each player has a price tag and a player value. 4. There are four types of player: Batsman, Bowler, All-Rounder, and Wicket Keeper. 5. Your team should have at least one Wicket Keeper, one All-Rounder, two Batsmen, two Bowlers. 6. Now given list of price and player values to determine the type of players: The first 20% of players are considered as Wicket Keepers. Note: Take the ceil of the number obtained. Batsmen are selected from odd positions (excluding the first 20%). Bowlers are selected from the even positions that are not divisible by 4 (excluding the first 20%). All-Rounders are selected from positions divisible by 4 (excluding the first 20%). Player index starts from zero. Please factor this in calculation of player types viz. Wicket Keeper, All-Rounder, Batsmen and Bowler."
Join thousands of developers practicing for Dream-11-sde.