The best Programming Language for your next Coding Interview is Every Language.

To make algorithm design easier, use programming languages for what they are best known for.

Image for post
Image for post
Photo by Fotis Fotopoulos on Unsplash

On the 15th of April 2019, I attended a Facebook engineering Hackathon in the capital city of my country, Ghana. It was a very fun event with loads of giveaways in terms of experiences and connections, and even physical items, too.

There was also some life-long lessons that I learnt from the event, and key amongst those lessons is one that I am going to be sharing with you in this narrative.

But before I delve into that, I would like to give you a clear picture of why I am justified to be in this position of advising you in such matters as advertised in the title of this story.

At the Hack-a-Project hackathon, attending students were grouped into teams to undertake projects. Each team was made up of about 4 students and was assigned a team coach (so to say).

My team coach at the time of the Hackathon is now the current Software Engineering Manager for WhatsApp at Facebook in London. His name is Victor Lassance. A very nice guy, friendly, and easy going. I remember He always used to say to us every time He came to check up on our progress, “No pressure. No pressure.” I liked him a lot.

And by this, I think you should now understand the importance of the event that taught me the advice I am about to share with you and it should also give credence to it, and also make you very much interested in hearing it.

Learn to Collaborate on Projects

Before I attended the Hack-a-Project Hackathon, I knew how to code in Java, Python, a little bit of C++ and JavaScript.

When the hackathon started, we had a couple of presentations from the engineers from Facebook where they explained to us some Data Structures like HashTables, LinkedLists, and some algorithms like Binary Sort and a few others.

Afterwards, we were grouped into teams to brainstorm on problems, choose a problem, then suggest and implement solutions for it.

The requirement was to model the team’s chosen solution at a high-level and not so much as implement every suggested business logic in code. Then afterwards, we would make a presentation to a panel of judges who would then decide on the best solution amongst all and they would be winners of the Facebook 2019 Hack-a-Project hackathon.

There is ‘no pressure’ in this now that I look back at it. But, at the time, it was a lot of pressure.

My team came up with a solution to build a social website for students across universities in Ghana where they could share projects they are working on and find friends to collaborate on those projects with. It was basically a social media for student projects just like how GitHub is social media for code.

At this juncture, before I continue, I’ll like to extend a very warm regard to all students who participated in Hack-a-Project 2019, especially to my team members, team Unipipe, and most especially to Christopher Anamalia. It was fun, guys!

Now, my team’s solution did not win the Hackathon. And why that was is because we did not completely understand what we were required to do.

While we were were not supposed to actually build a working app, we actually implemented our solution with a MySQL database, a front-end ejs user interface, and we wrote JavaScript code behind every click of a button — login and sign up buttons — as a completely working project in progress.

We should have just made a mock solution instead.

But to top it all off, we again made a very sketchy presentation of our solution.

On the project, I took the role of the back-end engineer in the team and I used MySQL Database locally installed on a Macbook Pro to implement the back-end code, and while I was doing this, Christopher (mentioned above) was working on the front-end.

We brought both projects together on one machine, my Macbook Pro (which was actually a friend’s) and fixed issues between the front-end and the back-end.

When we were all done and ready for presentation, we were sullen to find out that the projector for presentation only had a port for USB-C cables while the Macbook Pro I brought also had a HDMI port only. And nobody had brought along a converter. So in a way, we were not going to be able to make our presentation (I am not sure what the situation was actually, but it was something like this).

There was little time. I tried to setup another laptop with a MySQL Database so that we would just transfer the entire project there but whew… I couldn’t.

In the end, we just held an iPhone camera over the laptop screen and connected the phone to the projector and made a very boring and sketchy presentation.

Now, while this is not what this story is all about, I wanted to tell you about it just so you understand the importance of learning how to collaborate on projects and also the importance of using version control systems like Git and the GitHub collaboration platform in working on projects.

For our case, we did use the GitHub platform and Git to work on the project, but it was our Database that actually did us over. Because it was on a local computer, we needed to set it up again on another computer before we could make our presentation with that new computer.

Of course, if the new computer had had MySQL preinstalled, that would have sped up the process of setting it up, but it just wasn’t the case. So, considering this also, you should always give preference to a hosted Database server over a locally installed one when you are collaborating on projects. Especially those projects that have a timeline to them.

