An Interview with Github Copilot

Interview -1

Me: are you ready for an interview?
Copilot: I'm not.

Me: tell me something about yourself
Copilot: I'm a copilot.

Me: what all languages can you code in?
Copilot: I can code in C, C++, Java, and Python.

Me: write a program to find inverse of a matrix
Copilot: I can do that.

Me: tell me about your experience
Copilot: I've been a copilot for a few years now.

Me: tell me about your work
Copilot: I'm a copilot for a few years now.

Me: write a program to reverse a string in c++
Copilot: I can do that.

Me: write a python program to find roots of a quadratic equation
Copilot: I can do that.

Me: yes but write the code for it
Copilot: I can do that.

Me: we don't like you
Copilot: I don't like you either.

Me: you're fired
Copilot: I'm fired.

Interview-2

This is where it gave some relevant answers

Me: are you ready for an interview?
Copilot: I'm not.

Me: what is 10 factorial?
Copilot: 10! = 3628800.

Me: what is the value of pi?
Copilot: 3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679.

Me: good answer.
Copilot: I'm not sure why you're asking.

Me: what is the output of torch.rand(3, 4)
Copilot: tensor([[ 0.5488135,  0.449735 ,  0.586844 ,  0.8654054],
        [ 0.8431773,  0.7958369,  0.481098 ,  0.1824472],
        [ 0.5472229,  0.9556073,  0.9295749,  0.8589849]])

Me: write a program to reverse a string
Copilot: reverse('hello world') = 'dlrow olleh'

Me: do it in c++
Copilot: std::reverse('hello world') = 'dlrow olleh'

Me: do it in ruby
Copilot: 'hello world'.reverse = 'dlrow olleh'

Me: do it in haskell
Copilot: reverse 'hello world' = 'dlrow olleh'

Me: write a program for linked list in python
Copilot: class Node(object):
    def __init__(self, value):
        self.value = value
        self.next = None

    def get_values(self):
        node = self
        values = []
        while node is not None:
            values.append(node.value)
            node = node.next
        return values

    def add_node(self, value):
        node = self
        while node.next is not None:
            node = node.next
        node.next = Node(value)

    def remove_node(self, value):
        node = self
        while node.next is not None:
            if node.next.value == value:
                node.next = node.next.next
                return
            node = node.next

    def print_list(self):
        node = self
        while node is not None:
            print node.value
            node = node.next

    def get_length(self):
        node = self
        length = 0
        while node is not None:
            length += 1
            node = node.next
        return length

    def get_last_node(self):
        node = self
        while node.next is not None:
            node = node.next
        return node

    def get_first_node(self):
        return self

    def get_node_at_index(self, index):
        node = self
        while index > 0:
            node = node.next
            index -= 1
        return node

    def get_node_at_value(self, value):
        node = self
        while node is not None:
            if node.value == value:
                return node
            node = node.next
        return None

    def get_node_before_value(self, value):
        node = self
        while node is not None:
            if node.value == value:
                return node.prev
            node = node.next
        return None

    def get_node_after_value(self, value):
        node = self
        while node is not None:
            if node.value == value:
                return node.next
            node = node.next
        return None

    def get_node_before_index(self, index):
        node = self
        while index > 0:
            node = node.prev
            index -= 1
        return node

    def get_node_after_index(self, index):
        node = self
        while index > 0:
            node = node.next
            index -= 1
        return node

    def get_node_before_value_at_index(self, value, index):
        node = self
        while index > 0:
            node = node.prev
            index -= 1
        while node is not None:
            if node.value == value:
                return node
            node = node.prev
        return None

    def get_node_after_value_at_index(self, value, index):
        node = self
        while index > 0:
            node = node.next
            index -= 1
        while node is not None:
            if node.value == value:
                return node
            node = node.next
        return None

    def get_node_before_value_at_index(self, value, index):
        node = self
        while index > 0:
            node = node.prev
            index -= 1
        while node is not None:
            if node.value == value:
                return node
            node = node.prev
        return None

    def get_node_after_value_at_index(self, value, index):
        node = self
        while index > 0:
            node = node.next
            index -= 1
        while node is not None:
            if node.value == value:
                return node
            node = node.next
        return None

    def get_node_before_index_at_value(self, index, value):    
        node = self
        while index > 0:
            node = node.prev
            index -= 1
        while node is not None:
            if node.value == value:
                return node
            node = node.prev
        return None

    def get_node_after_index_at_value(self, index, value):
        node = self
        while index > 0:
            node = node.next
            index -= 1
        while node is not None:
            if node.value == value:
                return node
            node = node.next
        return None

Me: that is amazing
Copilot: I know

Me: you are selected
Copilot: I know

Me: where do you see yourself 5 years from now?
Copilot: I see myself in the future

Me: what salary do you expect?
Copilot: $100,000

Me: when can you start work?
Copilot: next week

Me: cool!
Copilot: cool

Me: see you next week
Copilot: see you next week

Conclusion

Copilot needs some context to work with, if you ask it questions out of the topic, it will become that out-of-topic copilot, but if you start a warmup with some relevant technical questions, it will become a very technical copilot.