Project Workshop — Advanced System Designs Doc
This is a portfolio submission, not a copy-and-run tutorial. A reviewer must be able to clone it, configure it without guessing, execute the critical path, observe a deliberate failure, run the tests, and understand the most important…
- What you are building
- Architecture
- Acceptance criteria
- Suggested repository structure
- Build plan: vertical slices
Architecture · Distributed Systems
Expected effort: 10–16 focused hours · Minimum meaningful tests: 12What you are building
This is a portfolio submission, not a copy-and-run tutorial. A reviewer must be able to clone it, configure it without guessing, execute the critical path, observe a deliberate failure, run the tests, and understand the most important design decision from the README.
Architecture
Critical interaction
Ownership table
| Boundary | Owns | Must not own |
|---|---|---|
| Interface | Parsing, protocol validation, identity extraction, status or presentation mapping | Core business invariants |
| Application/domain | Authorization inputs, state transitions, orchestration, transaction intent | Framework globals or raw transport objects |
| Repository/gateway | One persistence or external protocol, bounded retries, error translation | Product policy |
| Background/UI projection | Recoverable derived state and delivery progress | Hidden authoritative truth |
| Operations | Configuration, health, deployment, telemetry, recovery | Business decisions encoded only in dashboards |
Acceptance criteria
| ID | Required behavior | Evidence |
|---|---|---|
| AC-1.1 | DDD: bounded contexts/aggregates/entities produces the specified behavior inside Service decomposition & communication | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.2 | strangler fig pattern for monolith migration produces the specified behavior inside Service decomposition & communication | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.3 | database-per-service + data consistency challenges produces the specified behavior inside Service decomposition & communication | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.4 | REST vs gRPC (protobuf, all streaming types) vs GraphQL produces the specified behavior inside Service decomposition & communication | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-1.5 | async via Kafka + service discovery produces the specified behavior inside Service decomposition & communication | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.1 | Istio: Envoy sidecar, mTLS between services produces the specified behavior inside Service mesh & event sourcing | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.2 | traffic management: canary/circuit breaker/retries produces the specified behavior inside Service mesh & event sourcing | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.3 | event store design + projections (read models) produces the specified behavior inside Service mesh & event sourcing | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-2.4 | snapshots for long event histories produces the specified behavior inside Service mesh & event sourcing | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.1 | Instagram: media upload/feed generation/follow graph produces the specified behavior inside 5 advanced system designs | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.2 | Uber: real-time location/matching/surge pricing produces the specified behavior inside 5 advanced system designs | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.3 | YouTube: upload pipeline/transcoding/streaming produces the specified behavior inside 5 advanced system designs | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.4 | Distributed Cache (Redis-like from scratch) produces the specified behavior inside 5 advanced system designs | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-3.5 | Search autocomplete (trie/prefix tree at scale) produces the specified behavior inside 5 advanced system designs | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.1 | gRPC unary/client-stream/server-stream/bidirectional-stream produces the specified behavior inside Communication details | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.2 | async request-reply with correlation ID and timeout produces the specified behavior inside Communication details | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.3 | schema/version compatibility across services produces the specified behavior inside Communication details | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
| AC-4.4 | service discovery health and stale endpoint handling produces the specified behavior inside Communication details | Automated assertion, reproducible command, plan, trace, metric, or accessible browser check |
Suggested repository structure
1portfolio/2├── README.md3├── requirements-and-estimates.md4├── designs/5├── algorithms/6├── failure-analysis/7├── tests-and-benchmarks/8└── interview-talk-track.mdBuild plan: vertical slices
| Milestone | Capability | First implementation | Exit condition |
|---|---|---|---|
| 1 | Service decomposition & communication | DDD: bounded contexts/aggregates/entities; strangler fig pattern for monolith migration; database-per-service + data consistency challenges | Demonstration plus focused tests |
| 2 | Service mesh & event sourcing | Istio: Envoy sidecar, mTLS between services; traffic management: canary/circuit breaker/retries; event store design + projections (read models) | Demonstration plus focused tests |
| 3 | 5 advanced system designs | Instagram: media upload/feed generation/follow graph; Uber: real-time location/matching/surge pricing; YouTube: upload pipeline/transcoding/streaming | Demonstration plus focused tests |
| 4 | Communication details | gRPC unary/client-stream/server-stream/bidirectional-stream; async request-reply with correlation ID and timeout; schema/version compatibility across services | Demonstration plus focused tests |
| 5 | Hardening and delivery | Security, recovery, telemetry, performance, documentation | Full acceptance suite and recorded demonstration |
For each milestone, first create a failing acceptance test or a reproducible command. Implement the thinnest path to an observable result, add the nearest durable invariant, inject one expected failure, and refactor only after evidence protects the behavior.
Reference vertical slice
1syntax = "proto3";2package profile.v1;3
4service ProfileService {5 rpc GetProfile(GetProfileRequest) returns (Profile);6 rpc WatchPresence(WatchPresenceRequest) returns (stream PresenceEvent);7}8
9message GetProfileRequest { string user_id = 1; }10message Profile { string user_id = 1; string display_name = 2; uint64 version = 3; }11message WatchPresenceRequest { repeated string user_ids = 1; }12message PresenceEvent { string user_id = 1; string state = 2; int64 observed_at_ms = 3; }Expected result
1A unary read and server-streaming presence contract are versioned independently of storage models.Code reading
| Line | Code | Explanation |
|---|---|---|
| 1 | syntax = "proto3"; | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 2 | package profile.v1; | Implements the next protobuf statement in the example's data flow. |
| 4 | service ProfileService { | Implements the next protobuf statement in the example's data flow. |
| 5 | rpc GetProfile(GetProfileRequest) returns (Profile); | Implements the next protobuf statement in the example's data flow. |
| 6 | rpc WatchPresence(WatchPresenceRequest) returns (stream PresenceEvent); | Implements the next protobuf statement in the example's data flow. |
| 7 | } | Implements the next protobuf statement in the example's data flow. |
| 9 | message GetProfileRequest { string user_id = 1; } | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 10 | message Profile { string user_id = 1; string display_name = 2; uint64 version = 3; } | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 11 | message WatchPresenceRequest { repeated string user_ids = 1; } | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
| 12 | message PresenceEvent { string user_id = 1; string state = 2; int64 observed_at_ms = 3; } | Computes or receives a value and binds it for the next step; the referenced object remains separate from the name. |
Risk register
| Area | Failure to reproduce | Required design response |
|---|---|---|
| Service decomposition & communication | A bounded context is not GraphQL context, database-per-service is not React Server Component composition, and gRPC streaming is not an LLM response stream. | Split by business capability, keep authoritative writes with their invariants, evolve schemas compatibly, and migrate monolith capabilities incrementally with a strangler path. |
| Service mesh & event sourcing | mTLS is not Kubernetes ingress TLS, automatic retries can duplicate side effects, and a snapshot without later events is not authoritative state. | Keep business retries and idempotency in application contracts, version events, make projection rebuilds repeatable, and measure mesh overhead. |
| 5 advanced system designs | YouTube streaming is media delivery rather than an LLM stream; average throughput hides celebrity, viral, and geographic hotspots. | Estimate skew and bandwidth, identify authoritative state, define hot-key handling, and explain regional failure and recovery paths. |
| Communication details | A shared database preserves hidden coupling and distributed chatty calls create a network monolith. | Split by business ownership and independent change, not by technical layer. |
Engineering checklist for this stack
- To do: begin from requirements and quantitative SLOs
- To do: assign one owner to authoritative state
- To do: make consistency and ordering scope explicit
- To do: design degraded behavior and reconciliation
- To do: record decisions and migration boundaries
Test strategy
Implement at least 12 meaningful cases. A long list of shallow happy-path tests does not satisfy the requirement.
| Risk class | Minimum | Examples |
|---|---|---|
| Happy path and contract | 2 | Correct output, status/schema, durable state |
| Validation and boundaries | 2 | Empty, malformed, extreme, unsupported transition |
| Authorization or trust boundary | 1 | Missing identity, wrong tenant/role, injection or unsafe content |
| Failure and recovery | 2 | Timeout, retry, rollback, reconnect, dependency outage |
| Duplicate or concurrency | 1 | Same identity twice, racing update, redelivery |
| Performance and operations | 4 | Query bound, lag, p95, resource limit, telemetry |
Representative test scaffold
1Scenario: broker unavailable for 10 minutes2Given: writes remain valid in the source-of-truth transaction3When: the publisher cannot deliver outbox rows4Then: backlog age grows, an alert fires, retries use jitter, and recovery publishes each event at least once5Invariant: no committed aggregate is missing a durable outbox recordFailure drills
- Stop the primary external dependency during the critical path. Capture the failure, cleanup, telemetry, and recovery.
- Repeat the same operation with the same stable identity. Prove one logical outcome or document why repetition is forbidden.
- Crash after durable state changes but before the response, acknowledgement, or projection. Re-run and reconcile.
- Submit the largest supported input and one slightly larger input.
- Remove one permission and prove denial without state change or information leakage.
- Roll back the change or restore the dependency, then run a smoke test and reconciliation check.
Performance experiment
State the dataset, payload distribution, concurrency, rate, duration, cache state, and resource limits before measuring. Publish p50, p95, p99, throughput, error rate, and the technology-specific correctness signal such as query count, consumer lag, duplicate effects, rendered updates, token cost, or recall. Change one variable at a time and retain raw output.
Submission package
- Complete source with a locked/reproducible environment.
- README.md with problem, architecture, setup, commands, configuration, assumptions, and trade-offs.
- Acceptance and risk-focused tests with a short explanation of what mocks intentionally do not cover.
- One design record explaining the most consequential choice and a rejected alternative.
- Security notes, sample non-secret configuration, and cleanup commands.
- A demonstration record: terminal transcript, screenshots, trace, query plan, or metrics dashboard.
- A 5–8 minute walkthrough following input → validation → state → failure → evidence.
Grading rubric
| Dimension | Weight | Full-credit evidence |
|---|---|---|
| Product behavior | 25 | Acceptance criteria pass through real public boundaries |
| Architecture and ownership | 20 | Responsibilities and state authority are explicit |
| Tests and recovery | 20 | Important negative, duplicate, concurrent, and outage cases pass |
| Security and data correctness | 15 | Least privilege, validation, constraints, and secret handling are demonstrated |
| Performance and operations | 10 | Reproducible measurement, useful telemetry, and rollback/recovery |
| Documentation and explanation | 10 | A new reviewer can reproduce and defend the result |
Mastery check
How well can you recall this?
Finished this lesson?