Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Interview preparation

GH-300 and Azure fundamentals interview questions

135 questions from 30 topics, each with a model answer. Many include the follow-up an interviewer is likely to ask next. Use the mock interview to practise thinking on your feet.

Mock interview

Nimbus plays the interviewer. Answer out loud, then compare with the model answer.

Generative AI Risks and Limitations

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Why can Copilot suggest code that calls a function that doesn't exist?

Model answer

Because it predicts what code usually looks like, it doesn't look anything up. If lots of projects have a helper with that kind of name, the model can produce it even though my project doesn't have it. That's a hallucination, and the fix is to check the name against my code and the docs.

Interviewer follows up

How would you check quickly?

You

I'd search the workspace, look in package.json, or ask Copilot Chat with #codebase. If the tests or the linter fail on an unknown symbol, that's another quick signal.

Intermediate What does a knowledge cut-off mean for the code Copilot writes?

Model answer

The model learned from data up to a certain date. It may suggest an older version of a library, a deprecated API, or miss a security fix that came later. I check the current docs and run a dependency audit rather than trusting the version it picks.

Experienced developer Copilot gave you two different answers to the same prompt. Is something broken?

Model answer

No. LLM output is non-deterministic, so the same prompt can produce different suggestions. That's why I don't treat one answer as the truth. I pick the version I understand, and the tests decide whether it's right.

Scenario A teammate wants to paste a 4,000-line legacy file into chat and ask for a full rewrite. What risks do you raise?

Model answer

The context window is limited, so Copilot may not see all of the file and could drop behaviour it never read. Legacy languages and odd patterns are also weaker spots for the model. I'd split the work into small functions, write tests for the current behaviour first, and review each change.

Architecture & design How would you set up a team so these limits don't reach production?

Model answer

Treat AI output like any other code. Required pull request reviews by a person, CI with tests and linting, code scanning and dependency review, and branch protection so nothing merges without those checks. The tool speeds up writing, the pipeline still decides what ships.

Responsible AI: Principles, Harms and Mitigations

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Name Microsoft's six responsible AI principles.

Model answer

Fairness, reliability and safety, privacy and security, inclusiveness, transparency, and accountability. I remember that the last two are about people: say when AI was used, and someone owns the result.

Intermediate Copilot wrote a sign-up form that rejects names with an apostrophe. Which principle does that touch, and what do you do?

Model answer

Fairness and inclusiveness, because it fails for real people with names like O'Brien. I'd fix the validation, add test cases with names from different cultures, and mention the pattern to the team so reviewers look for it.

Interviewer follows up

Is that Copilot's fault?

You

It's where the bias came from, but accountability sits with us. We accepted and merged it, so we own fixing it.

Experienced developer Which Copilot features help with the privacy and security principle?

Model answer

Content exclusions keep sensitive paths out of Copilot's context, the public code filter can block matching suggestions, and on Business and Enterprise plans our code isn't used to train models. On the team side, we don't paste secrets or real customer data into prompts, and code scanning checks what Copilot writes.

Scenario Your manager asks whether you should tell reviewers that a pull request was mostly written with Copilot. What do you say?

Model answer

Yes. That's the transparency principle. A short note in the description helps reviewers look harder at the parts that came from AI, and it's honest. It doesn't lower the bar; the code still gets the same review and tests.

Architecture & design How would you turn responsible AI principles into something enforceable for 200 developers?

Model answer

Policies and pipelines, not just a slide. Organization Copilot policies for the public code filter and allowed features, content exclusions for sensitive repos, required reviews and status checks with tests and code scanning, a pull request template that asks about AI use, and short training on the known harms.

Validate Copilot Output and Use It Responsibly

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Why can't you just accept a Copilot suggestion if it compiles?

Model answer

Compiling only means the syntax is fine. Copilot predicts code, it doesn't run it, so the logic can still be wrong for some inputs, or it can be insecure. I read it, then I test it, especially with odd inputs.

Intermediate Walk me through how you validate a function Copilot wrote.

Model answer

I read it line by line until I can explain it. Then I write or generate tests, including edge cases like an empty cart or an unknown discount code, and run them. The linter and type checks run too. In the pull request, code scanning and dependency review add another layer, and a teammate reviews it.

Interviewer follows up

Can Copilot write those tests for you?

You

Yes, /tests is a good start, but I review the tests too. If the same model wrote the code and the tests, they can share the same wrong assumption, so I add the edge cases I care about myself.

Experienced developer What does "operate Copilot responsibly" mean day to day?

Model answer

Give it the right context so the output is better, keep secrets and real personal data out of prompts, never accept code I don't understand, keep the normal review and CI gates, give feedback with thumbs up or down, and be open in the pull request about where Copilot helped.

Scenario Copilot generated a database query that passes all tests. A reviewer still blocks it. Why might they be right?

Model answer

Tests only cover what we thought to test. The query might build SQL from user input, which works in tests and is an injection risk in production. That's why code scanning and a human reviewer sit on top of tests.

Architecture & design How do you stop unvalidated AI output from reaching main?

Model answer

Branch protection or rulesets on main: required pull request reviews from a person, required status checks for tests, lint and CodeQL, and dependency review. Copilot code review can add comments, but its review doesn't count as an approval, so a human still has to sign off.

GitHub Copilot Plans: Free, Pro, Business and Enterprise

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What's the difference between Copilot Pro and Copilot Business?

Model answer

Pro is bought by one person for themselves. Business is bought by an organization, which assigns seats to its members and controls Copilot through policies, content exclusions and the audit log. On Business, your code isn't used to train models.

Intermediate A developer has Copilot Pro personally and a Business seat from work. Whose settings apply in the work repos?

Model answer

In the organization's context, the organization's Copilot policies apply, so settings like the public code filter show as set by the org. That's the point of Business: the company, not the individual, decides how Copilot behaves on its code.

Experienced developer How do premium requests affect cost planning?

Model answer

