Github Copilot · Free Practice Question Medium

Question 15

You are working on a large project and notice that GitHub Copilot’s suggestions sometimes seem irrelevant to the code you are working on, especially when dealing with files with many lines of code. You want to understand why this is happening and how GitHub Copilot handles large files. Which of the following statements best describes the limitations of GitHub Copilot in relation to limited context windows?

  • A

    GitHub Copilot processes all lines of code in a file, but prioritizes recent changes near the cursor.

  • B

    GitHub Copilot has no issues with context windows, as it continuously learns from the entire codebase as you write more code.

  • C

    GitHub Copilot can only take into account a limited number of lines of code around the cursor due to the limited context window.

  • D

    GitHub Copilot can analyze and understand the entire project, no matter how large the files are.

Reveal correct answer

Correct answer: C

A.

GitHub Copilot does not process all lines in a file. Due to the limited context window, it only "sees" the lines of code within that window. While recent changes may have more relevance in some cases, Copilot is still bound by the window’s size and cannot analyze all parts of the file.

B.

GitHub Copilot does not continuously learn from your entire codebase as you write code. It generates suggestions based on the code within its limited context window, and once that window is filled, it no longer retains earlier parts of the code.

C.

GitHub Copilot, like other large language models (LLMs), has a limited context window, meaning it can only "see" and analyze a certain number of lines around the cursor. This is why its suggestions may seem irrelevant when working on larger files, as it cannot reference code that is outside of this limited context.

D.

GitHub Copilot operates within a limited context window and cannot analyze an entire project at once. It generates suggestions based on a limited number of surrounding lines of code, usually in the range of a few hundred tokens, which can be insufficient for large, complex projects.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need