Archicise
Exercise

Design an AI Code Assistant

Design an AI-powered code assistant like GitHub Copilot that provides intelligent code completions, explanations, and refactoring suggestions.

Functional Requirements

  • Real-time code completions as users type
  • Multi-line code suggestions
  • Code explanation and documentation generation
  • Refactoring suggestions
  • Support multiple programming languages
  • Context-aware suggestions based on project files

Non-Functional Requirements

  • Sub-200ms latency for completions
  • Support 100K+ concurrent developers
  • Handle codebases with 1M+ files
  • Maintain suggestion acceptance rate above 30%
  • Respect code privacy and security

Questions to Consider

  • How do you balance latency vs suggestion quality?
  • How do you gather relevant context from large codebases?
  • How do you handle sensitive/proprietary code?
Your Solution

Context Gathering

Design the system for gathering relevant code context. Consider open files, imports, project structure, and recently edited code.