0
0
LLDsystem_design~10 mins

Notification to all parties 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 send a notification to all users.

LLD
for user in users:
    user.[1](message)
Drag options to blanks, or click blank then click option'
Aalert
Bnotify
Csend
Dmessage
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'send' which is too generic and may not exist in the user object.
Using 'alert' which is not the method defined for notifications.
2fill in blank
medium

Complete the code to add a notification to the queue for asynchronous processing.

LLD
notification_queue.[1](notification)
Drag options to blanks, or click blank then click option'
Aremove
Bpop
Cdequeue
Denqueue
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'pop' which removes an item instead of adding.
Using 'dequeue' which removes an item from the queue.
3fill in blank
hard

Fix the error in the notification dispatch function to correctly handle failures.

LLD
try:
    dispatcher.[1](notification)
except Exception as e:
    logger.error(str(e))
Drag options to blanks, or click blank then click option'
Adispatch
Bsend
Cnotify
Dsend_notification
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'send' which may not exist in dispatcher.
Using 'notify' which is a user method, not dispatcher.
4fill in blank
hard

Fill both blanks to filter notifications and send only urgent ones.

LLD
urgent_notifications = [n for n in notifications if n.[1] [2] 'urgent']
for notification in urgent_notifications:
    notification.send()
Drag options to blanks, or click blank then click option'
Apriority
B==
C!=
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'status' instead of 'priority' for filtering.
Using '!=' which filters out urgent notifications.
5fill in blank
hard

Fill all three blanks to create a dictionary of user IDs and their last notification timestamps, filtering only active users.

LLD
last_notifications = {user.[1]: user.notifications[-1].[2] for user in users if user.[3]
Drag options to blanks, or click blank then click option'
Aid
Btimestamp
Cis_active
Dname
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'name' instead of 'id' as dictionary key.
Using 'status' or other attributes instead of 'is_active' for filtering.