0
0
LLDsystem_design~10 mins

Split strategies (equal, exact, percentage) in LLD - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to split the total amount equally among all participants.

LLD
share = total_amount [1] number_of_participants
Drag options to blanks, or click blank then click option'
A*
B+
C/
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using multiplication instead of division.
Using addition or subtraction which does not split the amount.
2fill in blank
medium

Complete the code to assign an exact amount to a participant.

LLD
participant_share = [1]
Drag options to blanks, or click blank then click option'
Aexact_amount
Btotal_amount / number_of_participants
Cpercentage * total_amount
Dtotal_amount - exact_amount
Attempts:
3 left
💡 Hint
Common Mistakes
Using division or percentage calculations instead of fixed amount.
Subtracting amounts which is incorrect here.
3fill in blank
hard

Fix the error in the code to calculate participant share by percentage.

LLD
participant_share = total_amount [1] percentage
Drag options to blanks, or click blank then click option'
A*
B/
C+
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Using division or addition instead of multiplication.
Using subtraction which reduces the amount incorrectly.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension for exact splits.

LLD
splits = {participant: [1] for participant, [2] in exact_amounts.items()}
Drag options to blanks, or click blank then click option'
Aamount
Bshare
Cexact_amount
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect variable names that do not match the dictionary items.
Confusing keys and values in the comprehension.
5fill in blank
hard

Fill all three blanks to calculate percentage splits and store in a dictionary.

LLD
percentage_splits = {participant: total_amount [1] [2] for participant, [3] in percentages.items()}
Drag options to blanks, or click blank then click option'
A*
B/
Cpercentage
Dvalue
Attempts:
3 left
💡 Hint
Common Mistakes
Using division instead of multiplication.
Using wrong variable names for the percentage value.