-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsystem-design-problems.js
More file actions
1721 lines (1687 loc) · 113 KB
/
system-design-problems.js
File metadata and controls
1721 lines (1687 loc) · 113 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// System Design Judge - Problems Database
// Components with CSS-based icons + Real-world System Design
// Comprehensive component library for realistic system design
const COMPONENTS = {
// ========== CLIENTS ==========
'desktop': { id: 'desktop', name: 'Desktop', icon: '💻', category: 'clients', color: '#f97316' },
'mobile': { id: 'mobile', name: 'Mobile App', icon: '📱', category: 'clients', color: '#f97316' },
'browser': { id: 'browser', name: 'Web Browser', icon: '🌐', category: 'clients', color: '#f97316' },
'iot-device': { id: 'iot-device', name: 'IoT Device', icon: '📟', category: 'clients', color: '#f97316' },
'smart-tv': { id: 'smart-tv', name: 'Smart TV', icon: '📺', category: 'clients', color: '#f97316' },
// ========== ROUTING & NETWORKING ==========
'cdn': { id: 'cdn', name: 'CDN', icon: '☁️', category: 'routing', color: '#f472b6' },
'load-balancer': { id: 'load-balancer', name: 'Load Balancer', icon: '⚖️', category: 'routing', color: '#34d399' },
'api-gateway': { id: 'api-gateway', name: 'API Gateway', icon: '🚪', category: 'routing', color: '#34d399' },
'rate-limiter': { id: 'rate-limiter', name: 'Rate Limiter', icon: '🚦', category: 'routing', color: '#22d3ee' },
'reverse-proxy': { id: 'reverse-proxy', name: 'Reverse Proxy', icon: '🔀', category: 'routing', color: '#34d399' },
'service-mesh': { id: 'service-mesh', name: 'Service Mesh', icon: '🕸️', category: 'routing', color: '#a78bfa' },
// ========== DATABASES ==========
'database': { id: 'database', name: 'SQL Database', icon: '🗄️', category: 'storage', color: '#14b8a6' },
'nosql': { id: 'nosql', name: 'NoSQL DB', icon: '📊', category: 'storage', color: '#14b8a6' },
'graph-db': { id: 'graph-db', name: 'Graph DB', icon: '🕸️', category: 'storage', color: '#14b8a6' },
'timeseries-db': { id: 'timeseries-db', name: 'Time Series DB', icon: '📈', category: 'storage', color: '#14b8a6' },
'vector-db': { id: 'vector-db', name: 'Vector DB', icon: '🧭', category: 'storage', color: '#8b5cf6' },
'read-replica': { id: 'read-replica', name: 'Read Replica', icon: '📖', category: 'storage', color: '#14b8a6' },
'write-primary': { id: 'write-primary', name: 'Write Primary', icon: '✍️', category: 'storage', color: '#14b8a6' },
// ========== CACHING ==========
'cache': { id: 'cache', name: 'Redis Cache', icon: '⚡', category: 'storage', color: '#ef4444' },
'session-store': { id: 'session-store', name: 'Session Store', icon: '🎫', category: 'storage', color: '#f97316' },
'distributed-cache': { id: 'distributed-cache', name: 'Distributed Cache', icon: '🌐⚡', category: 'storage', color: '#ef4444' },
// ========== OBJECT STORAGE ==========
'file-storage': { id: 'file-storage', name: 'File Storage', icon: '📁', category: 'storage', color: '#f97316' },
'object-storage': { id: 'object-storage', name: 'S3/Object Store', icon: '📦', category: 'storage', color: '#f97316' },
'blob-storage': { id: 'blob-storage', name: 'Blob Storage', icon: '💾', category: 'storage', color: '#f97316' },
// ========== COMPUTE ==========
'server': { id: 'server', name: 'App Server', icon: '🖥️', category: 'compute', color: '#fbbf24' },
'worker': { id: 'worker', name: 'Background Worker', icon: '⚙️', category: 'compute', color: '#fbbf24' },
'lambda': { id: 'lambda', name: 'Serverless Fn', icon: 'λ', category: 'compute', color: '#f97316' },
'container': { id: 'container', name: 'Container', icon: '📦', category: 'compute', color: '#3b82f6' },
'scheduler': { id: 'scheduler', name: 'Job Scheduler', icon: '⏰', category: 'compute', color: '#fbbf24' },
// ========== MESSAGING & EVENTS ==========
'message-queue': { id: 'message-queue', name: 'Message Queue', icon: '📨', category: 'messaging', color: '#a78bfa' },
'pubsub': { id: 'pubsub', name: 'Pub/Sub', icon: '📢', category: 'messaging', color: '#a78bfa' },
'kafka': { id: 'kafka', name: 'Kafka/Stream', icon: '🌊', category: 'messaging', color: '#a78bfa' },
'notification': { id: 'notification', name: 'Push Notify', icon: '🔔', category: 'messaging', color: '#a78bfa' },
'event-bus': { id: 'event-bus', name: 'Event Bus', icon: '🚌', category: 'messaging', color: '#a78bfa' },
'dead-letter': { id: 'dead-letter', name: 'Dead Letter Q', icon: '💀', category: 'messaging', color: '#6b7280' },
// ========== SEARCH & ANALYTICS ==========
'search-engine': { id: 'search-engine', name: 'Elasticsearch', icon: '🔍', category: 'search', color: '#fb923c' },
'analytics': { id: 'analytics', name: 'Analytics Engine', icon: '📈', category: 'search', color: '#fb923c' },
'log-aggregator': { id: 'log-aggregator', name: 'Log Aggregator', icon: '📝', category: 'search', color: '#6b7280' },
'metrics': { id: 'metrics', name: 'Metrics Store', icon: '📊', category: 'search', color: '#3b82f6' },
// ========== SECURITY ==========
'auth-service': { id: 'auth-service', name: 'Auth Service', icon: '🔐', category: 'security', color: '#ef4444' },
'oauth': { id: 'oauth', name: 'OAuth/SSO', icon: '🔑', category: 'security', color: '#ef4444' },
'fraud-detection': { id: 'fraud-detection', name: 'Fraud Detection', icon: '🚨', category: 'security', color: '#ef4444' },
'encryption': { id: 'encryption', name: 'Encryption', icon: '🔒', category: 'security', color: '#ef4444' },
// ========== EXTERNAL SERVICES ==========
'payment-gateway': { id: 'payment-gateway', name: 'Payment (Stripe)', icon: '💳', category: 'external', color: '#f472b6' },
'email-service': { id: 'email-service', name: 'Email (SES)', icon: '📧', category: 'external', color: '#f472b6' },
'sms-service': { id: 'sms-service', name: 'SMS (Twilio)', icon: '💬', category: 'external', color: '#f472b6' },
'maps-api': { id: 'maps-api', name: 'Maps API', icon: '🗺️', category: 'external', color: '#34d399' },
'third-party': { id: 'third-party', name: '3rd Party API', icon: '🔗', category: 'external', color: '#6b7280' },
// ========== MEDIA & STREAMING ==========
'video-encoder': { id: 'video-encoder', name: 'Video Encoder', icon: '🎬', category: 'streaming', color: '#22d3ee' },
'stream-server': { id: 'stream-server', name: 'Stream Server', icon: '📡', category: 'streaming', color: '#22d3ee' },
'transcoder': { id: 'transcoder', name: 'Transcoder', icon: '🔄', category: 'streaming', color: '#22d3ee' },
'media-cdn': { id: 'media-cdn', name: 'Media CDN', icon: '🎥', category: 'streaming', color: '#22d3ee' },
'hls-packager': { id: 'hls-packager', name: 'HLS Packager', icon: '📦🎬', category: 'streaming', color: '#22d3ee' },
// ========== REAL-TIME ==========
'websocket': { id: 'websocket', name: 'WebSocket Server', icon: '🔌', category: 'realtime', color: '#2dd4bf' },
'presence': { id: 'presence', name: 'Presence Service', icon: '👁️', category: 'realtime', color: '#2dd4bf' },
'signaling': { id: 'signaling', name: 'Signaling Server', icon: '📶', category: 'realtime', color: '#2dd4bf' },
// ========== LOCATION & GEO ==========
'location-service': { id: 'location-service', name: 'Location Service', icon: '📍', category: 'realtime', color: '#2dd4bf' },
'geospatial-db': { id: 'geospatial-db', name: 'Geo Database', icon: '🌍', category: 'storage', color: '#34d399' },
'route-optimizer': { id: 'route-optimizer', name: 'Route Optimizer', icon: '🛣️', category: 'compute', color: '#34d399' },
// ========== ML & AI ==========
'ml-model': { id: 'ml-model', name: 'ML Model Server', icon: '🤖', category: 'ml', color: '#8b5cf6' },
'recommendation': { id: 'recommendation', name: 'Recommender', icon: '💡', category: 'ml', color: '#8b5cf6' },
'feature-store': { id: 'feature-store', name: 'Feature Store', icon: '🧬', category: 'ml', color: '#8b5cf6' },
'training-pipeline': { id: 'training-pipeline', name: 'Training Pipeline', icon: '🏋️', category: 'ml', color: '#8b5cf6' },
'content-moderation': { id: 'content-moderation', name: 'Content Mod', icon: '👮', category: 'ml', color: '#ef4444' },
// ========== DATA PROCESSING ==========
'change-data': { id: 'change-data', name: 'CDC (Debezium)', icon: '🔄', category: 'data', color: '#14b8a6' },
'etl-pipeline': { id: 'etl-pipeline', name: 'ETL Pipeline', icon: '🔧📊', category: 'data', color: '#a78bfa' },
'data-warehouse': { id: 'data-warehouse', name: 'Data Warehouse', icon: '🏭', category: 'data', color: '#6b7280' },
'batch-processor': { id: 'batch-processor', name: 'Batch Processor', icon: '📦⚙️', category: 'data', color: '#fbbf24' },
};
const CATEGORIES = [
{ id: 'request-response', name: 'Request Response', icon: '🔄' },
{ id: 'storage-engines', name: 'Storage Engines', icon: '💾' },
{ id: 'search-engines', name: 'Search Engines', icon: '🔍' },
{ id: 'booking-systems', name: 'Booking Systems', icon: '🎫' },
{ id: 'social-media', name: 'Social Media', icon: '📱' },
{ id: 'location-based', name: 'Location Based', icon: '📍' },
{ id: 'emailing', name: 'Email Services', icon: '📧' },
{ id: 'conferencing', name: 'Conferencing', icon: '📹' },
{ id: 'video-streaming', name: 'Video Streaming', icon: '🎬' },
{ id: 'payment', name: 'Payment Systems', icon: '💳' },
{ id: 'collaborative', name: 'Collaborative', icon: '📝' },
{ id: 'gaming', name: 'Gaming', icon: '🎮' },
{ id: 'discussion', name: 'Discussion', icon: '💬' },
{ id: 'auth', name: 'Authentication', icon: '🔐' },
{ id: 'chat', name: 'Chat Systems', icon: '💭' },
{ id: 'recommendation', name: 'Recommendations', icon: '💡' },
];
// Helper to create problem template
function p(id, title, category, difficulty, isFree, desc, reqs, nodes, edges) {
return {
id, title, category, difficulty, isFree, timeLimit: difficulty === 'Easy' ? 600 : difficulty === 'Medium' ? 900 : 1200,
description: desc, requirements: reqs, path: { nodes, edges }
};
}
const PROBLEMS = [
// ============================================
// REQUEST RESPONSE ARCHITECTURES (Complex)
// ============================================
{
id: 'file-converter',
title: 'Online File Converter like Zamzar',
category: 'request-response',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a file conversion service handling millions of uploads. Users upload files (images, docs, videos), the system converts them asynchronously, and notifies users when done. Must handle large files and high concurrency.',
requirements: [
{ id: 'r1', text: 'Serve static assets (JS, CSS) from edge', targetSlots: ['slot-cdn'] },
{ id: 'r2', text: 'Distribute incoming requests', targetSlots: ['slot-lb'] },
{ id: 'r3', text: 'Store uploaded files durably', targetSlots: ['slot-storage'] },
{ id: 'r4', text: 'Queue conversion jobs for async processing', targetSlots: ['slot-queue'] },
{ id: 'r5', text: 'Background workers for CPU-intensive conversion', targetSlots: ['slot-worker'] },
{ id: 'r6', text: 'Notify users when conversion completes', targetSlots: ['slot-notify'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 120, y: 320, label: 'Client' },
{ id: 'slot-cdn', type: 'slot', correctAnswers: ['cdn'], x: 320, y: 140, label: 'Edge Cache' },
{ id: 'slot-lb', type: 'slot', correctAnswers: ['load-balancer', 'api-gateway'], x: 320, y: 320, label: 'Traffic' },
{ id: 'api', type: 'filled', component: 'server', x: 520, y: 320, label: 'API Server' },
{ id: 'slot-storage', type: 'slot', correctAnswers: ['object-storage', 'blob-storage', 'file-storage'], x: 720, y: 140, label: 'Files' },
{ id: 'slot-queue', type: 'slot', correctAnswers: ['message-queue', 'pubsub'], x: 720, y: 320, label: 'Jobs' },
{ id: 'slot-worker', type: 'slot', correctAnswers: ['worker'], x: 920, y: 320, label: 'Process' },
{ id: 'db', type: 'filled', component: 'database', x: 920, y: 520, label: 'Metadata DB' },
{ id: 'slot-notify', type: 'slot', correctAnswers: ['notification', 'pubsub', 'email-service'], x: 1140, y: 320, label: 'Notify' }
],
edges: [
{ from: 'client', to: 'slot-cdn', label: 'STATIC' },
{ from: 'client', to: 'slot-lb', label: 'UPLOAD' },
{ from: 'slot-lb', to: 'api' },
{ from: 'api', to: 'slot-storage', label: 'STORE RAW' },
{ from: 'api', to: 'slot-queue', label: 'ENQUEUE' },
{ from: 'slot-queue', to: 'slot-worker', label: 'CONSUME' },
{ from: 'slot-worker', to: 'slot-storage', label: 'SAVE RESULT' },
{ from: 'slot-worker', to: 'db', label: 'UPDATE STATUS' },
{ from: 'slot-worker', to: 'slot-notify', label: 'DONE' }
]
}
},
{
id: 'url-shortener',
title: 'TinyURL / Bit.ly Enterprise',
category: 'request-response',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a scalable URL shortener handling billions of links. Key challenges: 62-base encoding, pre-generating keys (KGS), handling redirects with low latency, and analytics.',
requirements: [
{ id: 'r1', text: 'Key Generation Service (KGS) to pre-mint keys', targetSlots: ['slot-kgs'] },
{ id: 'r2', text: 'Manage KGS Ranges (Zookeeper)', targetSlots: ['slot-zk'] },
{ id: 'r3', text: 'Cache Hot Redirects (LRU)', targetSlots: ['slot-cache'] },
{ id: 'r4', text: 'Persist Mappings (NoSQL)', targetSlots: ['slot-db'] },
{ id: 'r5', text: 'Async Click Analytics', targetSlots: ['slot-stream'] },
{ id: 'r6', text: 'Filter Malicious Links', targetSlots: ['slot-filter'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 100, y: 320, label: 'User' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 300, y: 320, label: 'LB' },
{ id: 'api', type: 'filled', component: 'server', x: 500, y: 320, label: 'Shortener API' },
{ id: 'slot-kgs', type: 'slot', correctAnswers: ['worker', 'server'], x: 500, y: 140, label: 'KGS' },
{ id: 'slot-zk', type: 'slot', correctAnswers: ['zookeeper', 'etcd'], x: 740, y: 140, label: 'Range Mgr' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'redis'], x: 740, y: 320, label: 'Cache' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'nosql', 'dynamodb'], x: 940, y: 320, label: 'URL DB' },
{ id: 'slot-stream', type: 'slot', correctAnswers: ['kafka', 'message-queue'], x: 940, y: 520, label: 'Clicks' },
{ id: 'slot-filter', type: 'slot', correctAnswers: ['ml-model', 'worker'], x: 500, y: 520, label: 'Malware Scan' }
],
edges: [
{ from: 'client', to: 'lb', label: 'SHORTEN/GET' },
{ from: 'lb', to: 'api' },
{ from: 'api', to: 'slot-cache', label: 'CHECK' },
{ from: 'api', to: 'slot-kgs', label: 'GET KEY' },
{ from: 'slot-kgs', to: 'slot-zk', label: 'RESERVE RANGE' },
{ from: 'api', to: 'slot-db', label: 'PERSIST' },
{ from: 'api', to: 'slot-stream', label: 'LOG EVENT' },
{ from: 'api', to: 'slot-filter', label: 'SCAN' }
]
}
},
{
id: 'cricbuzz',
title: 'Live Sports Scoreboard (Cricbuzz)',
category: 'request-response',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a real-time sports scoreboard serving millions of concurrent users during peak events. Must support live score updates, ball-by-ball commentary, push notifications, and handle extreme traffic spikes.',
requirements: [
{ id: 'r1', text: 'Serve static assets from edge locations', targetSlots: ['slot-cdn'] },
{ id: 'r2', text: 'Push real-time updates to clients', targetSlots: ['slot-ws'] },
{ id: 'r3', text: 'Cache frequently accessed match data', targetSlots: ['slot-cache'] },
{ id: 'r4', text: 'Stream score updates from multiple sources', targetSlots: ['slot-stream'] },
{ id: 'r5', text: 'Send mobile push notifications', targetSlots: ['slot-push'] },
{ id: 'r6', text: 'Persist match history and statistics', targetSlots: ['slot-db'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'mobile', x: 120, y: 320, label: 'Mobile App' },
{ id: 'slot-cdn', type: 'slot', correctAnswers: ['cdn'], x: 320, y: 140, label: 'Static' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 320, y: 320, label: 'LB' },
{ id: 'slot-ws', type: 'slot', correctAnswers: ['websocket', 'pubsub'], x: 460, y: 320, label: 'Real-time' },
{ id: 'api', type: 'filled', component: 'server', x: 640, y: 320, label: 'Score API' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache'], x: 840, y: 140, label: 'Hot Data' },
{ id: 'slot-stream', type: 'slot', correctAnswers: ['message-queue', 'event-bus', 'pubsub'], x: 840, y: 320, label: 'Ingest' },
{ id: 'slot-push', type: 'slot', correctAnswers: ['notification', 'pubsub'], x: 1020, y: 220, label: 'Notify' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'nosql'], x: 1020, y: 440, label: 'History' }
],
edges: [
{ from: 'client', to: 'slot-cdn', label: 'ASSETS' },
{ from: 'client', to: 'lb', label: 'API' },
{ from: 'lb', to: 'slot-ws' },
{ from: 'slot-ws', to: 'api', label: 'SUBSCRIBE' },
{ from: 'api', to: 'slot-cache', label: 'READ' },
{ from: 'slot-stream', to: 'api', label: 'LIVE DATA' },
{ from: 'api', to: 'slot-push', label: 'WICKET!' },
{ from: 'api', to: 'slot-db', label: 'PERSIST' }
]
}
},
{
id: 'codeforces',
title: 'Online Judge (CodeForces/LeetCode)',
category: 'request-response',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design an online judge that evaluates code submissions in multiple languages. Must handle contest spikes with thousands of concurrent submissions, provide sandboxed execution, and real-time verdict updates.',
requirements: [
{ id: 'r1', text: 'Rate limit submissions during contests', targetSlots: ['slot-rate'] },
{ id: 'r2', text: 'Queue submissions for processing', targetSlots: ['slot-queue'] },
{ id: 'r3', text: 'Sandboxed execution environment', targetSlots: ['slot-worker'] },
{ id: 'r4', text: 'Store code and test results', targetSlots: ['slot-storage'] },
{ id: 'r5', text: 'Real-time verdict updates', targetSlots: ['slot-ws'] },
{ id: 'r6', text: 'Cache problem statements and test cases', targetSlots: ['slot-cache'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 120, y: 320, label: 'Browser' },
{ id: 'slot-rate', type: 'slot', correctAnswers: ['rate-limiter', 'api-gateway'], x: 320, y: 320, label: 'Limit' },
{ id: 'api', type: 'filled', component: 'server', x: 460, y: 320, label: 'API' },
{ id: 'slot-queue', type: 'slot', correctAnswers: ['message-queue'], x: 640, y: 220, label: 'Jobs' },
{ id: 'slot-worker', type: 'slot', correctAnswers: ['worker'], x: 840, y: 220, label: 'Sandbox' },
{ id: 'slot-storage', type: 'slot', correctAnswers: ['object-storage', 'blob-storage'], x: 640, y: 460, label: 'Code' },
{ id: 'slot-ws', type: 'slot', correctAnswers: ['websocket', 'pubsub'], x: 1020, y: 320, label: 'Live' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache'], x: 840, y: 460, label: 'Tests' },
{ id: 'db', type: 'filled', component: 'database', x: 1220, y: 320, label: 'Results DB' }
],
edges: [
{ from: 'client', to: 'slot-rate', label: 'SUBMIT' },
{ from: 'slot-rate', to: 'api' },
{ from: 'api', to: 'slot-queue', label: 'ENQUEUE' },
{ from: 'slot-queue', to: 'slot-worker', label: 'EXECUTE' },
{ from: 'api', to: 'slot-storage', label: 'SAVE CODE' },
{ from: 'slot-worker', to: 'slot-cache', label: 'LOAD TESTS' },
{ from: 'slot-worker', to: 'slot-ws', label: 'VERDICT' },
{ from: 'slot-ws', to: 'db', label: 'STORE' }
]
}
},
// ============================================
// STORAGE ENGINES (Complex)
// ============================================
{
id: 'dropbox',
title: 'Dropbox File Sync System',
category: 'storage-engines',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a file synchronization system handling petabytes of data. Must support chunked uploads, delta sync, conflict resolution, and real-time sync across millions of devices.',
requirements: [
{ id: 'r1', text: 'Distribute upload/download traffic', targetSlots: ['slot-lb'] },
{ id: 'r2', text: 'Chunk files and deduplicate', targetSlots: ['slot-chunk'] },
{ id: 'r3', text: 'Store file chunks durably', targetSlots: ['slot-storage'] },
{ id: 'r4', text: 'Track file versions and metadata', targetSlots: ['slot-db'] },
{ id: 'r5', text: 'Notify devices of changes in real-time', targetSlots: ['slot-sync'] },
{ id: 'r6', text: 'Queue sync operations', targetSlots: ['slot-queue'] }
],
path: {
nodes: [
{ id: 'desktop', type: 'filled', component: 'desktop', x: 120, y: 320, label: 'Desktop' },
{ id: 'slot-lb', type: 'slot', correctAnswers: ['load-balancer', 'api-gateway'], x: 320, y: 320, label: 'Traffic' },
{ id: 'api', type: 'filled', component: 'server', x: 460, y: 320, label: 'Sync API' },
{ id: 'slot-chunk', type: 'slot', correctAnswers: ['worker'], x: 640, y: 200, label: 'Chunk' },
{ id: 'slot-storage', type: 'slot', correctAnswers: ['blob-storage', 'object-storage'], x: 840, y: 200, label: 'Blocks' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'nosql'], x: 640, y: 460, label: 'Metadata' },
{ id: 'slot-sync', type: 'slot', correctAnswers: ['websocket', 'pubsub'], x: 840, y: 320, label: 'Notify' },
{ id: 'slot-queue', type: 'slot', correctAnswers: ['message-queue'], x: 1020, y: 320, label: 'Sync Jobs' },
{ id: 'worker', type: 'filled', component: 'worker', x: 1220, y: 320, label: 'Sync Worker' }
],
edges: [
{ from: 'desktop', to: 'slot-lb', label: 'UPLOAD' },
{ from: 'slot-lb', to: 'api' },
{ from: 'api', to: 'slot-chunk', label: 'SPLIT' },
{ from: 'slot-chunk', to: 'slot-storage', label: 'STORE' },
{ from: 'api', to: 'slot-db', label: 'VERSION' },
{ from: 'api', to: 'slot-sync', label: 'CHANGE' },
{ from: 'slot-sync', to: 'slot-queue', label: 'QUEUE' },
{ from: 'slot-queue', to: 'worker', label: 'PROCESS' }
]
}
},
{
id: 'google-drive',
title: 'Google Drive Cloud Storage',
category: 'storage-engines',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design cloud storage with collaboration features. Must support file sharing, permissions, real-time editing notifications, and global access with low latency.',
requirements: [
{ id: 'r1', text: 'Serve files from edge locations', targetSlots: ['slot-cdn'] },
{ id: 'r2', text: 'Authenticate and authorize requests', targetSlots: ['slot-auth'] },
{ id: 'r3', text: 'Store file content', targetSlots: ['slot-storage'] },
{ id: 'r4', text: 'Manage file metadata and permissions', targetSlots: ['slot-db'] },
{ id: 'r5', text: 'Index files for search', targetSlots: ['slot-search'] },
{ id: 'r6', text: 'Notify collaborators of changes', targetSlots: ['slot-notify'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 120, y: 320, label: 'Browser' },
{ id: 'slot-cdn', type: 'slot', correctAnswers: ['cdn'], x: 320, y: 140, label: 'Edge' },
{ id: 'slot-auth', type: 'slot', correctAnswers: ['auth-service', 'oauth'], x: 320, y: 320, label: 'Auth' },
{ id: 'api', type: 'filled', component: 'server', x: 460, y: 320, label: 'Drive API' },
{ id: 'slot-storage', type: 'slot', correctAnswers: ['object-storage', 'blob-storage'], x: 640, y: 200, label: 'Files' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database'], x: 640, y: 460, label: 'Metadata' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine'], x: 840, y: 320, label: 'Index' },
{ id: 'slot-notify', type: 'slot', correctAnswers: ['pubsub', 'notification', 'websocket'], x: 1020, y: 320, label: 'Collab' }
],
edges: [
{ from: 'client', to: 'slot-cdn', label: 'DOWNLOAD' },
{ from: 'client', to: 'slot-auth', label: 'LOGIN' },
{ from: 'slot-auth', to: 'api' },
{ from: 'api', to: 'slot-storage', label: 'READ/WRITE' },
{ from: 'api', to: 'slot-db', label: 'PERMISSIONS' },
{ from: 'api', to: 'slot-search', label: 'INDEX' },
{ from: 'api', to: 'slot-notify', label: 'SHARED!' }
]
}
},
{
id: 'imgur',
title: 'Imgur Extreme Scale Hosting',
category: 'storage-engines',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a high-scale image hosting site. Challenges: Viral traffic spikes, de-duplication (SHA-1), generating thumbnails on fly, and serving via CDNs.',
requirements: [
{ id: 'r1', text: 'Deduplicate images (Hashing)', targetSlots: ['slot-dedup'] },
{ id: 'r2', text: 'Resize/Optimize Images', targetSlots: ['slot-worker'] },
{ id: 'r3', text: 'Separate Metadata from Blobs', targetSlots: ['slot-db'] },
{ id: 'r4', text: 'Viral Content Caching (CDN)', targetSlots: ['slot-cdn'] },
{ id: 'r5', text: 'Detect Viral/Trending Spikes', targetSlots: ['slot-analytics'] },
{ id: 'r6', text: 'Archive infrequently accessed', targetSlots: ['slot-archive'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 100, y: 320, label: 'User' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 280, y: 320, label: 'LB' },
{ id: 'api', type: 'filled', component: 'server', x: 440, y: 200, label: 'Upload' },
{ id: 'slot-dedup', type: 'slot', correctAnswers: ['feature-store', 'database'], x: 440, y: 440, label: 'Hash Map' },
{ id: 'slot-worker', type: 'slot', correctAnswers: ['worker', 'video-encoder'], x: 620, y: 200, label: 'Resizer' },
{ id: 'slot-cdn', type: 'slot', correctAnswers: ['cdn', 'media-cdn'], x: 800, y: 200, label: 'Hot Link' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'nosql'], x: 620, y: 440, label: 'Meta Shard' },
{ id: 'slot-archive', type: 'slot', correctAnswers: ['object-storage', 's3'], x: 800, y: 440, label: 'Cold Blob' },
{ id: 'slot-analytics', type: 'slot', correctAnswers: ['analytics', 'stream-processor'], x: 1000, y: 320, label: 'Viral Det' }
],
edges: [
{ from: 'client', to: 'lb', label: 'UPLOAD' },
{ from: 'lb', to: 'api' },
{ from: 'api', to: 'slot-dedup', label: 'CHECK HASH' },
{ from: 'api', to: 'slot-worker', label: 'JOB' },
{ from: 'slot-worker', to: 'slot-archive', label: 'STORE' },
{ from: 'slot-archive', to: 'slot-cdn', label: 'CACHE' },
{ from: 'api', to: 'slot-db', label: 'METADATA' },
{ from: 'api', to: 'slot-analytics', label: 'LOG VIEW' },
{ from: 'slot-analytics', to: 'slot-cdn', label: 'WARM UP' }
]
}
},
// ============================================
// SEARCH ENGINES (4 problems)
// ============================================
// ============================================
// SEARCH ENGINES (4 problems)
// ============================================
{
id: 'airbnb',
title: 'Airbnb Property Search',
category: 'search-engines',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a vacation rental platform handling millions of bookings. Must support complex geospatial search, real-time availability sync, dynamic pricing, and secure payments.',
requirements: [
{ id: 'r1', text: 'Geo-spatial Indexing (S2/Geohash)', targetSlots: ['slot-geo'] },
{ id: 'r2', text: 'Store Property Images', targetSlots: ['slot-blob'] },
{ id: 'r3', text: 'Cache Pricing & Availability', targetSlots: ['slot-cache'] },
{ id: 'r4', text: 'Full-text Search (Amenities)', targetSlots: ['slot-search'] },
{ id: 'r5', text: 'Process Bookings & Payments', targetSlots: ['slot-pay'] },
{ id: 'r6', text: 'Track User Clickstreams', targetSlots: ['slot-analytics'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 140, y: 320, label: 'Guest' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 340, y: 320, label: 'LB' },
{ id: 'api', type: 'filled', component: 'server', x: 540, y: 320, label: 'API' },
{ id: 'slot-geo', type: 'slot', correctAnswers: ['geospatial-db', 'location-service'], x: 540, y: 140, label: 'Geo Index' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine', 'elasticsearch'], x: 740, y: 140, label: 'Text Search' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'redis'], x: 740, y: 320, label: 'Hot Data' },
{ id: 'slot-blob', type: 'slot', correctAnswers: ['object-storage', 'cdn'], x: 740, y: 500, label: 'Photos' },
{ id: 'slot-pay', type: 'slot', correctAnswers: ['payment-gateway'], x: 940, y: 320, label: 'Payments' },
{ id: 'slot-analytics', type: 'slot', correctAnswers: ['analytics', 'kafka'], x: 940, y: 140, label: 'Logs' }
],
edges: [
{ from: 'client', to: 'lb', label: 'SEARCH' },
{ from: 'lb', to: 'api' },
{ from: 'api', to: 'slot-geo', label: 'LOC QUERY' },
{ from: 'api', to: 'slot-search', label: 'KEYWORD' },
{ from: 'api', to: 'slot-cache', label: 'CHECK' },
{ from: 'api', to: 'slot-blob', label: 'IMAGES' },
{ from: 'api', to: 'slot-pay', label: 'BOOK' },
{ from: 'api', to: 'slot-analytics', label: 'TRACK' }
]
}
},
{
id: 'google-maps',
title: 'Google Maps System',
category: 'search-engines',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a global mapping system. Key challenges: Rendering vector tiles, calculating optimal routes (A* / Dijkstra), handling real-time traffic data, and location search.',
requirements: [
{ id: 'r1', text: 'Serve Vector Tiles (Edge)', targetSlots: ['slot-cdn'] },
{ id: 'r2', text: 'Route Optimization Engine', targetSlots: ['slot-route'] },
{ id: 'r3', text: 'Real-time Traffic Ingestion', targetSlots: ['slot-stream'] },
{ id: 'r4', text: 'Place/POI Search', targetSlots: ['slot-search'] },
{ id: 'r5', text: 'Store Map Data (QuadTree)', targetSlots: ['slot-geo'] },
{ id: 'r6', text: 'Process ETA Predictions', targetSlots: ['slot-ml'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'mobile', x: 100, y: 320, label: 'Maps App' },
{ id: 'slot-cdn', type: 'slot', correctAnswers: ['cdn'], x: 300, y: 200, label: 'Tile Edge' },
{ id: 'gateway', type: 'filled', component: 'api-gateway', x: 300, y: 440, label: 'Gateway' },
{ id: 'api', type: 'filled', component: 'server', x: 500, y: 440, label: 'Maps API' },
{ id: 'slot-route', type: 'slot', correctAnswers: ['route-optimizer', 'worker'], x: 700, y: 320, label: 'Routing' },
{ id: 'slot-geo', type: 'slot', correctAnswers: ['geospatial-db', 'database'], x: 700, y: 560, label: 'Map DB' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine', 'elasticsearch'], x: 900, y: 440, label: 'Places' },
{ id: 'slot-stream', type: 'slot', correctAnswers: ['kafka', 'pubsub'], x: 700, y: 200, label: 'Traffic In' },
{ id: 'slot-ml', type: 'slot', correctAnswers: ['ml-model', 'analytics'], x: 900, y: 200, label: 'ETA ML' }
],
edges: [
{ from: 'client', to: 'slot-cdn', label: 'GET TILES' },
{ from: 'client', to: 'gateway', label: 'NAVIGATE' },
{ from: 'gateway', to: 'api' },
{ from: 'api', to: 'slot-route', label: 'CALC PATH' },
{ from: 'slot-route', to: 'slot-geo', label: 'FETCH SEGMENTS' },
{ from: 'api', to: 'slot-search', label: 'FIND POI' },
{ from: 'slot-stream', to: 'slot-ml', label: 'FLOW' },
{ from: 'slot-ml', to: 'slot-route', label: 'WEIGHTS' }
]
}
},
{
id: 'elasticsearch',
title: 'Distributed Search Cluster',
category: 'search-engines',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a distributed search engine like Elasticsearch. Must handle sharding, replication, leader election (Raft/Paxos), inverted index storage, and complex aggregation queries.',
requirements: [
{ id: 'r1', text: 'Manage Cluster State (Coordination)', targetSlots: ['slot-coord'] },
{ id: 'r2', text: 'Store Inverted Indices (Shards)', targetSlots: ['slot-data'] },
{ id: 'r3', text: 'Ingest & Buffer Logs', targetSlots: ['slot-queue'] },
{ id: 'r4', text: 'Cache Frequently used Filters', targetSlots: ['slot-cache'] },
{ id: 'r5', text: 'Archive Old Logs', targetSlots: ['slot-archive'] },
{ id: 'r6', text: 'Visualize Metrics (Kibana)', targetSlots: ['slot-viz'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'server', x: 100, y: 320, label: 'App Server' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 300, y: 320, label: 'LB' },
{ id: 'slot-coord', type: 'slot', correctAnswers: ['server', 'zookeeper'], x: 500, y: 320, label: 'Coordinator' },
{ id: 'slot-queue', type: 'slot', correctAnswers: ['kafka', 'message-queue'], x: 300, y: 560, label: 'Log Buffer' },
{ id: 'slot-data', type: 'slot', correctAnswers: ['search-engine', 'database'], x: 740, y: 320, label: 'Data Node' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'redis'], x: 740, y: 140, label: 'Filter $Cache' },
{ id: 'slot-archive', type: 'slot', correctAnswers: ['object-storage', 'blob-storage'], x: 940, y: 320, label: 'Cold Store' },
{ id: 'slot-viz', type: 'slot', correctAnswers: ['analytics', 'browser'], x: 500, y: 140, label: 'Dashboard' }
],
edges: [
{ from: 'client', to: 'lb', label: 'QUERY / INDEX' },
{ from: 'lb', to: 'slot-coord', label: 'ROUTE' },
{ from: 'client', to: 'slot-queue', label: 'INGEST' },
{ from: 'slot-queue', to: 'slot-coord', label: 'BULK' },
{ from: 'slot-coord', to: 'slot-data', label: 'FANOUT' },
{ from: 'slot-data', to: 'slot-cache', label: 'CHECK' },
{ from: 'slot-data', to: 'slot-archive', label: 'SNAPSHOT' },
{ from: 'slot-viz', to: 'slot-coord', label: 'AGGREGATE' }
]
}
},
{
id: 'twitter-search',
title: 'Twitter/X Real-time Search',
category: 'search-engines',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a real-time search engine for tweets. Must ingest millions of tweets/sec, index them immediately ("earlybird" architecture), and serve fresh results with <100ms latency.',
requirements: [
{ id: 'r1', text: 'Ingest Tweet Stream (Firehose)', targetSlots: ['slot-stream'] },
{ id: 'r2', text: 'Partition/Shard Index (Earlybird)', targetSlots: ['slot-index'] },
{ id: 'r3', text: 'Compute Real-time Trends', targetSlots: ['slot-storm'] },
{ id: 'r4', text: 'Scatter-Gather Search Queries', targetSlots: ['slot-mixer'] },
{ id: 'r5', text: 'Persist Tweet Data', targetSlots: ['slot-store'] },
{ id: 'r6', text: 'Filter Spam/Abuse', targetSlots: ['slot-ml'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 100, y: 320, label: 'User' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 280, y: 320, label: 'LB' },
{ id: 'slot-mixer', type: 'slot', correctAnswers: ['server', 'api-gateway'], x: 460, y: 320, label: 'Term Mixer' },
{ id: 'slot-stream', type: 'slot', correctAnswers: ['kafka', 'message-queue'], x: 280, y: 560, label: 'Firehose' },
{ id: 'slot-ml', type: 'slot', correctAnswers: ['ml-model', 'content-moderation'], x: 460, y: 560, label: 'Spam Filter' },
{ id: 'slot-index', type: 'slot', correctAnswers: ['search-engine', 'elasticsearch'], x: 740, y: 320, label: 'Index Shards' },
{ id: 'slot-store', type: 'slot', correctAnswers: ['database', 'cassandra'], x: 740, y: 560, label: 'Tweet DB' },
{ id: 'slot-storm', type: 'slot', correctAnswers: ['stream-server', 'analytics'], x: 460, y: 140, label: 'Trends' },
{ id: 'cache', type: 'filled', component: 'cache', x: 740, y: 140, label: 'Results #' }
],
edges: [
{ from: 'client', to: 'lb', label: 'SEARCH' },
{ from: 'lb', to: 'slot-mixer' },
{ from: 'slot-mixer', to: 'slot-index', label: 'SCATTER' },
{ from: 'slot-mixer', to: 'cache', label: 'CHECK' },
{ from: 'slot-stream', to: 'slot-ml', label: 'FILTER' },
{ from: 'slot-ml', to: 'slot-index', label: 'INDEX' },
{ from: 'slot-ml', to: 'slot-store', label: 'SAVE' },
{ from: 'slot-ml', to: 'slot-storm', label: 'COUNT' }
]
}
},
// ============================================
// BOOKING SYSTEMS (4 problems)
// ============================================
{
id: 'bookmyshow',
title: 'BookMyShow (High Concurrency)',
category: 'booking-systems',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a movie booking platform handling flash sales (e.g., Avengers/Marvel releases). Must prevent double-booking, handle payment failures, and deliver tickets via SMS/Email.',
requirements: [
{ id: 'r1', text: 'Handle Booking Bursts (Queue)', targetSlots: ['slot-queue'] },
{ id: 'r2', text: 'Distributed Lock for Seats', targetSlots: ['slot-cache'] },
{ id: 'r3', text: 'Transactional Booking DB', targetSlots: ['slot-db'] },
{ id: 'r4', text: 'Payment Processing', targetSlots: ['slot-pay'] },
{ id: 'r5', text: 'Async Notification (SMS/Email)', targetSlots: ['slot-notify'] },
{ id: 'r6', text: 'Analytics for Box Office', targetSlots: ['slot-analytics'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'mobile', x: 100, y: 320, label: 'App' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 300, y: 320, label: 'LB' },
{ id: 'api', type: 'filled', component: 'server', x: 500, y: 320, label: 'Server' },
{ id: 'slot-queue', type: 'slot', correctAnswers: ['message-queue', 'kafka'], x: 500, y: 140, label: 'Wait Queue' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['redis', 'cache'], x: 740, y: 140, label: 'Seat Lock' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'sql'], x: 740, y: 320, label: 'Orders' },
{ id: 'slot-pay', type: 'slot', correctAnswers: ['payment-gateway'], x: 740, y: 500, label: 'PG' },
{ id: 'slot-notify', type: 'slot', correctAnswers: ['notification', 'sms-service'], x: 940, y: 320, label: 'Ticket' },
{ id: 'slot-analytics', type: 'slot', correctAnswers: ['analytics', 'data-warehouse'], x: 940, y: 500, label: 'Sales' }
],
edges: [
{ from: 'client', to: 'lb', label: 'BOOK' },
{ from: 'lb', to: 'api' },
{ from: 'api', to: 'slot-queue', label: 'THROTTLE' },
{ from: 'api', to: 'slot-cache', label: 'ACQUIRE LOCK' },
{ from: 'api', to: 'slot-db', label: 'TRANSACTION' },
{ from: 'api', to: 'slot-pay', label: 'CHARGE' },
{ from: 'slot-db', to: 'slot-notify', label: 'CONFIRM' },
{ from: 'slot-pay', to: 'slot-analytics', label: 'AUDIT' }
]
}
},
{
id: 'makemytrip',
title: 'MakeMyTrip Broadcast Search',
category: 'booking-systems',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a flight aggregator. Queries multiple GDS (Global Distribution Systems) and Airline APIs in parallel, aggregates results, caches them for speed, and handles booking redirection.',
requirements: [
{ id: 'r1', text: 'Broadcast Search to Partners', targetSlots: ['slot-aggregator'] },
{ id: 'r2', text: 'Cache Flight Results (TTL)', targetSlots: ['slot-cache'] },
{ id: 'r3', text: 'Connect to 3rd Party GDS/Airlines', targetSlots: ['slot-gds'] },
{ id: 'r4', text: 'Track Search History', targetSlots: ['slot-history'] },
{ id: 'r5', text: 'Recommend Destinations', targetSlots: ['slot-rec'] },
{ id: 'r6', text: 'Process Referrals/Bookings', targetSlots: ['slot-api'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 100, y: 320, label: 'Traveler' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 280, y: 320, label: 'LB' },
{ id: 'slot-api', type: 'slot', correctAnswers: ['server', 'api-gateway'], x: 460, y: 320, label: 'API GW' },
{ id: 'slot-aggregator', type: 'slot', correctAnswers: ['worker', 'server'], x: 680, y: 320, label: 'Aggregator' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['distributed-cache', 'redis'], x: 680, y: 140, label: 'Search Cache' },
{ id: 'slot-gds', type: 'slot', correctAnswers: ['third-party', 'api-gateway'], x: 920, y: 320, label: 'Amadeus/Sabre' },
{ id: 'slot-history', type: 'slot', correctAnswers: ['database', 'nosql'], x: 460, y: 540, label: 'User DB' },
{ id: 'slot-rec', type: 'slot', correctAnswers: ['recommendation', 'ml-model'], x: 680, y: 540, label: 'Recs' }
],
edges: [
{ from: 'client', to: 'lb', label: 'SEARCH FLIGHT' },
{ from: 'lb', to: 'slot-api' },
{ from: 'slot-api', to: 'slot-history', label: 'SAVE' },
{ from: 'slot-api', to: 'slot-cache', label: 'CHECK' },
{ from: 'slot-api', to: 'slot-aggregator', label: 'MISS' },
{ from: 'slot-aggregator', to: 'slot-gds', label: 'FETCH' },
{ from: 'slot-aggregator', to: 'slot-cache', label: 'UPDATE' },
{ from: 'slot-api', to: 'slot-rec', label: 'GET ADS' }
]
}
},
{
id: 'opentable',
title: 'OpenTable Reservation System',
category: 'booking-systems',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a global restaurant reservation system. Must handle time-zone logic, table management (inventory), notifications, and user dining history.',
requirements: [
{ id: 'r1', text: 'Search by Cuisine/Location', targetSlots: ['slot-search'] },
{ id: 'r2', text: 'Manage Table Inventory (SQL)', targetSlots: ['slot-db'] },
{ id: 'r3', text: 'Cache Availability', targetSlots: ['slot-cache'] },
{ id: 'r4', text: 'Send SMS/Email Confirmations', targetSlots: ['slot-notify'] },
{ id: 'r5', text: 'Diner Analytics/History', targetSlots: ['slot-analytics'] },
{ id: 'r6', text: 'Sync with POS Systems', targetSlots: ['slot-pos'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'mobile', x: 100, y: 320, label: 'Diner' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 300, y: 320, label: 'LB' },
{ id: 'api', type: 'filled', component: 'server', x: 500, y: 320, label: 'API' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine', 'elasticsearch'], x: 500, y: 140, label: 'Search' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'redis'], x: 700, y: 140, label: 'Avail Cache' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'sql'], x: 700, y: 320, label: 'Inventory' },
{ id: 'slot-notify', type: 'slot', correctAnswers: ['notification', 'email-service'], x: 700, y: 520, label: 'Alert' },
{ id: 'slot-pos', type: 'slot', correctAnswers: ['third-party', 'iot-device'], x: 920, y: 320, label: 'Restaurant POS' },
{ id: 'slot-analytics', type: 'slot', correctAnswers: ['analytics', 'data-warehouse'], x: 920, y: 520, label: 'History' }
],
edges: [
{ from: 'client', to: 'lb', label: 'RESERVE' },
{ from: 'lb', to: 'api' },
{ from: 'api', to: 'slot-search', label: 'FIND' },
{ from: 'api', to: 'slot-cache', label: 'CHECK' },
{ from: 'api', to: 'slot-db', label: 'BOOK' },
{ from: 'slot-db', to: 'slot-notify', label: 'CONFIRM' },
{ from: 'slot-db', to: 'slot-pos', label: 'SYNC' },
{ from: 'slot-pos', to: 'slot-analytics', label: 'STATS' }
]
}
},
{
id: 'practo',
title: 'Practo Doctor Consultations',
category: 'booking-systems',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design a telemedicine platform. Supports video consultations, appointment booking, e-prescriptions, and secure health record storage (HIPAA compliant).',
requirements: [
{ id: 'r1', text: 'Find Doctors (Geo/Specialty)', targetSlots: ['slot-search'] },
{ id: 'r2', text: 'Video Consultation WebRTC', targetSlots: ['slot-video'] },
{ id: 'r3', text: 'Secure Health Records (Encrypted)', targetSlots: ['slot-storage'] },
{ id: 'r4', text: 'Appointment Scheduling', targetSlots: ['slot-db'] },
{ id: 'r5', text: 'Notifications & Reminders', targetSlots: ['slot-notify'] },
{ id: 'r6', text: 'Payment & Billing', targetSlots: ['slot-pay'] }
],
path: {
nodes: [
{ id: 'patient', type: 'filled', component: 'mobile', x: 100, y: 220, label: 'Patient' },
{ id: 'doctor', type: 'filled', component: 'desktop', x: 100, y: 440, label: 'Doctor' },
{ id: 'gateway', type: 'filled', component: 'api-gateway', x: 300, y: 320, label: 'Gateway' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine', 'elasticsearch'], x: 500, y: 140, label: 'Doc Search' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'sql'], x: 500, y: 320, label: 'Schedule' },
{ id: 'slot-video', type: 'slot', correctAnswers: ['signaling', 'server'], x: 500, y: 520, label: 'Video Sig' },
{ id: 'slot-storage', type: 'slot', correctAnswers: ['object-storage', 'database'], x: 740, y: 320, label: 'Records' },
{ id: 'slot-pay', type: 'slot', correctAnswers: ['payment-gateway'], x: 740, y: 140, label: 'Fees' },
{ id: 'slot-notify', type: 'slot', correctAnswers: ['notification', 'sms-service'], x: 740, y: 520, label: 'Remind' }
],
edges: [
{ from: 'patient', to: 'gateway', label: 'BOOK' },
{ from: 'doctor', to: 'gateway', label: 'JOIN' },
{ from: 'gateway', to: 'slot-search', label: 'FIND' },
{ from: 'gateway', to: 'slot-db', label: 'APPT' },
{ from: 'gateway', to: 'slot-video', label: 'CALL' },
{ from: 'gateway', to: 'slot-storage', label: 'RX' },
{ from: 'slot-db', to: 'slot-pay', label: 'BILL' },
{ from: 'slot-db', to: 'slot-notify', label: 'ALERT' }
]
}
},
// ============================================
// SOCIAL MEDIA (4 problems)
// ============================================
{
id: 'facebook',
title: 'Facebook Social Graph',
category: 'social-media',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design the Facebook social graph and newsfeed. Handle bidirectional friendships, complex privacy controls, and generate personalized feeds for billions of users.',
requirements: [
{ id: 'r1', text: 'Store Social Graph (Nodes/Edges)', targetSlots: ['slot-graph'] },
{ id: 'r2', text: 'Rank Newsfeed (ML)', targetSlots: ['slot-rank'] },
{ id: 'r3', text: 'Cache User Feeds (Fan-out)', targetSlots: ['slot-cache'] },
{ id: 'r4', text: 'Store Posts & Media', targetSlots: ['slot-db'] },
{ id: 'r5', text: 'Real-time Likes/Comments', targetSlots: ['slot-ws'] },
{ id: 'r6', text: 'Async Activity Logs', targetSlots: ['slot-queue'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 100, y: 320, label: 'User' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 300, y: 320, label: 'LB' },
{ id: 'api', type: 'filled', component: 'server', x: 500, y: 320, label: 'Graph API' },
{ id: 'slot-graph', type: 'slot', correctAnswers: ['graph-db', 'sql'], x: 500, y: 140, label: 'Social Graph' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['database', 'cassandra'], x: 740, y: 320, label: 'Posts DB' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'redis'], x: 740, y: 140, label: 'Feed Cache' },
{ id: 'slot-rank', type: 'slot', correctAnswers: ['ml-model', 'recommendation'], x: 940, y: 140, label: 'Ranker' },
{ id: 'slot-ws', type: 'slot', correctAnswers: ['websocket', 'pubsub'], x: 740, y: 500, label: 'Live' },
{ id: 'slot-queue', type: 'slot', correctAnswers: ['message-queue', 'kafka'], x: 940, y: 320, label: 'Activity' }
],
edges: [
{ from: 'client', to: 'lb', label: 'REQ' },
{ from: 'lb', to: 'api' },
{ from: 'api', to: 'slot-graph', label: 'FRIENDS' },
{ from: 'api', to: 'slot-db', label: 'FETCH POSTS' },
{ from: 'api', to: 'slot-cache', label: 'GET FEED' },
{ from: 'slot-cache', to: 'slot-rank', label: 'SORT' },
{ from: 'api', to: 'slot-ws', label: 'NOTIFY' },
{ from: 'api', to: 'slot-queue', label: 'LOG' }
]
}
},
{
id: 'linkedin',
title: 'LinkedIn Professional Network',
category: 'social-media',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design LinkedIn. Focus on "Degrees of Connection" queries (1st, 2nd, 3rd), profile viewing visibility, search, and professional content feed.',
requirements: [
{ id: 'r1', text: 'Graph Traversal (Connections)', targetSlots: ['slot-graph'] },
{ id: 'r2', text: 'Profile/Job Search', targetSlots: ['slot-search'] },
{ id: 'r3', text: 'Store Rich Profile Data', targetSlots: ['slot-doc'] },
{ id: 'r4', text: 'Track Profile Views', targetSlots: ['slot-stream'] },
{ id: 'r5', text: 'Cache Connections', targetSlots: ['slot-cache'] },
{ id: 'r6', text: 'Recruiter Analytics', targetSlots: ['slot-analytics'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'browser', x: 100, y: 320, label: 'Pro' },
{ id: 'gateway', type: 'filled', component: 'api-gateway', x: 300, y: 320, label: 'Gateway' },
{ id: 'api', type: 'filled', component: 'server', x: 500, y: 320, label: 'API' },
{ id: 'slot-graph', type: 'slot', correctAnswers: ['graph-db', 'neo4j'], x: 500, y: 140, label: 'Connections' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine', 'elasticsearch'], x: 740, y: 140, label: 'Search' },
{ id: 'slot-doc', type: 'slot', correctAnswers: ['nosql', 'database'], x: 740, y: 320, label: 'Profile DB' },
{ id: 'slot-stream', type: 'slot', correctAnswers: ['kafka', 'message-queue'], x: 500, y: 520, label: 'View Events' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'redis'], x: 740, y: 520, label: 'Graph Cache' },
{ id: 'slot-analytics', type: 'slot', correctAnswers: ['analytics', 'data-warehouse'], x: 940, y: 320, label: 'Reports' }
],
edges: [
{ from: 'client', to: 'gateway', label: 'VIEW' },
{ from: 'gateway', to: 'api' },
{ from: 'api', to: 'slot-graph', label: '2nd/3rd DEG' },
{ from: 'api', to: 'slot-search', label: 'QUERY' },
{ from: 'api', to: 'slot-doc', label: 'FETCH' },
{ from: 'api', to: 'slot-stream', label: 'LOG VIEW' },
{ from: 'slot-graph', to: 'slot-cache', label: 'CACHE' },
{ from: 'slot-stream', to: 'slot-analytics', label: 'AGGREGATE' }
]
}
},
// ============================================
// LOCATION BASED (Complex - Real Uber/Maps Architecture)
// ============================================
{
id: 'uber',
title: 'Uber Ride-Sharing Platform',
category: 'location-based',
difficulty: 'Hard',
isFree: true,
timeLimit: 1500,
description: 'Design Uber handling millions of concurrent rides. Must support real-time GPS tracking, efficient driver matching within radius, surge pricing, trip ETA, fare calculation, payments, and driver/rider ratings with fraud prevention.',
requirements: [
{ id: 'r1', text: 'Store and query driver locations efficiently', targetSlots: ['slot-geo'] },
{ id: 'r2', text: 'Match riders with nearby drivers in real-time', targetSlots: ['slot-match'] },
{ id: 'r3', text: 'Push real-time location updates to riders', targetSlots: ['slot-ws'] },
{ id: 'r4', text: 'Process payments securely', targetSlots: ['slot-payment'] },
{ id: 'r5', text: 'Calculate optimal routes and ETA', targetSlots: ['slot-route'] },
{ id: 'r6', text: 'Detect fraudulent rides and driver behavior', targetSlots: ['slot-fraud'] },
{ id: 'r7', text: 'Stream trip events for analytics', targetSlots: ['slot-kafka'] }
],
path: {
nodes: [
{ id: 'rider', type: 'filled', component: 'mobile', x: 100, y: 220, label: 'Rider App' },
{ id: 'driver', type: 'filled', component: 'mobile', x: 100, y: 440, label: 'Driver App' },
{ id: 'lb', type: 'filled', component: 'load-balancer', x: 260, y: 320, label: 'LB' },
{ id: 'api', type: 'filled', component: 'server', x: 440, y: 320, label: 'Trip API' },
{ id: 'slot-geo', type: 'slot', correctAnswers: ['geospatial-db', 'location-service'], x: 640, y: 140, label: 'Geo Index' },
{ id: 'slot-match', type: 'slot', correctAnswers: ['worker', 'server'], x: 640, y: 320, label: 'Match' },
{ id: 'slot-ws', type: 'slot', correctAnswers: ['websocket', 'pubsub'], x: 820, y: 220, label: 'Live Track' },
{ id: 'slot-route', type: 'slot', correctAnswers: ['route-optimizer', 'maps-api'], x: 820, y: 320, label: 'Route' },
{ id: 'slot-payment', type: 'slot', correctAnswers: ['payment-gateway'], x: 1000, y: 220, label: 'Pay' },
{ id: 'slot-fraud', type: 'slot', correctAnswers: ['fraud-detection', 'ml-model'], x: 1000, y: 320, label: 'Fraud' },
{ id: 'slot-kafka', type: 'slot', correctAnswers: ['kafka', 'event-bus'], x: 1000, y: 460, label: 'Events' }
],
edges: [
{ from: 'rider', to: 'lb', label: 'REQUEST RIDE' },
{ from: 'driver', to: 'lb', label: 'GPS UPDATE' },
{ from: 'lb', to: 'api' },
{ from: 'api', to: 'slot-geo', label: 'NEARBY DRIVERS' },
{ from: 'slot-geo', to: 'slot-match', label: 'CANDIDATES' },
{ from: 'slot-match', to: 'slot-ws', label: 'ASSIGNED' },
{ from: 'api', to: 'slot-route', label: 'ETA' },
{ from: 'api', to: 'slot-payment', label: 'CHARGE' },
{ from: 'slot-payment', to: 'slot-fraud', label: 'CHECK' },
{ from: 'api', to: 'slot-kafka', label: 'TRIP EVENT' }
]
}
},
{
id: 'yelp',
title: 'Yelp Local Business Discovery',
category: 'location-based',
difficulty: 'Hard',
isFree: true,
timeLimit: 1200,
description: 'Design Yelp serving millions of local searches. Must support geospatial queries, full-text search, photo uploads, review authenticity checks, personalized recommendations, and handle peak lunch/dinner traffic.',
requirements: [
{ id: 'r1', text: 'Search businesses by location radius', targetSlots: ['slot-geo'] },
{ id: 'r2', text: 'Full-text search for business names/cuisines', targetSlots: ['slot-search'] },
{ id: 'r3', text: 'Cache popular restaurant data', targetSlots: ['slot-cache'] },
{ id: 'r4', text: 'Store business photos', targetSlots: ['slot-photos'] },
{ id: 'r5', text: 'Detect fake reviews with ML', targetSlots: ['slot-ml'] },
{ id: 'r6', text: 'Personalized recommendations', targetSlots: ['slot-rec'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'mobile', x: 120, y: 320, label: 'Yelp App' },
{ id: 'cdn', type: 'filled', component: 'cdn', x: 320, y: 200, label: 'CDN' },
{ id: 'api', type: 'filled', component: 'server', x: 320, y: 320, label: 'API' },
{ id: 'slot-geo', type: 'slot', correctAnswers: ['geospatial-db', 'location-service'], x: 460, y: 220, label: 'Geo' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine'], x: 460, y: 440, label: 'Text' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'distributed-cache'], x: 640, y: 220, label: 'Hot Spots' },
{ id: 'slot-photos', type: 'slot', correctAnswers: ['object-storage', 'blob-storage'], x: 640, y: 440, label: 'Photos' },
{ id: 'slot-ml', type: 'slot', correctAnswers: ['ml-model', 'content-moderation'], x: 840, y: 320, label: 'Fake Check' },
{ id: 'slot-rec', type: 'slot', correctAnswers: ['recommendation'], x: 1020, y: 320, label: 'For You' },
{ id: 'db', type: 'filled', component: 'database', x: 840, y: 520, label: 'Reviews DB' }
],
edges: [
{ from: 'client', to: 'cdn', label: 'PHOTOS' },
{ from: 'client', to: 'api', label: 'SEARCH' },
{ from: 'api', to: 'slot-geo', label: 'NEARBY' },
{ from: 'api', to: 'slot-search', label: 'QUERY' },
{ from: 'slot-geo', to: 'slot-cache', label: 'CHECK' },
{ from: 'api', to: 'slot-photos', label: 'UPLOAD' },
{ from: 'api', to: 'slot-ml', label: 'REVIEW' },
{ from: 'slot-ml', to: 'db', label: 'STORE' },
{ from: 'api', to: 'slot-rec', label: 'PERSONALIZE' }
]
}
},
// ============================================
// VIDEO STREAMING (Complex - Real Netflix/YouTube Architecture)
// ============================================
{
id: 'netflix',
title: 'Netflix Video Streaming Platform',
category: 'video-streaming',
difficulty: 'Hard',
isFree: true,
timeLimit: 1500,
description: 'Design Netflix serving 200M+ subscribers globally. Must support adaptive bitrate streaming, personalized recommendations, offline downloads, multiple device sync, and handle 15% of global internet traffic during peak hours.',
requirements: [
{ id: 'r1', text: 'Authenticate users and manage sessions', targetSlots: ['slot-auth'] },
{ id: 'r2', text: 'Serve video chunks from edge (200+ POPs)', targetSlots: ['slot-cdn'] },
{ id: 'r3', text: 'Store encoded video segments', targetSlots: ['slot-storage'] },
{ id: 'r4', text: 'Personalized content recommendations', targetSlots: ['slot-ml'] },
{ id: 'r5', text: 'Cache user profiles and watch history', targetSlots: ['slot-cache'] },
{ id: 'r6', text: 'Track viewing analytics in real-time', targetSlots: ['slot-kafka'] },
{ id: 'r7', text: 'Store user data and content catalog', targetSlots: ['slot-db'] }
],
path: {
nodes: [
{ id: 'client', type: 'filled', component: 'smart-tv', x: 100, y: 320, label: 'Smart TV' },
{ id: 'slot-auth', type: 'slot', correctAnswers: ['auth-service', 'oauth'], x: 260, y: 200, label: 'Auth' },
{ id: 'slot-cdn', type: 'slot', correctAnswers: ['cdn', 'media-cdn'], x: 260, y: 320, label: 'Edge POP' },
{ id: 'api', type: 'filled', component: 'server', x: 440, y: 320, label: 'API Service' },
{ id: 'slot-storage', type: 'slot', correctAnswers: ['object-storage', 'blob-storage'], x: 640, y: 200, label: 'Video Chunks' },
{ id: 'slot-ml', type: 'slot', correctAnswers: ['recommendation', 'ml-model'], x: 640, y: 320, label: 'Recommend' },
{ id: 'slot-cache', type: 'slot', correctAnswers: ['cache', 'distributed-cache'], x: 820, y: 200, label: 'Profiles' },
{ id: 'slot-kafka', type: 'slot', correctAnswers: ['kafka', 'pubsub', 'event-bus'], x: 820, y: 460, label: 'Events' },
{ id: 'slot-db', type: 'slot', correctAnswers: ['nosql', 'database'], x: 1000, y: 320, label: 'Catalog' }
],
edges: [
{ from: 'client', to: 'slot-auth', label: 'LOGIN' },
{ from: 'client', to: 'slot-cdn', label: 'STREAM' },
{ from: 'slot-cdn', to: 'api', label: 'MANIFEST' },
{ from: 'slot-cdn', to: 'slot-storage', label: 'FETCH CHUNK' },
{ from: 'api', to: 'slot-ml', label: 'PERSONALIZE' },
{ from: 'api', to: 'slot-cache', label: 'PROFILE' },
{ from: 'api', to: 'slot-kafka', label: 'VIEW EVENT' },
{ from: 'slot-ml', to: 'slot-db', label: 'CONTENT' }
]
}
},
{
id: 'youtube',
title: 'YouTube Video Upload & Processing',
category: 'video-streaming',
difficulty: 'Hard',
isFree: true,
timeLimit: 1500,
description: 'Design YouTube handling 500+ hours of video uploaded per minute. Must process videos into multiple resolutions, generate thumbnails, moderate content, enable search, and handle billions of views with monetization tracking.',
requirements: [
{ id: 'r1', text: 'Store raw uploaded videos', targetSlots: ['slot-raw'] },
{ id: 'r2', text: 'Queue transcoding jobs', targetSlots: ['slot-queue'] },
{ id: 'r3', text: 'Transcode to multiple resolutions (4K, 1080p, 720p)', targetSlots: ['slot-transcode'] },
{ id: 'r4', text: 'Moderate content for policy violations', targetSlots: ['slot-moderate'] },
{ id: 'r5', text: 'Index videos for search', targetSlots: ['slot-search'] },
{ id: 'r6', text: 'Package HLS/DASH streams', targetSlots: ['slot-hls'] },
{ id: 'r7', text: 'Serve via global CDN', targetSlots: ['slot-cdn'] }
],
path: {
nodes: [
{ id: 'creator', type: 'filled', component: 'browser', x: 100, y: 320, label: 'Creator' },
{ id: 'upload', type: 'filled', component: 'server', x: 260, y: 320, label: 'Upload API' },
{ id: 'slot-raw', type: 'slot', correctAnswers: ['object-storage', 'blob-storage'], x: 440, y: 200, label: 'Raw' },
{ id: 'slot-queue', type: 'slot', correctAnswers: ['message-queue', 'kafka'], x: 440, y: 460, label: 'Jobs' },
{ id: 'slot-transcode', type: 'slot', correctAnswers: ['transcoder', 'video-encoder'], x: 640, y: 320, label: 'Encode' },
{ id: 'slot-moderate', type: 'slot', correctAnswers: ['content-moderation', 'ml-model'], x: 640, y: 520, label: 'Check' },
{ id: 'slot-search', type: 'slot', correctAnswers: ['search-engine'], x: 820, y: 200, label: 'Index' },
{ id: 'slot-hls', type: 'slot', correctAnswers: ['hls-packager', 'worker'], x: 820, y: 320, label: 'Package' },
{ id: 'slot-cdn', type: 'slot', correctAnswers: ['cdn', 'media-cdn'], x: 1000, y: 320, label: 'Deliver' }
],
edges: [
{ from: 'creator', to: 'upload', label: 'UPLOAD' },
{ from: 'upload', to: 'slot-raw', label: 'STORE RAW' },
{ from: 'upload', to: 'slot-queue', label: 'ENQUEUE' },