Each plan includes a monthly allowance of premium requests for premium models and some features. Once it's used up, extra requests are either billed or blocked, depending on the budget. For a team, I'd set a budget, watch usage, and decide which models people really need.

Scenario A 30-person startup on GitHub Team wants Copilot and needs to exclude a folder of customer configs. Which plan fits?

Model answer

Copilot Business. It's bought per seat by the organization and supports content exclusions, policies and the audit log. Individual plans don't have content exclusions, and Enterprise needs GitHub Enterprise Cloud, which they don't need just for this.

Architecture & design When would you recommend Copilot Enterprise over Business?

Model answer

When the company already runs GitHub Enterprise Cloud and wants the enterprise-only extras and enterprise-level control, such as enforcing Copilot policies across many organizations. If they just need seats, policies and exclusions for one org, Business is enough.

Set Up GitHub Copilot in Your IDE

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner How do you get Copilot working in VS Code?

Model answer

Install the GitHub Copilot Chat extension from the Extensions view, sign in with my GitHub account, and check that the Copilot icon in the status bar looks ready. My account needs Copilot access, either Copilot Free, a paid plan or a seat from my organization.

Intermediate You want Copilot in JavaScript files but not in plain text files. How?

Model answer

With the github.copilot.enable setting. It takes an object of languages, so I set "*" to true and "plaintext" to false. I can also toggle it for the current language from the status bar icon.

Experienced developer A new hire installed the extension and signed in, but gets no suggestions. What do you check first?

Model answer

Whether their account actually has a Copilot seat in our organization, or a personal plan. Then the status bar icon for errors, whether the language is disabled, whether the file is covered by a content exclusion, and the Output panel for GitHub Copilot to see network or proxy errors.

Interviewer follows up

Where are the logs?

You

Output panel, GitHub Copilot channel, or the command "GitHub Copilot: Open Logs" from the Command Palette.

Scenario Half your team uses JetBrains IDEs, half uses VS Code. Do you need different Copilot plans?

Model answer

No. The plan or seat belongs to the GitHub account, not the editor. Each IDE has its own Copilot plugin, and people sign in with the same GitHub account. Organization policies apply in all of them.

Architecture & design How do you roll Copilot out to 100 developers smoothly?

Model answer

Assign seats to the right teams in the organization's Copilot access settings, set policies first, publish the extension name and the sign-in steps, make sure the proxy and firewall allow Copilot's endpoints, and give people a short troubleshooting list: seat, sign-in, status bar, language setting, exclusions, logs.

Inline Suggestions, Chat, Edit and Agent Mode

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner How do you accept only part of an inline suggestion?

Model answer

I press Ctrl plus Right Arrow to take the next word, and keep pressing it until I have what I want. Tab takes the whole thing. If none of the options fit, Alt plus right bracket cycles to the next suggestion, or I open the completions panel with Ctrl plus Enter.

Interviewer follows up

And if you don't want suggestions at all in Markdown files?

You

I set github.copilot.enable to false for markdown in my settings. Completions stay on for every other language.

Intermediate When would you pick Edit mode over Agent mode?

Model answer

When I already know which files need to change and want tight control. Edit only touches the files I add and shows me each diff. Agent decides which files to open, runs commands and loops, which is great for a whole task but more than I need for a rename across three files.

Experienced developer A teammate says agent mode ran a command they didn't expect. How do you explain what happened?

Model answer

Agent mode asks before it runs a terminal command, but you can approve a command for the session, and after that it won't ask again for that command in that session. I'd check what they approved, remind them that Allow once is the safer default, and review the chat log, which lists every tool call and command it ran.

Scenario A developer wants to understand a legacy file without risking any change to it. Which Copilot surface do you recommend?

Model answer

Ask mode in the Chat view, with the file added as context. Ask explains and suggests code blocks but never edits files on its own, so there's nothing to undo.

Copilot Chat: Slash Commands, Participants and Limits

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What's the difference between @workspace and #file?

Model answer

@workspace is a participant: it answers questions about the whole project and finds the relevant code itself. #file adds one specific file I choose to the prompt. If I know where the answer is, #file is more precise. If I don't, @workspace or #codebase searches for me.

Intermediate Copilot Chat starts giving answers about an old bug you discussed an hour ago. What do you do?

Model answer

Start a new chat, or use /clear. The earlier turns are still in the prompt as history, so they eat the context window and pull the answer off topic. A fresh chat with only the context for the new question gives better answers.

Experienced developer Your team keeps writing the same long prompt for API endpoint reviews. How would you make that consistent?

Model answer

I'd save it as a prompt file, .github/prompts/review-endpoint.prompt.md, with a description and maybe the mode and tools in the front matter, and an input variable for the file name. Everyone runs it with /review-endpoint, gets the same instructions, and we change it in one place through a pull request.

Interviewer follows up

How is that different from copilot-instructions.md?

You

Repository instructions are added to every request automatically. A prompt file only runs when someone calls it, so it's for a specific task, not house rules.

Scenario A developer asks for a model that isn't in their model picker. Why might that be?

Model answer

The models offered depend on their Copilot plan and on what the organization has enabled under Copilot › Models. An admin may have turned that model off, or it's only on a higher plan.

GitHub Copilot CLI: Install and Key Commands

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What is GitHub Copilot CLI and why would you use it instead of chat in the editor?

Model answer

It's Copilot as an agent in the terminal. I start it with copilot in a repo, ask about the code, and let it edit files or run commands after I approve them. It's handy when I'm already in the terminal, on a server over SSH, or when I want to script a prompt with copilot -p.

Intermediate How do you sign in to Copilot CLI on a build agent where nobody can open a browser?

Model answer

I don't use /login there. I create a fine-grained personal access token with the Copilot Requests permission and put it in COPILOT_GITHUB_TOKEN, GH_TOKEN or GITHUB_TOKEN as a secret. Classic tokens don't work for this.

Experienced developer A teammate still runs gh copilot suggest. What do you tell them?