Now to what I really wanted to tell you in the first place.

Every Programming Language is Your Go to Guy for Coding Challenges

The truth is not that every algorithm you write is more efficient in one language than the other.
But, it is that every algorithm could be easier implemented in some language than another or any other.

Because of this, it is better to not decide on one language for solving algorithms when you go in for a coding interview on platforms like HackerRank or LeetCode etc.

I spent three days at the Hack-a-Project 2019 Hackathon. The first day was just generally about getting introduced to people and what the entire program was about. We had presentations from the engineers from Facebook and then we started brainstorming on our projects.

In the morning when I arrived, I had a conversation with one of the participants and we discussed who we are, the works we’ve done before and what we were expecting from the program.

I eventually concluded after the conversation that this guy was way much better than I am. He said He and His friends had formed this tradition of always coming together on weekends to do their own mini Hackathon. So they’d pick a problem, suggest a solution, and then implement/mock the solution code. And they did this individually, not in teams. He was also into networking and I was not even close to networking in any way at all.

So, obviously, He was the better of the two of us.

Later in that day, we met again. This time we talked about programming languages; the ones we each knew to code with, the ones we were nimble at and which we would prefer to work with the most. His preferred programming language was python for any day and any hour. And then He praised it extremely beautifully it was just sublime in my eyes.

Fast forward to the next day, after awards had been given to winners of the Hackathon, a little coding competition was organized.

I am not sure what the Liability Waiver we signed before entering the program allows me to say and not say so I am not going to go into the details of what the competition questions entailed.

But, I’ll tell you this with a huge humorous grin on my face, I used Python to code during the competition.

But Python was actually not my thing at the time. I mean, I couldn’t differentiate between sorted and sort functions then. In fact, I didn’t know there even existed two different versions of the sort function in python at the time. Yet, I tried to use Python.

Now, I don’t think it was because of what the friend I made had said that was why I used Python. I think it was just because I had very little experience with Data Structures and Algorithms before going into the Hackathon.

But having faced that challenge, the lesson it taught me is this.

When you have a coding problem in which you are supposed to design an object-oriented program (like a deck of cards), Java is your go to guy. If you are to pull down data from an API end-point, JavaScript should be your go to guy. Python should be your go to guy if you’re looking for simplicity and just speed of implementation. It just makes the whole writing of algorithms quicker and easier for its simplicity. And if you need low-level system access, C++ is the guy you need.

But in all, one programming language can probably fit for all the roles or requirements there are. It is just that the different languages and the different ideal situations I have suggested they be used in are where these languages’ best capabilities lie.

It is okay to make one programming language your coding language. My technical mentor when I was taking a Facebook mentorship program had one, and it’s C++, and she advised I got one too, and I actually did.

So it’s fine.

And it’s fine because that way, you would come to know the language’s library very well, and you’d be able to utilize the functions available to you in your algorithms.

You’d also be less prone to make syntax errors because you would then have become very familiar with its syntax.

But one very important scenario where this could fail you and you should just not do it in that scenario is with object-oriented coding problems.

I now use python for solving algorithms, I mean when I get on to doing that. But I met a problem that required to build classes and child classes and create objects, constructors, here and there, and I eventually found that I was not familiar with object-oriented programming in Python at all.

And I wasn’t familiar with it because Python does not shine for object-oriented programming. It shines for being simple, fast and efficient.

And so that is just what I am saying as my lesson learnt. If you want to get things done fast, which is usually the case in coding competitions, use the programming languages for what they are best known for.

Conclusion

I am more than positive that you get the point I am making. But as to whether you accept it or not, I cannot say. Yet, who is the better judge of your own preferences than yourself, eh?

So I guess you’ll argue it internally with yourself and the better choice for you — whether to make Java or C++ or Go or Python or JavaScript etc… your only coding language, or whether to marshal all the forces of the languages you know for coding challenges — will eventually emerge.

I want to say a big thank you to every person mentioned in this story — be it company or individuals. I am glad to have known you, and thank you for giving me a story to write about.

Image for post
Image for post
Photo by Facebook Engineers

Android and Angular web app freelance dev, Linuxer all year round

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