GitHub Copilot vs Technical Interview

CoPilot is the coolest piece of tech I've seen in awhile.

AI is a fancy buzzword that just about everybody is bandying about these days. Most of the time, it's not quite the Jarvis that one might envision, but once in awhile, something comes along that makes me both really excited and yet apprehensive about the future.

The last time a piece of software wow-ed me was Google Assistant. Now, half a decade later (Google Assistant debuted in 2016), and GitHub CoPilot blew me away.

What is GitHub CoPilot

Essentially, it's an AI programmer that understands(sometimes), what you, the developer, is trying to accomplish and recommends a code snippet that's supposed to help you achieve it.

To do this, it needs 2 things:

My experience

I'd heard of CoPilot before - it was previously in beta, and I didn't think much about it. The idea was cool, but I scoffed at it: programming is a programmer's job, no way AI could replace us.

CoPilot came out of beta on 21/06/22, 4 days ago at the time of me writing this. It's $10usd/month, but free for students and open source developers. I figured I'd give it a try and see what the hype was about.

It's basically an extension, and requires very little setting up. You can write comments and let CoPilot generate the code for you, but it doesn't grasp complexities and nuances. It doesn't do your job.

But that's fine, and that's not the point. If it did, most of us would be out of jobs. (And that's kinda ironic)

Instead, it's a pair programmer, and it does a bang up job at that. It's something you just leave running in the background, and sometimes, it just recommends the exact thing you were trying to write. When that happens, hitting Tab and seeing it all pop into place feels absolutely amazing.

CoPilot vs Technical Interviews

Last night while I was trying to fall asleep, I had this super random thought: "Would CoPilot be able to complete the technical test I went through to get my current internship?"

It was a simple problem - which I humbly admit - I didn't manage to solve during the interview itself. (In my defense, at that point, I hadn't done any interview prep and was extremely rusty AND it was my first ever technical test.)

The problem was this: Given a string of "aabbbcccc", write a function to compress it such that it returns "a2b3c4". (You can give it a try and laugh at my incompetence)

The question swirled around my head and I couldn't sleep without knowing the answer.

I turned the lights back on and sat at my laptop, opening a new file in VSCode.

This is what I wrote:

## Given a string of aabbbcccc, write a function that compresses it into a2b3c4.

Then I created a function def compress(initialString): and waited, and just like that, CoPilot solved it.


Admittedly, the code wasn't perfect. It doesn't account for edge cases (I tried forcing it to return ab2c3 instead of a1b2c3 and failed), so there's definitely still a ways to go.

But for now, I'm still super impressed, and wish I could have used this during the interview... instead of me absolutely panicking and forgetting how to pop an element off an array, but that's a story for another day.

Closing thoughts

I think the $10usd/month makes some people balk, and I completely understand. I'm not convinced that I'd pay full price right now - it's still very much in its infancy. It's also more of a neat trick that works once in awhile and isn't likely to drastically speed up an average person's workflow.

That said, it works well for repetitive work. Writing test cases, generating fake data, cleaning up JSON's and parsing inputs are some places where CoPilot was able to predict accurately what I was trying to do and help out.

It's still far off from perfect, and I don't think programmers will ever be fully replaced by AI, but it's still amazing progress and I'm invested in its future.