Model answer

That extension has been replaced by GitHub Copilot CLI. Install the new CLI, run copilot, and you get a full agent with sessions, tools and MCP instead of one-off suggestions. For a quick one-shot answer, copilot -p does the job.

Scenario Copilot CLI starts but won't do anything in a repo, and someone says it's blocked. Where do you look?

Model answer

First whether I trusted the folder when it asked. Then whether my account has a Copilot plan or seat, and whether my organization's Copilot policy allows the CLI, because admins can turn it off. /login and /usage show who I'm signed in as.

Copilot CLI Sessions, Scripts and Files

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What's the difference between copilot and copilot -p?

Model answer

Plain copilot opens an interactive session where I chat, approve tools as they come up and keep going. copilot -p runs one prompt and exits, which suits scripts and CI. Because it can't stop to ask, it only uses tools I've allowed on the command line.

Intermediate You want Copilot CLI to write a file in a CI job but never delete anything. How?

Model answer

copilot -p with --allow-tool 'write' and --deny-tool 'shell(rm)'. The deny wins even if something broader is allowed. I avoid --allow-all-tools in CI because then it can run anything the job's account can.

Interviewer follows up

What happens if you forget --allow-tool 'write'?

You

It can't write the file. In programmatic mode there's nobody to ask, so the tool is refused and it tells you it needed permission.

Experienced developer A long Copilot CLI session is getting slow and the answers drift. What are your options?

Model answer

/context shows what's filling the window. /compact summarises the history so I keep the thread without the bulk. If the topic has changed, /clear or a fresh session is cleaner. For a side task, a sub-agent or /delegate keeps that work out of my main context.

Scenario Copilot CLI wrote a backup script that deletes old archives. Do you run it?

Model answer

Not before I read it. I check what it deletes, whether paths are quoted, and that set -euo pipefail is there. I'd run it once against a test folder, then commit it so the change is reviewed like any other code.

Agent Mode, MCP Servers and Sub-Agents

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What does agent mode do that Ask mode doesn't?

Model answer

Ask answers. Agent acts: it searches the codebase, edits files, asks to run commands like npm test, reads the results and keeps fixing until the task passes. I still review the diffs and decide what to keep.

Intermediate How do you give agent mode access to your GitHub issues?

Model answer

Add the GitHub MCP server. In VS Code that's a .vscode/mcp.json file with a servers entry pointing at https://api.githubcopilot.com/mcp/. Then the agent can call tools like list_issues, and it asks me before each tool call unless I've approved it.

Interviewer follows up

And if the tool never shows up?

You

Check that the server started, that my organization's MCP servers in Copilot policy allows MCP, and that the tool is enabled in the tools picker.

Experienced developer Why would you use a sub-agent rather than just asking the main agent?

Model answer

Context. If the main agent reads twenty files to research how logging works, all of that sits in its context window and crowds out the actual task. A sub-agent does the research in its own context and hands back a short summary, so the main thread stays lean and focused.

Architecture & design How would you let a team use MCP servers safely across many repositories?

Model answer

Set the organization's MCP policy deliberately, keep approved servers in a checked-in .vscode/mcp.json so everyone uses the same ones, prefer remote servers with OAuth over tokens pasted into config, and leave tool approvals on so a person sees each call. Anything that writes, like creating issues, deserves an extra look.

Custom Instructions and Prompt Files

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What's the difference between custom instructions and a prompt file?

Model answer

Custom instructions are always on. Copilot adds them to every relevant request without me asking, so they're for house rules like "we use ES modules". A prompt file only runs when I call it with /name. It's a saved task, like "add a REST endpoint with validation and tests".

Interviewer follows up

Where do they live?

You

Repository instructions in .github/copilot-instructions.md, path-specific ones in .github/instructions/ with an applyTo glob, and prompt files in .github/prompts/ as .prompt.md files.

Intermediate Your test rules keep showing up when Copilot edits production code. How would you fix that?

Model answer

I'd move them out of copilot-instructions.md into a path-specific file, say .github/instructions/tests.instructions.md, with applyTo set to "tests/**/*.js". Then they only ride along when the work touches test files.

Experienced developer How do you check that Copilot actually used your instructions?

Model answer

The chat response lists its references, and the instructions file shows up there when it was applied. If it's missing, I check the file name and folder, that the setting for instruction files is on in my editor, and that the applyTo glob really matches the file I'm working on.

Interviewer follows up

Can instructions guarantee Copilot follows a rule?

You

No. They're added to the prompt, so they steer the model, but the output still needs review. For hard rules I add a linter or a test that fails the build.

Scenario Five developers write the same "new endpoint" prompt five different ways and get five different styles. What do you do?

Model answer

Write one prompt file, .github/prompts/new-endpoint.prompt.md, with agent mode in the front matter and an ${input:resource} variable. Commit it, and everyone types /new-endpoint resource=orders. Same request, same shape of result, and the prompt gets reviewed like code.

Architecture & design How would you organise instructions in a large monorepo?

Model answer

Keep copilot-instructions.md short and true for the whole repo: language version, test runner, security rules. Then add one .instructions.md per area with its own applyTo, like the API, the web front end and the tests. Prompt files cover repeated tasks, and a custom agent covers a role such as a test writer with limited tools. Everything is in .github, so changes go through pull requests.

Copilot Code Review on Pull Requests

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Can Copilot approve my pull request so I can merge faster?

Model answer

No. Copilot code review only leaves Comment reviews. It never approves and never requests changes, and it doesn't count toward required approvals. It's an extra pair of eyes before a human reviewer, not a replacement.

Interviewer follows up

Then why use it?

You

It catches the obvious things fast, like an unhandled null or a missing test, so the human reviewer can spend their time on design and business logic.

Intermediate How do you make Copilot review every new pull request without anyone remembering to ask?

Model answer

Set up a ruleset on the repository or the organization with the rule that requests an automatic Copilot review. Then every new pull request on the targeted branches gets one.

