System design · 6 of 16
Mid
Senior
- Monitoring and alerting for 100 servicesSRE · Platform · DevOps
- Secrets management platformDevOps · Platform · SRE
- Multi-region active-active serviceSRE · Platform
- Distributed job scheduler (cron at scale)SRE · Platform
- Internal developer platform (IDP)Platform
- Multi-tenant Kubernetes platformPlatform · DevOps · SRE
- GitOps for a fleet of 100 clustersPlatform · DevOps
- ML training platform and feature storeMLOps · Platform
- LLM inference platformMLOps · Platform · SRE
MID · 13 MIN · DEVOPS · PLATFORM
CI/CD platform for 500 microservices
Shared pipelines, autoscaling runners, caching, security scans, an artifact registry and GitOps deploys across environments.
- Peak load
- ~60 concurrent jobs
- Availability target
- 99.9%
- RTO: back up within
- 1 hour
- RPO: data you can lose
- 15 min
← Swipe sideways to see the whole diagram →
The question
"Design a CI/CD system for 300 engineers and 500 microservices. Builds should be fast, safe and the same for every team."
Requirements
- Every merge request: build, test, scan; every merge to main: deploy to dev, then staging, then prod with approval.
- Pipelines finish in under 10 minutes for most services.
- One standard pipeline, so security and compliance are built in.
- Cost under control: no idle build machines at night.
Quick numbers
| Item | Assumption | Result |
|---|---|---|
| Pipelines | 300 engineers × 10 pushes a day | ~3,000 pipelines a day, peaks ~10 per minute |
| Jobs per pipeline | ~6 | ~60 concurrent jobs at peak |
| Runner size | 2 vCPU, 4 GB per job | ~120 vCPU at peak, near 0 at night |
How it works
- A push or merge request triggers a webhook to the CI orchestrator (GitLab CI or GitHub Actions).
- Jobs run on autoscaling runners: Kubernetes pods or spot VMs that appear when jobs queue and disappear after.
- Each service includes a shared, versioned pipeline template (GitLab CI components or reusable workflows): build, unit test, SAST, dependency scan, image build, image scan.
- Builds use a remote cache (dependency cache, Docker layer cache, build tool cache) so most builds don't start from zero.
- The image is pushed to the artifact registry, tagged with the commit SHA and signed.
- The pipeline updates the image tag in a GitOps repo; Argo CD syncs dev automatically, then staging, then prod after approval and checks.
Key decisions
| Decision | Choice | Why |
|---|---|---|
| Standard pipeline | versioned templates teams include | one place to improve speed and security |
| Runners | ephemeral, autoscaled | clean every time, no cost when idle |
| Speed | caches + only test what changed | most pipelines under 10 minutes |
| Deploy | GitOps (pull) instead of CI pushing to clusters | clusters don't trust CI with admin keys; Git is the audit log |
| Secrets | OIDC from CI to cloud, no long-lived keys | nothing to leak |
What breaks and how it heals
- Queue piles up: autoscaler limits and alerts on queue time; priority for main-branch and hotfix pipelines.
- Flaky tests: track flaky tests automatically and quarantine them, so people stop re-running pipelines.
- Bad template change: release templates with versions and roll out to a few teams first.
High availability and disaster recovery
| Target | Number | How it is met |
|---|---|---|
| Availability | 99.9% during work hours (internal tool) | stateless orchestrator replicas, autoscaled runners, HA database |
| Runner node dies | job retried | ephemeral runners; jobs are idempotent and retried once automatically |
| Git server fails | RTO 1 hour, RPO 15 minutes | a replica in a second region (for example GitLab Geo) plus hourly database backups |
| CI fully down during an incident | hotfix still possible | a documented, audited break-glass deploy path |
| Pipeline queue time | under 2 minutes at the 95th percentile | autoscaler adds runners when jobs wait; alerts if queue time grows |
What interviewers listen for
- Standardization through templates, with escape hatches.
- Concrete speed tactics (caching, parallel jobs, change detection).
- Supply-chain security: scans, signing, OIDC, and promotion between environments.