How I passed Goldman Sachs' difficult Hackerrank test
If you apply for a graduate technology job at Goldman Sachs now, you're going to need to complete a screening test on Hackerrank - like plenty of other banks, the firm requires you to solve a series of coding challenges as part of its application process.
You may have read that Goldman Sachs' Hackerrank test is easy. It's not. Believe me - I have taken it, and passed it, and it is as challenging as they come. As far as I can work out from talking to the other people on my course (computer science, top London university), only 10% to 20% of people make it through.
The first thing you need to know (and this applies to all Hackerrank tests) is that the problems your friends got, may not be the same as the problems you encounter. Questions differ from person to person (otherwise you could easily prepare ahead). If you're lucky, you'll get questions you can answer. If you're unlucky you won't.
That said, Goldman Sachs always seems to ask a range of questions that cover dynamic programming and graph theory. A particularly common problem is the 'coin change problem,' where you're asked to imagine that you're working on the cash counter at a funfair and that you have different coins in infinite quantities. The value of the coins is already given and you have to determine the number of ways of providing change for a particular number of units given the coins available. This requires dynamic programming and is one of the more challenging questions you're likely to come across in Goldman's test.
Another banking problem, and this isn't specific to Goldman, is the matrix rotation question. Here, you're asked to imagine that you have a 2D matrix, A, of a set size, and positive number R. You have to rotate the matrix R times and then print it. Your rotation needs to be in a clockwise direction.
It is possible to prepare for the Hackerrank problems posed by Goldman and other banks. Most tests will be specific to the coding language you choose (eg. Python, Java or C) and you simply need to make sure you're familiar with data structures in your given language and comfortable with designing simple algorithms on the spot (eg. searching and sorting algos). If you can do this quickly, you're half way there.
Whichever language you're coding in, you will need to be able to create effective algorithms that are also simple and efficient. The questions you're asked to solve will usually involve the use and manipulation of data structures and will have a strong focus on algorithmic design. You typically write a program that is put through a series of test cases that automatically evaluate how many good your algo is. The test is timed, so you need to be able to code under pressure. You also need to be accurate and to keep silly bugs to a minimum - ie. not forgetting a semi-colon or indenting wrongly in Python.
Personally, I practiced a lot - and this helped me make it through the Goldman tests. The good news is that if you can make it through the Goldman Hackerrank test, you should have no problem with the tests set by technology companies, which tend to be harder still. One of the most difficult tests I've come across is that set by Improbable, the company that makes the SpatialOS games development platform. If you think the Goldman test is hard, you'll have no chance getting through this.
Eswar Laghari is a pseudonym
Have a confidential story, tip, or comment you’d like to share? Contact: firstname.lastname@example.org
Bear with us if you leave a comment at the bottom of this article: all our comments are moderated by human beings. Sometimes these humans might be asleep, or away from their desks, so it may take a while for your comment to appear. Eventually it will – unless it’s offensive or libelous (in which case it won’t.)