Experienced developer Your team wants Copilot's review comments to follow its own standards. How?

Model answer

Write them into .github/copilot-instructions.md, for example "flag discount logic without a unit test" or "prefer early returns". For rules that only apply to part of the code, I'd use an .instructions.md file with applyTo. Copilot code review reads both.

Interviewer follows up

Does that make the review deterministic?

You

No. Two reviews of the same change can comment differently, and it can miss things. That's why it's comments, not a gate, and why we keep tests and code scanning in the pipeline.

Scenario Copilot left a suggested change on line 4 of discount.js. What do you do with it?

Model answer

Read it first. If it's right, I commit the suggestion from the comment, then let the tests run. If it's wrong or doesn't fit, I reply or resolve the conversation. The author owns the code either way.

Architecture & design Where does Copilot code review fit in a secure delivery pipeline?

Model answer

Early, as fast feedback on every pull request. Behind it I still want required human approvals, status checks for tests and code scanning, and branch protections. Copilot reduces the noise humans see, but the gates that block a merge stay human and automated, not AI opinion.

Copilot Spaces, Spark and Pull Request Summaries

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What does the Copilot button in a pull request description do?

Model answer

It reads the diff and writes a summary: what changed, often grouped by file. I still edit it, because the diff shows what changed but not why we changed it or how to test it.

Interviewer follows up

Is the summary always right?

You

Not always. It can miss intent or describe something too broadly, so I read it like any other Copilot output before I open the PR.

Intermediate What's a Copilot Space and how is it different from asking Copilot Chat a question?

Model answer

A space is curated context. I add the files, issues, notes and instructions for one topic, like onboarding to contoso-shop, and then every question in that space is answered from those sources. Plain chat only has what I attach in that one conversation.

Experienced developer When would you use custom instructions and when a Copilot Space?

Model answer

Instructions are rules that ride along with requests in a repository, like "use the Node test runner". A space is knowledge for a topic, maybe across repos, like the payments rules plus three key issues and an architecture decision. Rules versus reference material.

Scenario A product manager wants a small app to track which discount codes customers use. No developer has time. What could help?

Model answer

GitHub Spark, if they're on Copilot Pro+ or Enterprise. They describe the app, Spark builds and hosts it, and they refine it by chat. If it grows into something customers rely on, it becomes a real project with code review and tests.

Architecture & design How would you use Spaces to cut onboarding time for a team?

Model answer

I'd create an onboarding space with the README, the docs folder, the architecture decision records and the issues a new joiner usually hits, add instructions like "explain for someone new to the codebase", and share it with the team. New people ask the space instead of interrupting seniors, and the answers point back to our own sources.

Copilot Policies for Organizations and Enterprises

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Where does an organization owner turn Copilot features on or off?

Model answer

In the organization's settings, under Copilot. Access decides who has a seat, Policies switches features like Copilot Chat on github.com, the CLI, code review and the coding agent, and Models decides which models people can pick.

Interviewer follows up

Who do those policies affect?

You

Members who get their Copilot seat from that organization. Someone on a personal Pro plan isn't controlled by the org's Copilot policies for their own work.

Intermediate An organization owner wants to enable Copilot coding agent, but the setting is greyed out. Why?

Model answer

The enterprise has enforced that policy, probably as Disabled. When an enterprise sets a policy, organizations can't override it. The owner needs to ask the enterprise admins to enable it or switch it to No policy.

Experienced developer How would you roll Copilot out to a 2,000-person enterprise in stages?

Model answer

I'd leave most feature policies at No policy at enterprise level, enforce the few we're sure about, like blocking suggestions matching public code, and in each organization give seats to selected teams first. Then I'd turn on chat and code review, watch the metrics and audit log, and enable the coding agent and MCP once we had guidance written.

Interviewer follows up

Why not just enforce everything at the top?

You

Because different organizations have different needs. A research org may want the coding agent early, a regulated one may not. Enforce what's truly company-wide and let orgs decide the rest.

Scenario Security wants only approved models and no third-party tools for Copilot in your org. What do you change?

Model answer

Under Models, I'd turn off any model that isn't approved so it disappears from the picker. Under Policies, I'd disable MCP servers in Copilot so agents can't call outside tools. Both changes land in the audit log.

Architecture & design How do Copilot policies relate to content exclusions and the public code filter?

Model answer

They're layers. Policies decide which features exist at all. The public code filter is itself a policy and decides what happens to suggestions that match public code. Content exclusions are a separate setting that keeps sensitive paths out of Copilot's context. Together with seat access and the audit log, that's the governance set for Business and Enterprise.

Audit Log Events and Managing Seats with the REST API

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Someone turned off Copilot Chat on github.com for the whole org last week. How do you find out who?

Model answer

Open the organization's audit log and search action:copilot. Copilot policy changes are logged there with the actor and the time.

Interviewer follows up

What else shows up there for Copilot?

You

Seats being added or cancelled, policy changes and content exclusion changes.

Intermediate How would you find Copilot seats nobody is using?

Model answer

Call GET /orgs/contoso/copilot/billing/seats and look at last_activity_at on each seat. An old date, or no date at all, means the person isn't using it. last_activity_editor tells me which editor they last used.

Experienced developer You cancel a seat on the 3rd of the month with the REST API. When does the user lose Copilot?

Model answer

At the end of the current billing cycle. The DELETE call returns seats_cancelled and the seat goes into pending cancellation, but it stays usable until the cycle ends.

Interviewer follows up

And what token do you need?

You

One with the manage_billing:copilot scope, from someone allowed to manage Copilot billing for the org, like an owner or billing manager.

Scenario Every new developer joins the "web" team. How do you make sure they all get Copilot without a ticket each time?

Model answer

Assign seats to the team instead of to people: POST /orgs/contoso/copilot/billing/selected_teams with selected_teams set to web. Anyone added to the team gets a seat, and anyone removed loses it at the end of the cycle.

