Can GitHub Copilot solve JavaScript interview questions?

Just kidding :)

What is GitHub Copilot exactly?

GitHub Copilot provides suggestions for dozens of languages and a wide variety of frameworks, but it works especially well for Python, JavaScript, TypeScript, Ruby, and Go. — Team GitHub Copilot

GitHub Copilot utilizes OpenAI Codex, a modified version of GPT-3 (a language model meant to generate human-like writing) that is intended to generate legitimate computer code. Copilot is trained on public GitHub repositories.

Gist of copilot

Let’s check some of the amazing tasks copilot can perform and know its potential .

Some more examples

Let’s start interviewing copilot :)

I picked 10 questions from the following websites

Level: Basic

Note: It predicts the answer line by line, as every line prediction can’t be shown, i have showed the final output.

1. What are JavaScript Data Types?

2.What are global variables? How are these variable declared?

3. How to write a function in JavaScript?

4. Explain “this” keyword in detail.

5. Explain in detail about == and ===

Level: Medium

6. What is Object Destrcturing?

7. What is a Promise in JavaScript?

8. What is the role of deferred scripts in JavaScript?

9. What is the rest parameter and spread operator?

10. Explain Try catch in JavaScript


Finally :) It can center a div


In my opinion, It answered all the questions accurately but it still lacks in depth explanation. So now you may have realized why one liners don't work in an interview, so try taking your answer as deep as possible. One more thing i like about copilot while predicting answers is it backed it’s statement by an example which is appreciable and tells more about the answer, so try giving more examples in any interview.

Thank you



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store