{
  "app": "designlab",
  "version": 1,
  "exportedAt": "2026-10-19T19:39:16.638Z",
  "settings": [
    {
      "id": 1,
      "displayName": "Swarup",
      "dailyGoalMinutes": 30,
      "weeklyGoalProblems": 3,
      "activePathId": "hld-foundations",
      "newCardsPerDay": 20,
      "reviewsPerDay": 100,
      "timezone": "Asia/Calcutta",
      "onboarded": true,
      "aiMonthlyTokens": 500000,
      "unlockModuleLabs": false,
      "createdAt": "2026-10-17T02:30:33.440Z"
    }
  ],
  "problemProgress": [
    {
      "problemId": "parking-lot",
      "status": "not_started",
      "startedAt": null,
      "completedAt": null,
      "lastOpenedAt": "2026-10-19T17:01:05.232Z",
      "lastTab": "visualize",
      "timeSpentSec": 480,
      "hintsRevealed": 0,
      "solutionViewed": false,
      "reviewCount": 0,
      "bestScore": null
    },
    {
      "problemId": "file-storage",
      "status": "not_started",
      "startedAt": null,
      "completedAt": null,
      "lastOpenedAt": "2026-10-17T02:42:23.773Z",
      "lastTab": "brief",
      "timeSpentSec": 0,
      "hintsRevealed": 0,
      "solutionViewed": false,
      "reviewCount": 0,
      "bestScore": null
    },
    {
      "problemId": "notification-service",
      "status": "not_started",
      "startedAt": null,
      "completedAt": null,
      "lastOpenedAt": "2026-10-17T02:49:38.344Z",
      "lastTab": "approach",
      "timeSpentSec": 60,
      "hintsRevealed": 0,
      "solutionViewed": false,
      "reviewCount": 0,
      "bestScore": null
    },
    {
      "problemId": "tic-tac-toe",
      "status": "not_started",
      "startedAt": null,
      "completedAt": null,
      "lastOpenedAt": "2026-10-18T02:18:22.744Z",
      "lastTab": "solution",
      "timeSpentSec": 60,
      "hintsRevealed": 0,
      "solutionViewed": true,
      "reviewCount": 0,
      "bestScore": null
    },
    {
      "problemId": "url-shortener",
      "status": "in_progress",
      "startedAt": "2026-10-17T02:39:15.018Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-18T09:25:43.127Z",
      "lastTab": "studio",
      "timeSpentSec": 300,
      "hintsRevealed": 0,
      "solutionViewed": true,
      "reviewCount": 0,
      "bestScore": null
    }
  ],
  "designs": [
    {
      "problemId": "url-shortener",
      "canvas": {
        "edges": [],
        "nodes": [
          {
            "x": -152,
            "y": 16,
            "id": "n_agyc0zk7",
            "kind": "client",
            "label": "Client"
          },
          {
            "x": 356,
            "y": 148,
            "id": "n_k68bmwxj",
            "kind": "gateway",
            "label": "Load balancer"
          },
          {
            "x": -116,
            "y": 172,
            "id": "n_9zsd2b1s",
            "kind": "datastore",
            "label": "Database"
          },
          {
            "x": 164,
            "y": -20,
            "id": "n_3zuir58z",
            "kind": "queue",
            "label": "Queue"
          },
          {
            "x": 104,
            "y": 104,
            "id": "n_lmu6dulz",
            "kind": "service",
            "label": "API service"
          },
          {
            "x": 356,
            "y": 28,
            "id": "n_xc70jog6",
            "kind": "cache",
            "label": "Cache"
          }
        ]
      },
      "answers": [],
      "contracts": "",
      "notes": "",
      "revision": 8,
      "updatedAt": "2026-10-17T02:39:22.878Z"
    }
  ],
  "designSnapshots": [],
  "reviewResults": [],
  "activityEvents": [
    {
      "type": "design_saved",
      "problemId": "url-shortener",
      "meta": {},
      "occurredAt": "2026-10-17T02:39:15.018Z"
    },
    {
      "type": "solution_viewed",
      "problemId": "url-shortener",
      "meta": {},
      "occurredAt": "2026-10-17T02:39:45.347Z"
    },
    {
      "type": "lesson_opened",
      "problemId": null,
      "meta": {
        "lessonId": "what-is-system-design/the-building-blocks"
      },
      "occurredAt": "2026-10-17T03:03:43.793Z"
    },
    {
      "type": "lesson_opened",
      "problemId": null,
      "meta": {
        "lessonId": "numbers-and-estimation/what-one-machine-can-do"
      },
      "occurredAt": "2026-10-17T03:29:47.213Z"
    },
    {
      "type": "lesson_opened",
      "problemId": null,
      "meta": {
        "lessonId": "what-is-system-design/what-system-design-means"
      },
      "occurredAt": "2026-10-17T04:43:54.401Z"
    },
    {
      "type": "lab_opened",
      "problemId": "chat-service",
      "meta": {
        "labId": "whatsapp"
      },
      "occurredAt": "2026-10-17T15:03:01.568Z"
    },
    {
      "type": "solution_viewed",
      "problemId": "tic-tac-toe",
      "meta": {},
      "occurredAt": "2026-10-18T02:17:15.177Z"
    },
    {
      "type": "lab_opened",
      "problemId": "url-shortener",
      "meta": {
        "labId": "bitly"
      },
      "occurredAt": "2026-10-18T02:18:41.476Z"
    },
    {
      "type": "lesson_opened",
      "problemId": null,
      "meta": {
        "lessonId": "object-oriented-basics/classes-and-objects"
      },
      "occurredAt": "2026-10-19T10:26:32.091Z"
    },
    {
      "type": "lesson_opened",
      "problemId": null,
      "meta": {
        "lessonId": "solid-principles/dry-kiss-yagni-demeter"
      },
      "occurredAt": "2026-10-19T10:47:05.047Z"
    }
  ],
  "dailyActivity": [
    {
      "day": "2026-10-17",
      "seconds": 480,
      "actions": 6
    },
    {
      "day": "2026-10-18",
      "seconds": 180,
      "actions": 2
    },
    {
      "day": "2026-10-19",
      "seconds": 480,
      "actions": 2
    }
  ],
  "srsCards": [],
  "srsLogs": [],
  "studioWorkspaces": [
    {
      "lab": "url-shortener",
      "revision": 1,
      "value": {
        "lesson": "",
        "topology": {
          "edges": [],
          "nodes": []
        },
        "configuration": {
          "rps": 10000,
          "writes": 100,
          "hitRate": 95,
          "duration": 60,
          "scenario": "cache",
          "analytics": "async",
          "instances": 6,
          "dbCapacity": 3000,
          "workerRate": 10000,
          "apiCapacity": 2000,
          "architecture": "baseline",
          "queueCapacity": 20000
        }
      },
      "updatedAt": "2026-10-16T15:27:56.839Z"
    },
    {
      "lab": "parking-lot",
      "revision": 2,
      "value": {
        "lesson": "",
        "source": "function createParkingLot({ spots, charge, clock, price }) {\n  const inventory = spots.map(s => ({ ...s, ticketId: null }));\n  const tickets = new Map(), inFlight = new Map();\n  let sequence = 0;\n  const fits = { MOTORCYCLE: ['MOTORCYCLE', 'CAR'], CAR: ['CAR'], TRUCK: ['TRUCK'] };\n  return {\n    async park(vehicle) {\n      const spot = inventory.find(s => !s.ticketId && fits[vehicle.type]?.includes(s.type));\n      if (!spot) return null;\n      // Claim synchronously before any await: atomic within this single event loop.\n      const ticket = { id: 'T' + (++sequence), spotId: spot.id, status: 'ACTIVE', enteredAt: clock() };\n      spot.ticketId = ticket.id;\n      tickets.set(ticket.id, ticket);\n      return { ...ticket };\n    },\n    async exit(ticketId) {\n      const ticket = tickets.get(ticketId);\n      if (!ticket) throw new Error('Unknown ticket');\n      if (ticket.status === 'CLOSED') return { ...ticket.receipt };\n      if (inFlight.has(ticketId)) return inFlight.get(ticketId);\n      const operation = (async () => {\n        if (ticket.quote === undefined) ticket.quote = price({ ...ticket }, clock());\n        ticket.paymentId ??= 'pay-' + ticket.id;\n        ticket.status = 'PAYMENT_PENDING';\n        let outcome;\n        try { outcome = await charge(ticket.paymentId, ticket.quote); }\n        catch { return { status: 'PENDING' }; }\n        if (outcome === 'UNKNOWN') return { status: 'PENDING' };\n        if (outcome !== 'CONFIRMED') return { status: 'FAILED' };\n        const spot = inventory.find(s => s.id === ticket.spotId);\n        if (spot.ticketId !== ticket.id) throw new Error('Spot ownership mismatch');\n        spot.ticketId = null;\n        ticket.status = 'CLOSED';\n        ticket.receipt = { status: 'CONFIRMED', ticketId: ticket.id, amount: ticket.quote };\n        return { ...ticket.receipt };\n      })();\n      inFlight.set(ticketId, operation);\n      try { return await operation; } finally { inFlight.delete(ticketId); }\n    },\n    snapshot() {\n      return { spots: inventory.map(s => ({ ...s })), tickets: [...tickets.values()].map(t => ({ ...t })) };\n    }\n  };\n}",
        "scenario": "race"
      },
      "updatedAt": "2026-10-19T17:00:56.750Z"
    }
  ],
  "studioAttempts": [
    {
      "id": "89fc4236-d88a-4fae-bded-6bf49f6348b8",
      "lab": "url-shortener",
      "value": {
        "report": {
          "kind": "hld",
          "checks": [
            {
              "name": "Durable redirect path",
              "pass": true,
              "detail": "Client reaches the API and the API reaches durable storage."
            },
            {
              "name": "API admission budget",
              "pass": true,
              "detail": "10,100 requests/s compete for 12,000 assumed API slots/s. Excess requests are rejected; the model does not queue them indefinitely."
            },
            {
              "name": "Database budget",
              "pass": true,
              "detail": "600 admitted misses + creates/s reach a 3,000 operations/s budget. Reads and writes share capacity proportionally in this model."
            },
            {
              "name": "Analytics failure isolation",
              "pass": true,
              "detail": "Analytics backlog or loss does not reduce otherwise successful redirects."
            },
            {
              "name": "Bounded analytics delivery",
              "pass": true,
              "detail": "6,00,000 events processed, 0 queued, 0 dropped during this run. A finite queue contains overload; it does not remove it."
            }
          ],
          "config": {
            "rps": 10000,
            "writes": 100,
            "hitRate": 95,
            "duration": 60,
            "scenario": "steady",
            "analytics": "async",
            "instances": 6,
            "dbCapacity": 3000,
            "workerRate": 10000,
            "apiCapacity": 2000,
            "architecture": "baseline",
            "queueCapacity": 20000
          },
          "frames": [
            {
              "backlog": 0,
              "creates": 0,
              "dropped": 0,
              "seconds": 0,
              "redirects": 0
            },
            {
              "backlog": 0,
              "creates": 1500,
              "dropped": 0,
              "seconds": 15,
              "redirects": 150000
            },
            {
              "backlog": 0,
              "creates": 3000,
              "dropped": 0,
              "seconds": 30,
              "redirects": 300000
            },
            {
              "backlog": 0,
              "creates": 4500,
              "dropped": 0,
              "seconds": 45,
              "redirects": 450000
            },
            {
              "backlog": 0,
              "creates": 6000,
              "dropped": 0,
              "seconds": 60,
              "redirects": 600000
            }
          ],
          "metrics": {
            "backlog": 0,
            "dropped": 0,
            "dbBudget": 3000,
            "dbDemand": 600,
            "apiBudget": 12000,
            "createRps": 100,
            "processed": 600000,
            "offeredRps": 10100,
            "cacheHitRps": 9500,
            "redirectRps": 10000,
            "rejectedRps": 0
          },
          "version": 1,
          "topology": {
            "edges": [
              [
                "Client",
                "API service"
              ],
              [
                "API service",
                "Database"
              ],
              [
                "API service",
                "Cache"
              ],
              [
                "API service",
                "Queue"
              ],
              [
                "Queue",
                "Worker"
              ]
            ],
            "nodes": [
              "Client",
              "API service",
              "Database",
              "Cache",
              "Queue",
              "Worker"
            ]
          }
        },
        "workspace": {
          "lesson": "",
          "topology": {
            "edges": [],
            "nodes": []
          },
          "configuration": {
            "rps": 10000,
            "writes": 100,
            "hitRate": 95,
            "duration": 60,
            "scenario": "steady",
            "analytics": "async",
            "instances": 6,
            "dbCapacity": 3000,
            "workerRate": 10000,
            "apiCapacity": 2000,
            "architecture": "baseline",
            "queueCapacity": 20000
          }
        }
      },
      "createdAt": "2026-10-16T15:08:21.906Z"
    },
    {
      "id": "cab7fa55-bc7d-4ab8-9441-66a2da0eb3dd",
      "lab": "url-shortener",
      "value": {
        "report": {
          "kind": "hld",
          "checks": [
            {
              "name": "Durable redirect path",
              "pass": true,
              "detail": "Client reaches the API and the API reaches durable storage."
            },
            {
              "name": "API admission budget",
              "pass": true,
              "detail": "10,100 requests/s compete for 12,000 assumed API slots/s. Excess requests are rejected; the model does not queue them indefinitely."
            },
            {
              "name": "Database budget",
              "pass": false,
              "detail": "10,100 admitted misses + creates/s reach a 3,000 operations/s budget. Reads and writes share capacity proportionally in this model."
            },
            {
              "name": "Analytics failure isolation",
              "pass": true,
              "detail": "Analytics backlog or loss does not reduce otherwise successful redirects."
            },
            {
              "name": "Bounded analytics delivery",
              "pass": true,
              "detail": "1,78,218 events processed, 0 queued, 0 dropped during this run. A finite queue contains overload; it does not remove it."
            }
          ],
          "config": {
            "rps": 10000,
            "writes": 100,
            "hitRate": 95,
            "duration": 60,
            "scenario": "cache",
            "analytics": "async",
            "instances": 6,
            "dbCapacity": 3000,
            "workerRate": 10000,
            "apiCapacity": 2000,
            "architecture": "baseline",
            "queueCapacity": 20000
          },
          "frames": [
            {
              "backlog": 0,
              "creates": 0,
              "dropped": 0,
              "seconds": 0,
              "redirects": 0
            },
            {
              "backlog": 0,
              "creates": 446,
              "dropped": 0,
              "seconds": 15,
              "redirects": 44554
            },
            {
              "backlog": 0,
              "creates": 891,
              "dropped": 0,
              "seconds": 30,
              "redirects": 89109
            },
            {
              "backlog": 0,
              "creates": 1337,
              "dropped": 0,
              "seconds": 45,
              "redirects": 133663
            },
            {
              "backlog": 0,
              "creates": 1782,
              "dropped": 0,
              "seconds": 60,
              "redirects": 178218
            }
          ],
          "metrics": {
            "backlog": 0,
            "dropped": 0,
            "dbBudget": 3000,
            "dbDemand": 10100,
            "apiBudget": 12000,
            "createRps": 29.7029702970297,
            "processed": 178217.82178217822,
            "offeredRps": 10100,
            "cacheHitRps": 0,
            "redirectRps": 2970.29702970297,
            "rejectedRps": 7100.000000000001
          },
          "version": 1,
          "topology": {
            "edges": [
              [
                "Client",
                "API service"
              ],
              [
                "API service",
                "Database"
              ],
              [
                "API service",
                "Cache"
              ],
              [
                "API service",
                "Queue"
              ],
              [
                "Queue",
                "Worker"
              ]
            ],
            "nodes": [
              "Client",
              "API service",
              "Database",
              "Cache",
              "Queue",
              "Worker"
            ]
          }
        },
        "workspace": {
          "lesson": "",
          "topology": {
            "edges": [],
            "nodes": []
          },
          "configuration": {
            "rps": 10000,
            "writes": 100,
            "hitRate": 95,
            "duration": 60,
            "scenario": "cache",
            "analytics": "async",
            "instances": 6,
            "dbCapacity": 3000,
            "workerRate": 10000,
            "apiCapacity": 2000,
            "architecture": "baseline",
            "queueCapacity": 20000
          }
        }
      },
      "createdAt": "2026-10-16T15:08:25.624Z"
    },
    {
      "id": "774a79f6-4550-4766-b96e-e5c9e99713d0",
      "lab": "parking-lot",
      "value": {
        "report": {
          "kind": "lld",
          "checks": [
            {
              "name": "Two arrivals, one spot",
              "pass": false,
              "detail": "Exactly one arrival must receive a ticket for the last spot."
            },
            {
              "name": "Vehicle compatibility",
              "pass": false,
              "detail": "A motorcycle may use the available car spot under this policy."
            },
            {
              "name": "Unknown payment and stable retry",
              "pass": false,
              "detail": "Unknown payment must remain pending and keep its spot occupied."
            },
            {
              "name": "Failed payment retains ownership",
              "pass": false,
              "detail": "Failed payment cannot release the spot or close the ticket."
            },
            {
              "name": "Concurrent and repeated exit",
              "pass": false,
              "detail": "One successful exit calls the gateway once and releases once."
            },
            {
              "name": "Unknown ticket changes nothing",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            }
          ],
          "frames": [
            {
              "test": "Two arrivals, one spot",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Two arrivals, one spot",
              "calls": 0,
              "label": "Concurrent arrivals settled",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T2"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                },
                {
                  "id": "T2",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Vehicle compatibility",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Vehicle compatibility",
              "calls": 0,
              "label": "Truck rejected; motorcycle arrival",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 1,
              "label": "Payment outcome unknown",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                }
              ]
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 1,
              "label": "Payment failed",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 3,
              "label": "Concurrent exits and later retry",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                }
              ]
            },
            {
              "test": "Unknown ticket changes nothing",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Unknown ticket changes nothing",
              "calls": 0,
              "label": "Unknown ticket rejected",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            }
          ],
          "metrics": {
            "total": 6,
            "passed": 1
          },
          "version": 1
        },
        "workspace": {
          "lesson": "",
          "source": "// Implement createParkingLot. This runnable starter has deliberate race and retry bugs.\n// Vehicle types: MOTORCYCLE fits MOTORCYCLE/CAR; CAR fits CAR; TRUCK fits TRUCK.\n// park(vehicle) -> ticket | null. exit(ticketId) -> receipt | {status:'PENDING'|'FAILED'}.\n// charge(paymentId, quote) -> 'CONFIRMED' | 'FAILED' | 'UNKNOWN'. Reuse payment identity.\n// snapshot() -> {spots: [{id,type,ticketId}], tickets: [{id,spotId,status,...}]}.\nfunction createParkingLot({ spots, charge, clock, price }) {\n  const inventory = spots.map(s => ({ ...s, ticketId: null }));\n  const tickets = new Map();\n  let sequence = 0;\n  return {\n    async park(vehicle) {\n      const spot = inventory.find(s => !s.ticketId && s.type === vehicle.type);\n      if (!spot) return null;\n      await Promise.resolve(); // Other arrivals can choose this same spot.\n      const ticket = { id: 'T' + (++sequence), spotId: spot.id, status: 'ACTIVE', enteredAt: clock() };\n      spot.ticketId = ticket.id;\n      tickets.set(ticket.id, ticket);\n      return { ...ticket };\n    },\n    async exit(ticketId) {\n      const ticket = tickets.get(ticketId);\n      if (!ticket) throw new Error('Unknown ticket');\n      const paymentId = ticket.id + '-' + clock(); // Unstable retry identity.\n      const outcome = await charge(paymentId, price(ticket, clock()));\n      inventory.find(s => s.id === ticket.spotId).ticketId = null;\n      ticket.status = 'CLOSED';\n      return { status: outcome, ticketId };\n    },\n    snapshot() { return { spots: inventory.map(s => ({...s})), tickets: [...tickets.values()].map(t => ({...t})) }; }\n  };\n}",
          "scenario": "all"
        }
      },
      "createdAt": "2026-10-16T15:09:02.718Z"
    },
    {
      "id": "cfc9b865-3fcf-40d1-bf80-73caea76a08f",
      "lab": "parking-lot",
      "value": {
        "report": {
          "kind": "lld",
          "checks": [
            {
              "name": "Two arrivals, one spot",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Vehicle compatibility",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Unknown payment and stable retry",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Failed payment retains ownership",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Concurrent and repeated exit",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Unknown ticket changes nothing",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            }
          ],
          "frames": [
            {
              "test": "Two arrivals, one spot",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Two arrivals, one spot",
              "calls": 0,
              "label": "Concurrent arrivals settled",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Vehicle compatibility",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Vehicle compatibility",
              "calls": 0,
              "label": "Truck rejected; motorcycle arrival",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 1,
              "label": "Payment outcome unknown",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "PAYMENT_PENDING"
                }
              ]
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 2,
              "label": "Same payment reconciled",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                }
              ]
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 1,
              "label": "Payment failed",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "PAYMENT_PENDING"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 1,
              "label": "Concurrent exits and later retry",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 1,
              "label": "Old ticket retried after spot reuse",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T2"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                },
                {
                  "id": "T2",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Unknown ticket changes nothing",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Unknown ticket changes nothing",
              "calls": 0,
              "label": "Unknown ticket rejected",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            }
          ],
          "metrics": {
            "total": 6,
            "passed": 6
          },
          "version": 1
        },
        "workspace": {
          "lesson": "",
          "source": "function createParkingLot({ spots, charge, clock, price }) {\n  const inventory = spots.map(s => ({ ...s, ticketId: null }));\n  const tickets = new Map(), inFlight = new Map();\n  let sequence = 0;\n  const fits = { MOTORCYCLE: ['MOTORCYCLE', 'CAR'], CAR: ['CAR'], TRUCK: ['TRUCK'] };\n  return {\n    async park(vehicle) {\n      const spot = inventory.find(s => !s.ticketId && fits[vehicle.type]?.includes(s.type));\n      if (!spot) return null;\n      // Claim synchronously before any await: atomic within this single event loop.\n      const ticket = { id: 'T' + (++sequence), spotId: spot.id, status: 'ACTIVE', enteredAt: clock() };\n      spot.ticketId = ticket.id;\n      tickets.set(ticket.id, ticket);\n      return { ...ticket };\n    },\n    async exit(ticketId) {\n      const ticket = tickets.get(ticketId);\n      if (!ticket) throw new Error('Unknown ticket');\n      if (ticket.status === 'CLOSED') return { ...ticket.receipt };\n      if (inFlight.has(ticketId)) return inFlight.get(ticketId);\n      const operation = (async () => {\n        if (ticket.quote === undefined) ticket.quote = price({ ...ticket }, clock());\n        ticket.paymentId ??= 'pay-' + ticket.id;\n        ticket.status = 'PAYMENT_PENDING';\n        let outcome;\n        try { outcome = await charge(ticket.paymentId, ticket.quote); }\n        catch { return { status: 'PENDING' }; }\n        if (outcome === 'UNKNOWN') return { status: 'PENDING' };\n        if (outcome !== 'CONFIRMED') return { status: 'FAILED' };\n        const spot = inventory.find(s => s.id === ticket.spotId);\n        if (spot.ticketId !== ticket.id) throw new Error('Spot ownership mismatch');\n        spot.ticketId = null;\n        ticket.status = 'CLOSED';\n        ticket.receipt = { status: 'CONFIRMED', ticketId: ticket.id, amount: ticket.quote };\n        return { ...ticket.receipt };\n      })();\n      inFlight.set(ticketId, operation);\n      try { return await operation; } finally { inFlight.delete(ticketId); }\n    },\n    snapshot() {\n      return { spots: inventory.map(s => ({ ...s })), tickets: [...tickets.values()].map(t => ({ ...t })) };\n    }\n  };\n}",
          "scenario": "all"
        }
      },
      "createdAt": "2026-10-16T15:09:10.060Z"
    },
    {
      "id": "08d02f32-9a5c-411c-bdbc-4ac0e309a3ba",
      "lab": "parking-lot",
      "value": {
        "report": {
          "kind": "lld",
          "checks": [
            {
              "name": "Two arrivals, one spot",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Vehicle compatibility",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Unknown payment and stable retry",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Failed payment retains ownership",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Concurrent and repeated exit",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            },
            {
              "name": "Unknown ticket changes nothing",
              "pass": true,
              "detail": "Observed behavior satisfies this scenario’s contract."
            }
          ],
          "frames": [
            {
              "test": "Two arrivals, one spot",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Two arrivals, one spot",
              "calls": 0,
              "label": "Concurrent arrivals settled",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Vehicle compatibility",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Vehicle compatibility",
              "calls": 0,
              "label": "Truck rejected; motorcycle arrival",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 1,
              "label": "Payment outcome unknown",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "PAYMENT_PENDING"
                }
              ]
            },
            {
              "test": "Unknown payment and stable retry",
              "calls": 2,
              "label": "Same payment reconciled",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                }
              ]
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Failed payment retains ownership",
              "calls": 1,
              "label": "Payment failed",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "PAYMENT_PENDING"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 0,
              "label": "Ticket issued",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T1"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 1,
              "label": "Concurrent exits and later retry",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                }
              ]
            },
            {
              "test": "Concurrent and repeated exit",
              "calls": 1,
              "label": "Old ticket retried after spot reuse",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": "T2"
                }
              ],
              "tickets": [
                {
                  "id": "T1",
                  "spotId": "C1",
                  "status": "CLOSED"
                },
                {
                  "id": "T2",
                  "spotId": "C1",
                  "status": "ACTIVE"
                }
              ]
            },
            {
              "test": "Unknown ticket changes nothing",
              "calls": 0,
              "label": "Empty lot",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            },
            {
              "test": "Unknown ticket changes nothing",
              "calls": 0,
              "label": "Unknown ticket rejected",
              "spots": [
                {
                  "id": "C1",
                  "type": "CAR",
                  "ticketId": null
                }
              ],
              "tickets": []
            }
          ],
          "metrics": {
            "total": 6,
            "passed": 6
          },
          "version": 1
        },
        "workspace": {
          "lesson": "",
          "source": "function createParkingLot({ spots, charge, clock, price }) {\n  const inventory = spots.map(s => ({ ...s, ticketId: null }));\n  const tickets = new Map(), inFlight = new Map();\n  let sequence = 0;\n  const fits = { MOTORCYCLE: ['MOTORCYCLE', 'CAR'], CAR: ['CAR'], TRUCK: ['TRUCK'] };\n  return {\n    async park(vehicle) {\n      const spot = inventory.find(s => !s.ticketId && fits[vehicle.type]?.includes(s.type));\n      if (!spot) return null;\n      // Claim synchronously before any await: atomic within this single event loop.\n      const ticket = { id: 'T' + (++sequence), spotId: spot.id, status: 'ACTIVE', enteredAt: clock() };\n      spot.ticketId = ticket.id;\n      tickets.set(ticket.id, ticket);\n      return { ...ticket };\n    },\n    async exit(ticketId) {\n      const ticket = tickets.get(ticketId);\n      if (!ticket) throw new Error('Unknown ticket');\n      if (ticket.status === 'CLOSED') return { ...ticket.receipt };\n      if (inFlight.has(ticketId)) return inFlight.get(ticketId);\n      const operation = (async () => {\n        if (ticket.quote === undefined) ticket.quote = price({ ...ticket }, clock());\n        ticket.paymentId ??= 'pay-' + ticket.id;\n        ticket.status = 'PAYMENT_PENDING';\n        let outcome;\n        try { outcome = await charge(ticket.paymentId, ticket.quote); }\n        catch { return { status: 'PENDING' }; }\n        if (outcome === 'UNKNOWN') return { status: 'PENDING' };\n        if (outcome !== 'CONFIRMED') return { status: 'FAILED' };\n        const spot = inventory.find(s => s.id === ticket.spotId);\n        if (spot.ticketId !== ticket.id) throw new Error('Spot ownership mismatch');\n        spot.ticketId = null;\n        ticket.status = 'CLOSED';\n        ticket.receipt = { status: 'CONFIRMED', ticketId: ticket.id, amount: ticket.quote };\n        return { ...ticket.receipt };\n      })();\n      inFlight.set(ticketId, operation);\n      try { return await operation; } finally { inFlight.delete(ticketId); }\n    },\n    snapshot() {\n      return { spots: inventory.map(s => ({ ...s })), tickets: [...tickets.values()].map(t => ({ ...t })) };\n    }\n  };\n}",
          "scenario": "all"
        }
      },
      "createdAt": "2026-10-16T15:13:13.764Z"
    },
    {
      "id": "2919f91f-9131-4616-b707-a158565fc28b",
      "lab": "url-shortener",
      "value": {
        "report": {
          "kind": "hld",
          "checks": [
            {
              "name": "Durable redirect path",
              "pass": true,
              "detail": "Client reaches the API and the API reaches durable storage."
            },
            {
              "name": "API admission budget",
              "pass": true,
              "detail": "10,100 requests/s compete for 12,000 assumed API slots/s. Excess requests are rejected; the model does not queue them indefinitely."
            },
            {
              "name": "Database budget",
              "pass": false,
              "detail": "10,100 admitted misses + creates/s reach a 3,000 operations/s budget. Reads and writes share capacity proportionally in this model."
            },
            {
              "name": "Analytics failure isolation",
              "pass": true,
              "detail": "Analytics backlog or loss does not reduce otherwise successful redirects."
            },
            {
              "name": "Bounded analytics delivery",
              "pass": true,
              "detail": "1,78,218 events processed, 0 queued, 0 dropped during this run. A finite queue contains overload; it does not remove it."
            }
          ],
          "config": {
            "rps": 10000,
            "writes": 100,
            "hitRate": 95,
            "duration": 60,
            "scenario": "cache",
            "analytics": "async",
            "instances": 6,
            "dbCapacity": 3000,
            "workerRate": 10000,
            "apiCapacity": 2000,
            "architecture": "baseline",
            "queueCapacity": 20000
          },
          "frames": [
            {
              "backlog": 0,
              "creates": 0,
              "dropped": 0,
              "seconds": 0,
              "redirects": 0
            },
            {
              "backlog": 0,
              "creates": 446,
              "dropped": 0,
              "seconds": 15,
              "redirects": 44554
            },
            {
              "backlog": 0,
              "creates": 891,
              "dropped": 0,
              "seconds": 30,
              "redirects": 89109
            },
            {
              "backlog": 0,
              "creates": 1337,
              "dropped": 0,
              "seconds": 45,
              "redirects": 133663
            },
            {
              "backlog": 0,
              "creates": 1782,
              "dropped": 0,
              "seconds": 60,
              "redirects": 178218
            }
          ],
          "metrics": {
            "backlog": 0,
            "dropped": 0,
            "dbBudget": 3000,
            "dbDemand": 10100,
            "apiBudget": 12000,
            "createRps": 29.7029702970297,
            "processed": 178217.82178217822,
            "offeredRps": 10100,
            "cacheHitRps": 0,
            "redirectRps": 2970.29702970297,
            "rejectedRps": 7100.000000000001
          },
          "version": 1,
          "topology": {
            "edges": [
              [
                "Client",
                "API service"
              ],
              [
                "API service",
                "Database"
              ],
              [
                "API service",
                "Cache"
              ],
              [
                "API service",
                "Queue"
              ],
              [
                "Queue",
                "Worker"
              ]
            ],
            "nodes": [
              "Client",
              "API service",
              "Database",
              "Cache",
              "Queue",
              "Worker"
            ]
          }
        },
        "workspace": {
          "lesson": "",
          "topology": {
            "edges": [],
            "nodes": []
          },
          "configuration": {
            "rps": 10000,
            "writes": 100,
            "hitRate": 95,
            "duration": 60,
            "scenario": "cache",
            "analytics": "async",
            "instances": 6,
            "dbCapacity": 3000,
            "workerRate": 10000,
            "apiCapacity": 2000,
            "architecture": "baseline",
            "queueCapacity": 20000
          }
        }
      },
      "createdAt": "2026-10-16T15:27:56.839Z"
    }
  ],
  "interviewSessions": [],
  "lessonProgress": [
    {
      "lessonId": "what-is-system-design/the-building-blocks",
      "status": "in_progress",
      "startedAt": "2026-10-17T03:03:34.686Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-17T03:26:50.804Z",
      "timeSpentSec": 120,
      "quizCorrect": null,
      "quizTotal": null,
      "notes": "",
      "updatedAt": "2026-10-17T03:03:43.793Z"
    },
    {
      "lessonId": "numbers-and-estimation/what-one-machine-can-do",
      "status": "in_progress",
      "startedAt": "2026-10-17T03:29:38.029Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-17T03:29:38.483Z",
      "timeSpentSec": 120,
      "quizCorrect": null,
      "quizTotal": null,
      "notes": "",
      "updatedAt": "2026-10-17T03:29:47.213Z"
    },
    {
      "lessonId": "what-is-system-design/what-system-design-means",
      "status": "in_progress",
      "startedAt": "2026-10-17T04:43:44.902Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-19T07:16:10.496Z",
      "timeSpentSec": 0,
      "quizCorrect": null,
      "quizTotal": null,
      "notes": "",
      "updatedAt": "2026-10-17T04:43:54.401Z"
    },
    {
      "lessonId": "solid-principles/dry-kiss-yagni-demeter",
      "status": "in_progress",
      "startedAt": "2026-10-19T10:46:51.070Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-19T10:46:51.501Z",
      "timeSpentSec": 0,
      "quizCorrect": null,
      "quizTotal": null,
      "notes": "",
      "updatedAt": "2026-10-19T10:47:05.047Z"
    },
    {
      "lessonId": "object-oriented-basics/classes-and-objects",
      "status": "in_progress",
      "startedAt": "2026-10-19T10:26:18.173Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-19T17:00:25.952Z",
      "timeSpentSec": 0,
      "quizCorrect": null,
      "quizTotal": null,
      "notes": "",
      "updatedAt": "2026-10-19T10:26:32.091Z"
    }
  ],
  "simRuns": [],
  "labProgress": [
    {
      "labId": "whatsapp",
      "status": "in_progress",
      "startedAt": "2026-10-17T15:02:51.408Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-17T15:02:51.949Z",
      "steps": {},
      "updatedAt": "2026-10-17T15:03:01.568Z"
    },
    {
      "labId": "bitly",
      "status": "in_progress",
      "startedAt": "2026-10-18T02:18:31.114Z",
      "completedAt": null,
      "lastOpenedAt": "2026-10-18T02:18:31.562Z",
      "steps": {},
      "updatedAt": "2026-10-18T02:18:41.476Z"
    }
  ],
  "aiFeedback": []
}