Architecture & design Design a monthly Copilot licence review for an org with 800 seats.

Model answer

A scheduled workflow calls the seats endpoint, flags seats with no activity in, say, 60 days, and opens an issue listing them for managers to confirm. Confirmed ones are cancelled with DELETE selected_users. The metrics endpoint shows overall usage for the report, and the audit log, searched with action:copilot, proves who changed what.

How Copilot Handles Your Data

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What leaves my machine when Copilot gives me an inline suggestion?

Model answer

A prompt built by the extension: the code before and after my cursor, the file name and language, and short snippets from related open tabs. It goes over HTTPS to the Copilot proxy. My whole repository isn't uploaded for a completion, only the context the extension picks.

Interviewer follows up

Does that include excluded files?

You

No. If an admin has set a content exclusion for a path, supported IDEs don't use that file as context and don't give suggestions inside it.

Intermediate A security lead asks whether Copilot Business trains on company code. What do you say?

Model answer

No. For Copilot Business and Enterprise, GitHub doesn't use your code, prompts or suggestions to train its models. I'd also explain retention: per the Trust Center at the time of writing, IDE completion prompts aren't kept after the response, other features like chat may keep prompts for up to 28 days, and engagement data is kept to run the service. I'd point them to the Trust Center for the current wording.

Experienced developer Your org dashboard shows acceptance rates per editor. Does that mean GitHub is storing everyone's code?

Model answer

No. Those metrics come from engagement data: events like a suggestion shown, accepted or dismissed, with the editor and language. That's different from the prompt and suggestion content. Metrics and the seats API tell you who uses Copilot and how much, not what code they wrote.

Scenario A developer on a Copilot Pro plan worries about their side-project code being used to improve products. What can they change?

Model answer

On individual plans they control it in their Copilot settings on github.com: the setting that allows GitHub to use their data for product improvements. They can turn it off. Business and Enterprise users don't need to, because their data isn't used for training anyway.

How Copilot Builds a Prompt from Context

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Why do Copilot's suggestions get better when I open a related file?

Model answer

Because open tabs are part of the context for inline suggestions. If I'm writing a test and the code under test is open in another tab, the extension can pull matching snippets from it into the prompt, so the model sees the real function names.

Interviewer follows up

Can open tabs make things worse?

You

Yes. An old, unrelated file in a tab can pull suggestions off course. I close tabs I'm not using.

Intermediate What does Copilot Chat include in the prompt when I ask a question?

Model answer

My question, the active file or my selection, anything I attach with # variables or by dragging files in, context from a participant like @workspace, the repository's custom instructions, and the earlier turns of the same conversation. All of that has to fit the model's context window.

Experienced developer Chat gave an answer that ignored the file you cared about. How do you check and fix it?

Model answer

I expand Used n references under the answer to see what was actually sent. If the file isn't there, I attach it with #file or select the code, and ask again. If the file should be there but never shows up, I check whether it's covered by a content exclusion.

Scenario A developer asks why Copilot doesn't just read the whole monorepo for every suggestion.

Model answer

The model's context window is limited, and inline suggestions need to be fast. So the extension picks the most relevant bits: the code around the cursor, the file's language and name, and related snippets from open tabs. For broader questions in chat, #codebase or @workspace searches the workspace and adds the best matches.

Proxy Filtering and Post-Processing

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What does the Copilot proxy do?

Model answer

It sits between my editor and the model. It checks that I'm signed in with Copilot access, filters the prompt for things like offensive text or prompt injection, and after the model answers it checks the reply again before sending it to my editor.

Interviewer follows up

Is the proxy something I install?

You

No. It's hosted by GitHub. My extension talks to it over HTTPS. If a corporate proxy or firewall blocks Copilot's endpoints, requests fail before they reach it.

Intermediate What does post-processing check?

Model answer

Code quality and common insecure patterns, offensive content, and, if the public code policy is Block, whether the suggestion matches public code of about 150 characters. Anything that fails is dropped or not shown.

Experienced developer Copilot's filters catch insecure patterns. Can we skip code scanning on Copilot-written code?

Model answer

No. The filters catch some common patterns, not every vulnerability, and they don't know your business rules. I keep code review, tests, code scanning and dependency checks in CI for all code, whoever or whatever wrote it.

Scenario A developer says a suggestion started to appear and then vanished. Their org policy blocks public code matches. What happened?

Model answer

Most likely post-processing found that the suggestion matched public code and the Block policy hid it. That's the filter working. They can write the code themselves or rephrase. If the org switched to Allow, they'd see it with a code reference showing the source and licence.

The Code Suggestion Lifecycle and LLM Limits

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Walk me through what happens between pausing and seeing ghost text.

Model answer

The extension notices the pause and gathers context: code around my cursor, the file name and language, and snippets from open tabs, skipping excluded files. It builds a prompt that fits the context window and sends it over HTTPS to the Copilot proxy, which authenticates and pre-filters it. The model predicts a completion, post-processing checks it, and it shows up as ghost text. Then I accept, cycle or dismiss it.

Interviewer follows up

What gets recorded after that?

You

Engagement data: whether I accepted or dismissed it, plus errors and timing. That powers the service and usage metrics.

Intermediate How do you see a different suggestion without retyping?

Model answer

