# Design an AI coding assistant like GitHub Copilot: system design interview question

> Code completions need relevant repository context, fast responses, and strict protection for private source code.

Source: https://sysround.com/questions/design-ai-coding-assistant-like-github-copilot
Updated: 2026-11-05


Difficulty: hard. Levels: Senior, Staff+.

## How the interviewer opens it

"Design an AI coding assistant that suggests code inside an editor. It uses editor and repository context. It must respond quickly and protect private source code."

## What to clarify first

- Completion traffic
- Repository size
- Read and write mix
- Latency
- Model limits
- Editor context
- Consistency and availability
- Private source processing
- Retention and durability
- Permissions and exclusions

## Scope of a strong answer

Core requirements:

- Suggest the next few lines at the cursor
- Use relevant editor text and authorized repository context
- Keep suggestions responsive as the user edits code
- Protect private source throughout its use and retention

Usually out of scope:

- Chat and autonomous repository edits
- Code execution
- Model pretraining
- Repository hosting
- Search across unrelated repositories

## What interviewers probe

### Context for a suggestion

A small prompt must capture useful code from a large repository. Unsaved editor text may differ from every stored revision.

### Time before a suggestion

Model queues and token generation share a tight response budget. Large prompts can delay many short requests.

### Edits during a request

The user can change the document before a suggestion arrives. Obsolete requests also consume scarce inference capacity.

### Private source code

Source can leak through context access, caches, logs, or inference. Old repository copies can retain code after access changes.

## Common mistakes

- The design sends the whole repository with each request.
- Capacity estimates count requests but ignore input and output token demand.
- Latency tests treat the first generated token as a useful suggestion.
- The editor displays obsolete results without checking document versions.
- The privacy design relies on encryption alone.
- The design promises to use unsaved edits that the editor never supplies.

## The bar by level

- **Senior:** Budgets latency across the full request. Defines revision checks and bounded unsaved dependency context. Handles cancellation, overload, current permissions, and source deletion with concrete failure behavior.
- **Staff+:** Derives fleet capacity and cost from measured token throughput. Defines revocation and regional failure boundaries. Explains how context quality tests respect privacy. Sets explicit trade-offs among acceptance, latency, isolation, and cost.

Practice this question with an AI interviewer: https://sysround.com/practice/new?problem=ai-coding-assistant


---
SysRound (https://sysround.com) is an AI practice tool for system design interviews. It has a voice or typed AI interviewer and a shared whiteboard. At the end, you get feedback on each skill and a model answer. The AI feedback can be wrong.
