Replies: 25 comments 18 replies
-
Lets go! 🚀 🚀 🚀 |
Beta Was this translation helpful? Give feedback.
-
Lezzz go!! |
Beta Was this translation helpful? Give feedback.
-
Lezzzz goo!!!!! |
Beta Was this translation helpful? Give feedback.
-
I'm very excited. By understanding developer use cases, AI-driven productivity boosts, and Copilot’s role in SDLC, we can refine our workflows and make the most of its capabilities. We'll also explore Copilot’s limitations and how to leverage the productivity API to measure its impact. |
Beta Was this translation helpful? Give feedback.
-
Go go go... |
Beta Was this translation helpful? Give feedback.
-
This week was so nice and dug a lot into developer use cases for AI. Here are my answers for this week: 1. When using GitHub Copilot in a corporate environment, which of the following practices could introduce legal or security risks? (Select two)
Explanation:Copilot-generated encryption algorithms might not be secure or follow industry best practices, leading to security vulnerabilities. Copilot can generate code without proper licensing information, leading to potential legal and intellectual property issues. 2. A developer is working with Copilot in Visual Studio and wants to optimize Copilot’s inline chat for debugging. What is the best way to achieve this?
Explanation:Providing more detailed prompts helps Copilot generate more relevant debugging suggestions. 3. A developer is using GitHub Copilot to generate a function for sorting a large dataset (100,000+ entries). Why might this function be suboptimal for large datasets?def sort_data(data):
return sorted(data)
Explanation:sorted(data) 4. A developer asks Copilot to generate a function that computes Fibonacci numbers. The suggested function uses recursion but lacks memoization. What is the most likely reason for this omission?
Explanation:Copilot generates code based on common patterns, and unless explicitly prompted, it might not consider optimizations like memoization. 5. When using GitHub Copilot for SQL query generation, what should developers be cautious about?
Explanation:Copilot-generated SQL queries may not use parameterized queries, making them vulnerable to SQL injection. 6. A team is using Copilot for collaborative development. Developer A enables Copilot in a private repository. Developer B, working in the same repository, notices Copilot's suggestions contain code snippets that look unfamiliar. What might be happening?
Explanation:Copilot suggests code based on the project’s context, including existing files in the repository. 7. You request Copilot to generate a SQL query but notice that the suggested query lacks proper indexing considerations. What should you do?
Explanation:Explicitly defining performance needs in comments improves Copilot’s suggestions. 8. A developer needs Copilot to generate optimized SQL queries. What prompt will yield the best results?
Explanation:Providing specific requirements like "optimized" and "using an index on customer_id" ensures Copilot generates a more efficient query. 9. A team is developing a proprietary algorithm and wants to ensure Copilot does not suggest code similar to public implementations. What is the best approach? (Select two)
Explanation:Private repositories prevent Copilot from using public code patterns in suggestions and providing unique constraints helps Copilot generate more original code. 10. According to research on GitHub Copilot's impact, which of the following factors contribute most significantly to increased developer productivity when using Copilot? (Select two)
Explanation:Copilot reduces the need to search for external resources, speeding up development. 11. Which of the following factors most significantly influence GitHub Copilot’s ability to generate high-quality completions? (Select two)
Explanation:More recent training data ensures Copilot generates relevant and up-to-date suggestions. 12. You are using GitHub Copilot in Visual Studio Code and notice that it frequently suggests outdated API methods that have been deprecated. What are the most effective strategies to improve the relevance of suggestions? (Select two)
Explanation:Mentioning the latest API version in comments helps Copilot generate up-to-date suggestions. Also, This week resources are so good ! Thanks @Akash1134 for providing these resources! |
Beta Was this translation helpful? Give feedback.
-
Question: When using GitHub Copilot in a corporate environment, which of the following practices could introduce legal or security risks? (Select two) ✅ A) Using Copilot to generate code for encryption algorithms without verification. ✅ C) Accepting Copilot-generated code that lacks licensing information. Question: A developer is working with Copilot in Visual Studio and wants to optimize Copilot’s inline chat for debugging. What is the best way to achieve this? ✅ A) Rewriting prompts to be more detailed, explicitly mentioning expected outputs. Question: A developer is using GitHub Copilot to generate a function for sorting a large dataset (100,000+ entries). Why might this function be suboptimal for large datasets? ✅ C) The function does not use an in-place sorting method like data.sort(). Question: A developer asks Copilot to generate a function that computes Fibonacci numbers. The suggested function uses recursion but lacks memoization. What is the most likely reason for this omission? ✅ C) Copilot lacks context about performance optimizations unless explicitly prompted. Question: When using GitHub Copilot for SQL query generation, what should developers be cautious about? ✅ B) Copilot might suggest queries vulnerable to SQL injection. Question: A team is using Copilot for collaborative development. Developer A enables Copilot in a private repository. Developer B, working in the same repository, notices Copilot's suggestions contain code snippets that look unfamiliar. What might be happening? ✅ B) Copilot is generating code based on patterns detected in the project’s existing files. Question: You request Copilot to generate a SQL query but notice that the suggested query lacks proper indexing considerations. What should you do? ✅ A) Add a comment specifying performance constraints and indexing requirements. Question: A developer needs Copilot to generate optimized SQL queries. What prompt will yield the best results? ✅ B) # Write an optimized SQL query that retrieves customer data using an index on customer_id. Question: A team is developing a proprietary algorithm and wants to ensure Copilot does not suggest code similar to public implementations. What is the best approach? (Select two) ✅ A) Use private repositories with Copilot to limit exposure to public code patterns. ✅ B) Explicitly describe unique constraints and design principles in inline comments. Question: According to research on GitHub Copilot's impact, which of the following factors contribute most significantly to increased developer productivity when using Copilot? (Select two) ✅ A) Reduction in the time spent searching for solutions on external websites. ✅ D) Faster onboarding of new developers due to AI-assisted code understanding. Question: Which of the following factors most significantly influence GitHub Copilot’s ability to generate high-quality completions? (Select two) ✅ A) The recency of the training data used to build the model. ✅ B) The user's coding patterns and past accepted suggestions. Question: You are using GitHub Copilot in Visual Studio Code and notice that it frequently suggests outdated API methods that have been deprecated. What are the most effective strategies to improve the relevance of suggestions? (Select two) ✅ A) Add a comment explicitly mentioning the latest API version before the function definition. ✅ B) Use natural language prompts that describe the intent of the code rather than function names. Question: A developer is building a machine learning model in Python. They ask GitHub Copilot to generate a function for model training but notice that Copilot repeatedly suggests suboptimal hyperparameter choices. What is the best way to guide Copilot to generate better completions? ✅ A) Use inline comments to specify preferred hyperparameters and model architectures. |
Beta Was this translation helpful? Give feedback.
-
Hey @Akash1134 👋
|
Beta Was this translation helpful? Give feedback.
-
Join the Prompt battle 🤜💡 Challenge:Think you can out-prompt GitHub Copilot? Let’s put your prompt engineering skills to the test! Pick a simple coding task and refine your prompt step by step to get the best possible output from Copilot. How to Participate:
The best one wins the battle ✌️ Example:
Share your Promptness below👇 (we have time till Monday next week) |
Beta Was this translation helpful? Give feedback.
-
Here are my answers! @Akash1134
|
Beta Was this translation helpful? Give feedback.
-
I’m very excited about this week’s focus on prompt engineering! One tip I found useful is to be very specific with prompts to get the best results from Copilot. Has anyone else noticed a significant improvement in their code quality? 🚀 |
Beta Was this translation helpful? Give feedback.
-
Hey @Akash1134 |
Beta Was this translation helpful? Give feedback.
-
Absolutely @paulsuv9 ! Being specific with prompts makes a huge difference. I've noticed that adding details like expected output format and constraints leads to much better responses from Copilot. It’s like giving clear instructions to a teammate! 🚀🔥 |
Beta Was this translation helpful? Give feedback.
-
Week 3 is looking exciting! 🚀 Prompt engineering is a crucial skill for getting the most out of GitHub Copilot, and it’s great to see a focus on developer productivity and real-world AI use cases. Some key takeaways for this week: With all these resources (videos, blogs, and Microsoft Learn modules), there’s plenty to dive into. What part of prompt engineering are you most excited to explore? 🤔 |
Beta Was this translation helpful? Give feedback.
-
answers: 1.Which practices could introduce legal or security risks? 2.Best way to optimize Copilot’s inline chat for debugging? 3.Why is the sorting function suboptimal for large datasets? 4.Why does Copilot omit memoization in Fibonacci function? 5.What should developers be cautious about with SQL query generation? 6.Why do Copilot's suggestions contain unfamiliar snippets in a private repo? 7.What to do when a Copilot-generated SQL query lacks indexing considerations?
10.Factors that contribute most to increased developer productivity with Copilot? 11.Factors that influence Copilot’s ability to generate high-quality completions? 12.Strategies to improve Copilot's relevance when it suggests outdated API methods? 13.Best way to guide Copilot to generate better ML model training functions? |
Beta Was this translation helpful? Give feedback.
-
Here's my answers:
|
Beta Was this translation helpful? Give feedback.
-
Here are my answers for the week 31. When using GitHub Copilot in a corporate environment, which of the following practices could introduce legal or security risks? (Select two)🟢 A) Using Copilot to generate code for encryption algorithms without verification. Note We always should review and verify the generated code. 2. A developer is working with Copilot in Visual Studio and wants to optimize Copilot’s inline chat for debugging. What is the best way to achieve this?🟢 A) Rewriting prompts to be more detailed, explicitly mentioning expected outputs. Note Only A could help on optimize for debugging 3. A developer is using GitHub Copilot to generate a function for sorting a large dataset (100,000+ entries). Copilot suggests the following function:python
Copy
Edit
def sort_data(data):
return sorted(data) Why might this function be suboptimal for large datasets? Note If we explicitly providing the function is going to sort a very large dataset or even providing what type of data are going to be sorted, Copilot could provide other solutions which could provide better performance. 4. A developer asks Copilot to generate a function that computes Fibonacci numbers. The suggested function uses recursion but lacks memoization. What is the most likely reason for this omission?🟢 C) Copilot lacks context about performance optimizations unless explicitly prompted. Note Same reason as Q3. 5. When using GitHub Copilot for SQL query generation, what should developers be cautious about?🟢 B) Copilot might suggest queries vulnerable to SQL injection. Note This is why Copilot user should always do code review before accept the generated code immediately. It is users' responsibility to verify the security risks. 6. A team is using Copilot for collaborative development. Developer A enables Copilot in a private repository. Developer B, working in the same repository, notices Copilot's suggestions contain code snippets that look unfamiliar. What might be happening?🟢 B) Copilot is generating code based on patterns detected in the project’s existing files. Note Copilot will Learn from patterns: As developers work on a project, GitHub Copilot learns from their coding patterns and preferences, tailoring suggestions accordingly. 7. You request Copilot to generate a SQL query but notice that the suggested query lacks proper indexing considerations. What should you do?🟢 A) Add a comment specifying performance constraints and indexing requirements. Note The more contextual information provided, the more fitting the generated code suggestions are. 8. A developer needs Copilot to generate optimized SQL queries. What prompt will yield the best results?🟢 B) # Write an optimized SQL query that retrieves customer data using an index on customer_id. Note A is too simple. C did not provide what column and what kind of join. D fetch all rows. 9. A team is developing a proprietary algorithm and wants to ensure Copilot does not suggest code similar to public implementations. What is the best approach? (Select two)🟢 A) Use private repositories with Copilot to limit exposure to public code patterns. Note C is incorrect. I tried to go to Copilot setting, i cannot find such setting. 10. According to research on GitHub Copilot's impact, which of the following factors contribute most significantly to increased developer productivity when using Copilot? (Select two correct answers)🟢 A) Reduction in the time spent searching for solutions on external websites. Note With copilot, we could minimize context switching. And also can accelerate learning new programming languages and frameworks which helps onboarding of new developers. 11. Which of the following factors most significantly influence GitHub Copilot’s ability to generate high-quality completions? (Select two)🟢 A) The recency of the training data used to build the model. Note More recent training data could allow GitHub Copilot to generate relevant and up-to-date generations. And User's codng patterns and past accept suggestions are part of the GitHub could generate Personalized code completion. 12. You are using GitHub Copilot in Visual Studio Code and notice that it frequently suggests outdated API methods that have been deprecated. What are the most effective strategies to improve the relevance of suggestions? (Select two)🟢 A) Add a comment explicitly mentioning the latest API version before the function definition. Note C is incorrect because it does not help to filter out the outdated API. 13. A developer is building a machine learning model in Python. They ask GitHub Copilot to generate a function for model training but notice that Copilot repeatedly suggests suboptimal hyperparameter choices. What is the best way to guide Copilot to generate better completions?🟢 A) Use inline comments to specify preferred hyperparameters and model architectures. Note B is incorrect, although it works but it is not the suggested way when using Copilot. |
Beta Was this translation helpful? Give feedback.
-
@Akash1134 Currently it is linking to "https://learn.microsoft.com/en-us/training/modules/developer-use-cases-for-ai-with-github-copilot/" And it should be "https://learn.microsoft.com/en-us/training/modules/implement-code-improvements-using-github-copilot-tools/" |
Beta Was this translation helpful? Give feedback.
-
My entry for the GitHubCopilotChallenge - NutriScan, a minimalist web application that turns your mobile browser into a barcode scanner and tells you whether a packaged food item is Ultra-Processed or not. No dedicated smartphone app is required unlike other scanning apps; it runs with just HTML and JavaScript! JavaScript has changed significantly in the last decade. Many of the features that were part of helper libraries like jQuery are now included natively. As I wanted the app to load very fast, GitHub Copilot generated lean code and GitHub Copilot Chat explained the code where I needed help in understanding. Overview Open Food Facts is the world's largest open source food database, a sort of Wikipedia of Food. Nutrition information for more than 3.6 million products is available on the OFF website. You can access this data through their website, API, or as a data dump. Open Food Facts employs a nutritional rating system that rewards products rich in beneficial nutrients like fiber and protein, while penalizing those high in less desirable components such as fats, sugars, and sodium. I'm an active contributor to the Open Food Facts database and I highly encourage like-minded people to add missing data. My sample code scans an EAN-13 barcode from a packaged food product and then fetches its:
How to Use
Key Features
Code Structure
Troubleshooting I've also added "Thing Near Me" the other app I co-created with Copilot to the repo WebApps. I plan to add more code samples as I continue exploring interesting public REST APIs. |
Beta Was this translation helpful? Give feedback.
-
Answers: |
Beta Was this translation helpful? Give feedback.
-
Week 3 questions were a bit tricky but it was also fun learning about prompt engeneering and productivity. |
Beta Was this translation helpful? Give feedback.
-
This week, I learned that framing prompts with specific constraints can drastically improve Copilot’s output. One tip is to always specify the expected output format and any performance constraints. |
Beta Was this translation helpful? Give feedback.
-
I found that using Copilot for generating SQL queries saved me a lot of time. Has anyone else had a similar experience? |
Beta Was this translation helpful? Give feedback.
-
Here are my answers to this week's questions: 1. Legal and Security RisksQuestion: When using GitHub Copilot in a corporate environment, which of the following practices could introduce legal or security risks? (Select two)
2. Optimizing Copilot’s Inline Chat for DebuggingQuestion: A developer is working with Copilot in Visual Studio and wants to optimize Copilot’s inline chat for debugging. What is the best way to achieve this?
3. Sorting Function for Large DatasetsQuestion: A developer is using GitHub Copilot to generate a function for sorting a large dataset (100,000+ entries). Why might this function be suboptimal for large datasets?
4. Fibonacci Function without MemoizationQuestion: A developer asks Copilot to generate a function that computes Fibonacci numbers. The suggested function uses recursion but lacks memoization. What is the most likely reason for this omission?
5. SQL Query Generation CautionsQuestion: When using GitHub Copilot for SQL query generation, what should developers be cautious about?
6. Unfamiliar Code Snippets in Private RepoQuestion: A team is using Copilot for collaborative development. Developer A enables Copilot in a private repository. Developer B, working in the same repository, notices Copilot's suggestions contain code snippets that look unfamiliar. What might be happening?
7. SQL Query Lacking Indexing ConsiderationsQuestion: You request Copilot to generate a SQL query but notice that the suggested query lacks proper indexing considerations. What should you do?
8. Best Prompt for Optimized SQL Query GenerationQuestion: A developer needs Copilot to generate optimized SQL queries. What prompt will yield the best results?
9. Protecting Proprietary AlgorithmsQuestion: A team is developing a proprietary algorithm and wants to ensure Copilot does not suggest code similar to public implementations. What is the best approach? (Select two)
10. Factors Contributing to Increased Developer ProductivityQuestion: According to research on GitHub Copilot's impact, which of the following factors contribute most significantly to increased developer productivity when using Copilot? (Select two)
11. Factors Influencing Completion QualityQuestion: Which of the following factors most significantly influence GitHub Copilot’s ability to generate high-quality completions? (Select two)
12. Improving Relevance of SuggestionsQuestion: You are using GitHub Copilot in Visual Studio Code and notice that it frequently suggests outdated API methods that have been deprecated. What are the most effective strategies to improve the relevance of suggestions? (Select two)
13. Guiding Copilot for Better ML Model Training FunctionsQuestion: A developer is building a machine learning model in Python. They ask GitHub Copilot to generate a function for model training but notice that Copilot repeatedly suggests suboptimal hyperparameter choices. What is the best way to guide Copilot to generate better completions?
|
Beta Was this translation helpful? Give feedback.
-
Sorry for begin late and last to answer , Thanks for this wonderful course, @Akash1134. These are my answers, and I hope they are right:
|
Beta Was this translation helpful? Give feedback.
-
👋 Welcome to Week 3 of the GitHub Copilot Free learning journey and cert prep! We're now at the halfway point in our learning journey, and it’s been incredible to see the depth of thought and creativity in your submissions so far.
This week, we’re shifting our focus to some of the core principles of prompt engineering and productivity. Understanding these foundational concepts will help you craft more effective prompts, allowing you to harness Copilot’s full potential for smarter, faster coding. Here's what we'll be covering to refine your skills and take your workflow to the next level 🚀
Note
Don’t miss out—Keep engaging, learning, and growing together! Top participants will earn a GitHub Certifications exam voucher! 🎫 Think of it as your golden ticket to advancing your career! 💼
Your First Move: Study Smart, Level Up! 🎯
We've already explored Copilot’s features and data handling, giving you a solid foundation in how it works. Now, it's time to take your skills to the next level by mastering the art of prompt creation and prompt engineering. The way you frame your inputs directly impacts the quality of AI-generated outputs, and learning how to craft effective prompts will help you get the most out of Copilot. We'll also dive into real-world developer use cases, showing you practical ways Copilot can streamline your workflow, boost productivity, and enhance your coding experience.
Knowledge Checkpoint 🏁 - Let’s See What You’ve Got! 🧠
1. When using GitHub Copilot in a corporate environment, which of the following practices could introduce legal or security risks? (Select two)
A) Using Copilot to generate code for encryption algorithms without verification.
B) Enabling Copilot to suggest code completions within a private enterprise repository.
C) Accepting Copilot-generated code that lacks licensing information.
D) Using Copilot in an IDE that does not support secure API calls.
2. A developer is working with Copilot in Visual Studio and wants to optimize Copilot’s inline chat for debugging. What is the best way to achieve this?
A) Rewriting prompts to be more detailed, explicitly mentioning expected outputs.
B) Running Copilot Chat multiple times to get varied debugging suggestions.
C) Adjusting Copilot’s temperature parameter to control randomness in responses.
D) Restricting Copilot Chat to only use file-specific context rather than project-wide scope.
3. A developer is using GitHub Copilot to generate a function for sorting a large dataset (100,000+ entries). Copilot suggests the following function:
Why might this function be suboptimal for large datasets?
A) The sorted() function is not efficient for large datasets.
B) The function lacks an explicit sorting algorithm, making it unpredictable.
C) The function does not use an in-place sorting method like data.sort().
D) Copilot might suggest a less efficient sorting algorithm if not prompted explicitly.
4. A developer asks Copilot to generate a function that computes Fibonacci numbers. The suggested function uses recursion but lacks memoization. What is the most likely reason for this omission?
A) Copilot prioritizes standard implementations seen in open-source projects.
B) Copilot avoids generating computationally expensive algorithms.
C) Copilot lacks context about performance optimizations unless explicitly prompted.
D) Copilot assumes the user will manually optimize the generated code.
5. When using GitHub Copilot for SQL query generation, what should developers be cautious about?
A) Copilot always generates the most optimized query.
B) Copilot might suggest queries vulnerable to SQL injection.
C) Copilot does not support SQL query generation.
D) Copilot automatically optimizes database indexes.
6. A team is using Copilot for collaborative development. Developer A enables Copilot in a private repository. Developer B, working in the same repository, notices Copilot's suggestions contain code snippets that look unfamiliar. What might be happening?
A) Copilot is retrieving suggestions from similar open-source projects.
B) Copilot is generating code based on patterns detected in the project’s existing files.
C) Copilot is using external AI models to fetch relevant public code snippets.
D) Copilot is applying prompt engineering techniques to infer missing logic.
7. You request Copilot to generate a SQL query but notice that the suggested query lacks proper indexing considerations. What should you do?
A) Add a comment specifying performance constraints and indexing requirements.
B) Re-prompt Copilot with a more detailed query request.
C) Accept the query and manually optimize it.
D) Adjust Copilot’s model settings to prioritize efficiency.
8. A developer needs Copilot to generate optimized SQL queries. What prompt will yield the best results?
A) # Generate an SQL query to retrieve customer data.
B) # Write an optimized SQL query that retrieves customer data using an index on customer_id.
C) # Write an SQL query for fetching customer data using JOINs.
D) # Generate a basic SQL query to fetch all rows from the customers table.
9. A team is developing a proprietary algorithm and wants to ensure Copilot does not suggest code similar to public implementations. What is the best approach? (Select two)
A) Use private repositories with Copilot to limit exposure to public code patterns.
B) Explicitly describe unique constraints and design principles in inline comments.
C) Turn off Copilot suggestions for functions that contain proprietary logic.
D) Modify Copilot's training dataset to exclude certain open-source projects.
10. According to research on GitHub Copilot's impact, which of the following factors contribute most significantly to increased developer productivity when using Copilot? (Select two correct answers)
A) Reduction in the time spent searching for solutions on external websites.
B) Increased number of lines of code written per hour.
C) A higher frequency of completed pull requests per developer.
D) Faster onboarding of new developers due to AI-assisted code understanding.
11. Which of the following factors most significantly influence GitHub Copilot’s ability to generate high-quality completions? (Select two)
A) The recency of the training data used to build the model.
B) The user's coding patterns and past accepted suggestions.
C) The number of times the user has prompted Copilot in a single session.
D) Whether the user is working in an IDE or a browser-based editor.
12. You are using GitHub Copilot in Visual Studio Code and notice that it frequently suggests outdated API methods that have been deprecated. What are the most effective strategies to improve the relevance of suggestions? (Select two)
A) Add a comment explicitly mentioning the latest API version before the function definition.
B) Use natural language prompts that describe the intent of the code rather than function names.
C) Adjust the settings to restrict Copilot to suggestions from private repositories only.
D) Revert to an older version of GitHub Copilot that was trained on previous API versions.
13. A developer is building a machine learning model in Python. They ask GitHub Copilot to generate a function for model training but notice that Copilot repeatedly suggests suboptimal hyperparameter choices. What is the best way to guide Copilot to generate better completions?
A) Use inline comments to specify preferred hyperparameters and model architectures.
B) Accept a Copilot suggestion and manually tweak the parameters later.
C) Change the function name to include terms like “optimized” or “efficient.”
D) Train Copilot on previous successful models to improve its suggestions.
🚀 🚀 🚀
Beta Was this translation helpful? Give feedback.
All reactions