Alt+] for the next one and Alt+[ for the previous one, or Option on macOS. If I want to compare several at once, Ctrl+Enter opens the completions panel. Ctrl+Right Arrow accepts just the next word if only the start is right.

Experienced developer Copilot suggested a call to a library method that doesn't exist. Why, and what do you do?

Model answer

That's a hallucination. The model predicts likely-looking code from patterns; it doesn't check the library. The method might be from an old version before its knowledge cut-off, or it just sounds right. I check the library's docs, run the code and tests, and give Copilot the real API in context, for example by opening the file that uses it.

Scenario Two developers ask Copilot the same thing and get different code. One says Copilot is broken.

Model answer

It isn't. Model output is non-deterministic, so the same prompt can give different answers, and their context differs too: different open tabs, different nearby code. What matters is that each answer is reviewed and tested against the same requirements.

Prompt Structure and Context for Copilot

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What makes a prompt for Copilot "good"?

Model answer

It says what I want, gives the right context and lists the rules. "Write a function" is vague. "In src/discount.js, make applyDiscount return the total unchanged for unknown codes, and never return a negative number" has a goal, points at the code and sets constraints.

Interviewer follows up

Does a good prompt have to be long?

You

No. Short is fine. Vague isn't. One clear sentence with the file and the rule beats a paragraph of background.

Intermediate How does Copilot Chat decide which code to look at?

Model answer

It uses the active file and my selection by default, plus anything I add: #file, #selection, #codebase to search the workspace, terminal context, images, or a participant like @workspace. Custom instructions and earlier turns in the conversation are included too. I check Used n references to confirm.

Experienced developer Your team keeps repeating "use ES modules and the Node test runner" in every prompt. How do you fix that?

Model answer

Put it in .github/copilot-instructions.md. Repository instructions are added automatically to chat, agent and code review requests in that repo. For rules that only apply to tests, I'd add a path-specific .instructions.md file with applyTo set to tests/**.

Scenario Copilot's inline suggestions in a new file are generic and miss the project's conventions. What do you change?

Model answer

Give it more to work with. I'd write a clear function name and a comment describing inputs, outputs and rules above the cursor, open a similar file from the project in another tab, and close unrelated tabs. Inline suggestions are driven by nearby code and open tabs.

Zero-Shot and Few-Shot Prompting

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What's the difference between zero-shot and few-shot prompting?

Model answer

Zero-shot means I only give the instruction. Few-shot means I show a couple of examples of what I want first, then ask. With examples, Copilot matches my format instead of guessing the most common one.

Interviewer follows up

Is one example enough?

You

Often, yes. That's called one-shot. I add a second or third example when the pattern has variations, like different log levels, so Copilot sees what changes and what stays the same.

Intermediate How do you do few-shot prompting with inline suggestions, where there's no chat box?

Model answer

I write the first one or two items myself in the file, for example two test cases or two log calls, and put the cursor on the next line. Copilot reads the code above the cursor as context and continues the pattern as ghost text.

Experienced developer Your team's generated code keeps using a different error format from the house standard. Few-shot fixed it in one chat, but people forget. What do you do?

Model answer

I'd put the standard and one short example in .github/copilot-instructions.md so it's added to every chat request in the repo automatically. For a repeated task, I'd also save the few-shot prompt as a prompt file in .github/prompts so anyone can run it with a slash command.

Scenario A zero-shot prompt for a SQL migration gave you generic syntax for the wrong database. What would you change?

Model answer

I'd make it specific: name the database and version, paste or reference one existing migration from the repo as an example, and say what the new one must do. That's a few-shot prompt with the right context, and it nearly always lands closer.

Prompt Engineering Principles and Chat History

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Does Copilot Chat remember what you said earlier?

Model answer

Within the same conversation, yes. The earlier messages go along with each new prompt, which is why "now write tests for it" works. A new chat starts empty, and Copilot doesn't carry memory from one conversation into another.

Interviewer follows up

So how do I make something stick across chats?

You

Put it in custom instructions, like .github/copilot-instructions.md, which are added to requests automatically. Don't rely on an old chat.

Intermediate Walk me through what happens when you press Enter in Copilot Chat.

Model answer

The extension builds a prompt from my message, the active file and selection, any #file or #codebase references, custom instructions and the chat history. It sends it over HTTPS to the Copilot proxy, which authenticates it and runs filters, for example for harmful content and prompt injection. The model generates a reply, it's post-processed and filtered again, and it appears in chat. Then I review it and either follow up or start fresh.

Experienced developer Answers in a long chat have started mixing up an old API version with the new one. Why, and what's your fix?

Model answer

The old instruction is still in the history, so it keeps being sent as context, and a long thread also crowds the context window. I'd start a new chat, put the current facts in the first prompt (API v2, the endpoint, an example file) and keep that thread to one topic.

Scenario A teammate writes one giant prompt asking for a feature, tests, docs and a migration. The result is shallow. How would you coach them?

Model answer

Break it into small steps in one focused chat: the function first, check it, then the tests, then the docs. Each prompt is single and specific, and the history from earlier steps helps the later ones. That's the 4 S's in practice.

Generate, Refactor and Document Code

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner How do you get Copilot to generate a function?

Model answer

I write a clear comment or function signature saying what it does, its inputs and output, and pause. Copilot suggests the body as ghost text and I press Tab if it's right. For anything bigger, I ask in chat and review the code block before inserting it.

Interviewer follows up

Do you accept it straight away?

You

No. I read it, check it handles the edge cases I care about, and run the tests. It's a draft from a model, not tested code.

Intermediate How do you refactor safely with Copilot?

Model answer

I make sure there are tests first. Then I select the code and ask in Edit mode for the specific refactor, saying the behaviour must stay the same. I read the diff line by line, run the tests, and only then choose Keep. Small refactors, one at a time, are much easier to review.

Experienced developer You've joined a team with a large unfamiliar codebase. How does Copilot help you get productive?

Model answer

I ask @workspace or use #codebase for "where is the discount logic and how is it called", /explain on the files I need to change, and ask for a summary of the folder structure. That keeps me in the editor instead of hopping between search, wikis and chat. I still confirm the important answers by reading the code.

Scenario Copilot's refactor passes review but breaks a rarely used report. What went wrong in the process?

Model answer

The refactor changed behaviour and nothing caught it. Either there were no tests around that path or nobody ran them before Keep. I'd add a test for the report, ask for smaller refactors with "keep behaviour identical", and make CI run the suite on every pull request.

Sample Data and Modernizing Legacy Code

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner How would you get test data from Copilot?

Model answer

I'd say exactly what I need, like "10 sample orders as JSON with id, customer, email and total, fake data only, example.com emails". I'd point it at the type or schema with #file so the fields match, and check the result before using it.

Interviewer follows up

Can you give Copilot a few real rows so it gets the shape right?

You

Not real ones. I'd give it the schema or one made-up example instead. Real customer data doesn't belong in a prompt.

Intermediate What's your first step before modernizing a legacy file with Copilot?

Model answer

Understand it. I run /explain on the file, ask what calls it, and write characterization tests that capture today's output, including the odd cases. Only then do I ask for the rewrite, so the tests tell me if behaviour changed.

Experienced developer Your team wants to convert a 3,000-line callback-based module to async/await with agent mode in one go. What do you advise?

Model answer

Break it up. One function or one file per change, with tests running after each step, and a diff small enough to review. A single huge edit is hard to review and easy to break. Agent mode is great for updating callers and re-running tests, but each step should still be reviewable.

Scenario Copilot's translation of an old VB6 routine to C# compiles but gives different totals. What happened and what now?

Model answer

Copilot's suggestions are less reliable for older, rarer languages, and subtle things like rounding or integer division can change in translation. I'd write tests from the old system's real outputs (with fake inputs), run the new code against them, and fix the differences one by one.

Unit Tests, Integration Tests and Edge Cases

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner How do you generate unit tests with Copilot?

Model answer

I select the function and type /tests in Copilot Chat, adding the edge cases I want, like "unknown code, no code, zero total". Copilot writes tests in the framework the project already uses. Then I read each one and run them.

Interviewer follows up

What if the project has no test framework yet?

You

Copilot can suggest one and the setup, but I'd decide which framework the team should use and tell it, rather than accept whatever it picks.

Intermediate What makes a generated test good or weak?

Model answer

A good test checks one behaviour with an exact expected value, like expect applyDiscount(100, 'NOPE') to equal 100. A weak one only checks that the result is defined or doesn't throw, so it passes even when the logic is wrong. I also check the test name says the behaviour.

Experienced developer Copilot generated ten tests and two fail. Do you delete the failing ones?

Model answer

No, those two are the interesting ones. I read the assertion and the code. If the code is wrong, like returning NaN for an unknown discount code, I fix the code and keep the test. If the test assumed behaviour we don't want, I fix the test. Deleting it throws away the bug report.

Scenario Unit tests pass, but the checkout API still returns the wrong total in staging. What test is missing?

Model answer

An integration test. Each unit works alone, but something between them is wrong, maybe the route passes the code in a different field. I'd ask Copilot for a supertest test that posts a real cart to POST /cart/total and checks the status and total, with the server started and stopped in setup and teardown.

Security Improvements and Performance Fixes

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner How would you ask Copilot to check a function for security problems?

Model answer

I'd select the function and ask in Chat, something like "Review this for security issues, for example injection or unsafe input handling." Being specific about the risk helps. Then I'd read the fix and run the tests before keeping it.

Interviewer follows up

Does Copilot find every vulnerability?

You

No. It catches common patterns, but it can miss things and it can be wrong. That's why I still run code scanning and keep a human review.

Intermediate Copilot suggests a fix for an N+1 query. What do you check before accepting it?

Model answer

That the new query returns the same results, including empty lists and duplicates, that the tests still pass, and that it's actually faster with realistic data. A quick timing or a query plan tells me more than the suggestion does.

Experienced developer Copilot has a filter for insecure code. Why do you still need code scanning?

Model answer

The filter checks suggestions for some common insecure patterns before they appear. It doesn't analyse data flow across the whole codebase, and it doesn't look at code humans wrote. CodeQL does, on every pull request, and it gives an alert I can track until it's fixed.

Interviewer follows up

Where does Copilot fit alongside CodeQL?

You

Before the pull request: explaining a risk, proposing a fix, writing a test that proves the bug. CodeQL is the check that runs whether or not anyone remembered to ask.

Scenario A teammate pastes a production stack trace with customer emails into Chat to get a performance fix. What do you say?

Model answer

Strip the personal data first, or reproduce the problem with fake data. Prompts leave the editor, and our policy is no customer data in prompts. The fix doesn't need real emails to be right.

Architecture & design How would you build Copilot into a team's secure development process without trusting it blindly?

Model answer

Use it where it's cheap to check: reviewing diffs, suggesting fixes, writing regression tests. Keep the gates that don't depend on it: code scanning and secret scanning on pull requests, dependency review, branch protection with human approval. Add security standards to the repository's custom instructions so suggestions follow them more often.

Content Exclusions and Editor Settings

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What does a content exclusion actually do to a file?

Model answer

In a supported IDE, Copilot won't offer inline suggestions inside that file, and it won't pull snippets from it as context when I'm working in other files. The file itself isn't changed or hidden from me.

Interviewer follows up

How do you know it's working?

You

I open the file and look at the Copilot icon in the status bar. It says the file is excluded, and no ghost text appears.

Intermediate Where can content exclusions be set, and who can set them?

Model answer

Three places. A repository admin sets paths for one repository. An organization owner writes YAML that can target named repositories or all of them with "*". An enterprise owner can set rules across the enterprise. All of it needs Copilot Business or Enterprise.

Experienced developer A developer says they can still see suggestions in a file you excluded ten minutes ago. Is the exclusion broken?

Model answer

Probably not. Exclusion changes can take up to 30 minutes to reach an IDE that's already open. I'd ask them to reload the window, check the status icon, and confirm the path pattern actually matches the file, for example a leading slash for the repository root.

Interviewer follows up

And if it still doesn't match after a reload?

You

I'd check the pattern against the real path, check they're using a supported IDE and an up-to-date extension, and check which Copilot feature they mean, because exclusions don't cover every feature.

Scenario Your security team wants every .env file in the company ignored by Copilot. How do you do it with the least effort?

Model answer

One organization-level rule with "*" as the repository and "**/.env" as the path. That covers every repository in the org, including new ones, without touching each repository's settings. The change appears in the audit log.

Architecture & design Is turning off Copilot for YAML in VS Code a good way to protect your infrastructure files?

Model answer

No. github.copilot.enable is a personal editor setting. Anyone can switch it back, and it does nothing for other developers. If the files are sensitive, the control is a content exclusion set by an admin, backed by not storing secrets in the repo at all.

Who Owns Copilot Output, and Its Limits

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner If Copilot writes a function and you commit it, who owns it?

Model answer

GitHub doesn't claim ownership of Copilot's suggestions, so it's treated like code I wrote, under my employer's usual rules. That also means I'm responsible for it, bugs and all.

Interviewer follows up

So can you blame Copilot if it's wrong?

You

No. Accepting a suggestion is a decision I made. If it breaks something, it's my change, the same as if I'd copied it from a blog.

Intermediate Name three limits of Copilot output you'd tell a new developer about.

Model answer

It has a training cut-off, so newer APIs may be missing. It can invent things that don't exist, like a package name. And it predicts likely code rather than running it, so it can be insecure or just wrong, with full confidence.

Experienced developer Your legal team asks whether Copilot output could include someone else's licensed code. How do you answer?

Model answer

It can happen, rarely, with longer suggestions that match public code. We control it with the "suggestions matching public code" policy: Block hides those matches, Allow shows them with a code reference giving the repository and licence. Either way the developer decides what to keep. I'd also point legal to our plan's terms, since Business and Enterprise include IP indemnity with conditions.

Interviewer follows up

Which setting would you pick?

You

Block for most teams, because it's the simplest. Allow with references if developers need the visibility and know how to handle attribution.

Scenario Copilot suggests installing a package you've never heard of to parse dates. What do you do?

Model answer

Check it exists on the registry, who publishes it, how widely it's used and its licence, before installing. Made-up package names are a known risk, and attackers sometimes register names that models tend to suggest.

Architecture & design How would you write a team policy on AI-generated code?

Model answer

Short and practical: the author owns every line they commit; AI-drafted code gets the same review, tests and code scanning as anything else; no secrets or personal data in prompts; public code matching set by the org; and say in the pull request when AI did a large part of the work.

Public Code Matching: Block or Show References

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner What's the difference between Block and Allow for public code matches?

Model answer

Block means I never see a suggestion that matches public code. Allow means I see it, and Copilot tells me which public repositories have similar code and under which licence, so I can decide.

Interviewer follows up

Where do you see that information in VS Code?

You

For inline suggestions, in the Output panel under GitHub Copilot Log (Code References). In chat, the answer itself lists the reference.

Intermediate Roughly how long does a match have to be for the filter to apply?

Model answer

About 150 characters. Short, common lines like a for loop don't count. It's aimed at longer chunks that look copied.

Experienced developer A developer on Copilot Business wants to change the public code setting for themselves. Can they?

Model answer

No. For organization seats the organization owner sets it in the Copilot policies, and if the enterprise enforces it, the organization can't change it either. The developer would need to ask the admin. Only individual plans control it in personal settings.

Interviewer follows up

Where does the admin set it?

You

Organization settings, Copilot, Policies, under suggestions matching public code.

Scenario With Allow on, Copilot shows a reference to a GPL-licensed repository for a suggestion. What do you do?

Model answer

Stop and think before accepting. If our project can't meet the GPL's terms, I'd reject it and write the code differently, or ask legal. If the licence is permissive, like MIT, I'd keep it and add the attribution it requires.

Architecture & design Which setting would you recommend for a company, and why?

Model answer

Block is the simple default for most companies: matches never appear, so nobody has to judge licences under deadline. Allow suits teams that want the visibility and have clear rules on attribution. Whatever we choose, I'd enforce it at the enterprise level so it's consistent.

Troubleshoot Suggestions and Content Exclusions

Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

Beginner Copilot stopped suggesting in VS Code. What's the first thing you check?

Model answer

The Copilot icon in the status bar. It tells me straight away if I'm signed out, if Copilot is disabled, or if the file is excluded. Then I check that my account actually has a seat.

Interviewer follows up

And if the icon looks fine?

You

I open Output and pick GitHub Copilot to read the logs. Network errors, auth errors and policy messages show up there.

Intermediate Suggestions work everywhere except Markdown files. What's likely going on?

Model answer

Completions are probably turned off for Markdown in the github.copilot.enable setting. That's a per-language switch. If the setting's fine, I'd check whether the Markdown files are covered by a content exclusion.

Experienced developer The logs show a 407 error when fetching completions. What does that mean and what do you do?

Model answer

A 407 is proxy authentication required, so a corporate proxy is in the way. I'd set VS Code's http.proxy settings correctly, or ask IT to allow Copilot's endpoints through the proxy and firewall. If the proxy inspects TLS, the corporate certificate may need to be trusted too.

Interviewer follows up

How do you confirm it's fixed?

You

Reload the window, type in a file, and watch the Copilot log for successful requests instead of errors.

Scenario An admin excluded /secrets/** five minutes ago, but a developer still gets suggestions in that folder. What do you tell them?

Model answer

It can take up to 30 minutes for exclusion changes to reach an IDE that's already open. Reload the window first. If it still happens after that, check the pattern matches the path from the repository root and that they're in a supported IDE with a current extension.

Architecture & design How would you cut down Copilot support tickets across 500 developers?

Model answer

Publish a short checklist: status icon, seat, exclusions, language settings, proxy, extension version, logs. Make sure the network team has allowed Copilot's endpoints before rollout, keep extensions updated through managed settings, and tell people when policies or exclusions change, since both look like "Copilot is broken" from the editor.

Install MSDEVBUILD Azure

Free · no account · works offline

Save the whole course for offline ›

Hi, I’m your Nimbus

Your study buddy. Pick what we do next.

MSDEVBUILD · Multi-Stack Dev Build

Sign in to MSDEVBUILD

One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.