Design a CI Scheduler Triggered by GitHub That Matches Jobs to CPU and GPU Workers

Quick Overview

A system design question: design a CI scheduling system that starts builds from GitHub events, matches each job to a suitable CPU or GPU worker, and stays usable at peak when workers run short. It tests event ingestion, job queues and leases, resource-aware dispatch, prioritization, fairness and autoscaling.

Design a CI Scheduler Triggered by GitHub That Matches Jobs to CPU and GPU Workers

Company: LinkedIn

Role: Software Engineer

Category: System Design

Difficulty: medium

Interview Round: Onsite

Design a CI scheduling system. Builds are triggered from GitHub, for example by pushes and pull requests. The system must find a suitable worker for each piece of work, since some jobs need CPU machines and others need GPUs, and it must cope with peak periods when there are not enough workers for everything that is queued. Assume a build is defined by a pipeline file in the repository and is split into jobs that can run on different workers; confirm this with the interviewer. ### Clarifying Questions - How many builds arrive per hour at peak, how many jobs does a build have, and how long does a job run? - Are the workers a fixed fleet, cloud machines that can be added on demand, or both? How many GPU machines exist, and of which kinds? - Which builds matter most: the main branch, releases, pull requests, scheduled runs? - Must results appear on GitHub as status checks, and must logs stream live? ### Part 1 — From a GitHub event to queued jobs Describe how a push or pull request event becomes a build and a set of jobs that are ready to run. ```hint Repeats and gaps GitHub can deliver the same event more than once, or not at all. Ask what makes creating a build safe to repeat, and what recovers a missed event. ``` #### What This Part Should Cover - Webhook verification, deduplication and durable intake - Expanding the pipeline into dependent jobs, and the job lifecycle - Handling builds made obsolete by a newer push, and missed events ### Part 2 — Matching jobs to CPU and GPU workers Explain how the scheduler finds a suitable worker for each ready job, and how it learns that the job finished or that its worker died. ```hint Who asks whom Decide whether the scheduler pushes jobs to workers or workers ask for work, and what each worker must report about itself. ``` #### What This Part Should Cover - Matching job requirements to worker capabilities - Handing a job to exactly one worker, and detecting dead workers - Keeping scarce GPU machines for GPU work ### Part 3 — Peak periods with too few workers At peak, queued jobs exceed the available workers. What does the system do? ```hint Levers List the levers you have: who waits, which pools can grow and how quickly, and which queued work is no longer needed. ``` #### What This Part Should Cover - Autoscaling per worker pool, and its limits for GPUs - Priority and fairness between builds and teams - Reducing demand, and keeping developers informed while they wait ### What a Strong Answer Covers - Requirements and rough load estimates before the design - A reliable path from webhook to jobs, with deduplication and reconciliation - Resource-aware dispatch with leases, heartbeats and safe retries - A concrete plan for shortages that combines scaling, prioritization, fairness and demand reduction - Status reporting to GitHub, failure handling, and the metrics that show queue health ### Follow-up Questions - A GPU job keeps waiting while GPU machines are busy with CPU-only jobs. How do you prevent that? - A developer pushes to the same pull request several times within a minute. What should the scheduler do? - One team's large repository floods the queue at peak. How do you stay fair to other teams? - A worker crashes in the middle of a job. How does the system find out, and is it safe to run the job again?

Overview: A system design question: design a CI scheduling system that starts builds from GitHub events, matches each job to a suitable CPU or GPU worker, and stays usable at peak when workers run short. It tests event ingestion, job queues and leases, resource-aware dispatch, prioritization, fairness and autoscaling.

Read the full LinkedIn Software Engineer interview experience this question came from

LinkedIn logo
LinkedIn
Nov 15, 2026
mediumSoftware EngineerOnsiteSystem Design
0
0

Design a CI scheduling system. Builds are triggered from GitHub, for example by pushes and pull requests. The system must find a suitable worker for each piece of work, since some jobs need CPU machines and others need GPUs, and it must cope with peak periods when there are not enough workers for everything that is queued. Assume a build is defined by a pipeline file in the repository and is split into jobs that can run on different workers; confirm this with the interviewer.

Clarifying Questions Guidance

  • How many builds arrive per hour at peak, how many jobs does a build have, and how long does a job run?
  • Are the workers a fixed fleet, cloud machines that can be added on demand, or both? How many GPU machines exist, and of which kinds?
  • Which builds matter most: the main branch, releases, pull requests, scheduled runs?
  • Must results appear on GitHub as status checks, and must logs stream live?

Part 1 — From a GitHub event to queued jobs

Describe how a push or pull request event becomes a build and a set of jobs that are ready to run.

What This Part Should Cover Guidance

  • Webhook verification, deduplication and durable intake
  • Expanding the pipeline into dependent jobs, and the job lifecycle
  • Handling builds made obsolete by a newer push, and missed events

Part 2 — Matching jobs to CPU and GPU workers

Explain how the scheduler finds a suitable worker for each ready job, and how it learns that the job finished or that its worker died.

What This Part Should Cover Guidance

  • Matching job requirements to worker capabilities
  • Handing a job to exactly one worker, and detecting dead workers
  • Keeping scarce GPU machines for GPU work

Part 3 — Peak periods with too few workers

At peak, queued jobs exceed the available workers. What does the system do?

What This Part Should Cover Guidance

  • Autoscaling per worker pool, and its limits for GPUs
  • Priority and fairness between builds and teams
  • Reducing demand, and keeping developers informed while they wait

What a Strong Answer Covers Guidance

  • Requirements and rough load estimates before the design
  • A reliable path from webhook to jobs, with deduplication and reconciliation
  • Resource-aware dispatch with leases, heartbeats and safe retries
  • A concrete plan for shortages that combines scaling, prioritization, fairness and demand reduction
  • Status reporting to GitHub, failure handling, and the metrics that show queue health

Follow-up Questions Guidance

  • A GPU job keeps waiting while GPU machines are busy with CPU-only jobs. How do you prevent that?
  • A developer pushes to the same pull request several times within a minute. What should the scheduler do?
  • One team's large repository floods the queue at peak. How do you stay fair to other teams?
  • A worker crashes in the middle of a job. How does the system find out, and is it safe to run the job again?