X Close

UCL Student Blog



Review: Coding Practice Websites – HackerRank, LeetCode OJ and TopCoder

By Neema Kotonya, on 4 January 2016

Autumn term is the time most university students apply for summer internships, and if we are lucky we will either be called for interviews during this term or during the next term. For computer scientists like myself (and some engineering students), these interviews are are likely to feature a a segment that tests our coding ability, especially if we are applying for a software development role. Coding interviews are known to be unpredictable and often feature very challenging problem-solving tasks. On account of this, it’s important that candidates prepare, and the best way to do this is by practising problems, which test their knowledge of algorithms and data structures.

There are a number of websites that offer coding practice resources. I will be reviewing three of them in this article: LeetCode Online Judge, TopCoder and HackerRank, but I will also include links to other useful sites at the end of the post.

Top Coder is an established and well-respected competitive coding website. Employers such as Amazon, Facebook, IBM, Microsoft and Salesforce use the website for crowdsourcing. The website also hosts hackathons where users can compete against each other for cash prizes. What I like about Top Coder is that it gives you the option of registering with their GitHub accounts, as well as the usually options of creating an account with them or using your Facebook or Google accounts, but this is not a unique feature and many competitive coding websites offer a similar registration option. There is also a wide range of content on website, however this can also make it tricky to navigate and find out where to go for algorithm and data structures revision. I would advise starting with the Single Round Matches: Practice Problems.

In this section problems are classified by difficulty (easy, medium and hard), which determines their points-value. Clicking on a problem opens up the problem area, which gives you a description of the problem, a list of constraints, test cases and other useful information for solving the puzzle. TopCoder also provides an editor, which supports Java, C++, C#, Visual Basic and Python. Note: you will most likely need to expand the coding area to view all the language and line numbering options on your browser.

Image of TopCoder Problem Area

HackerRank boasts a database of over 800 problems and support for over 30 programming languages. Like TopCoder it also allows users to log in using their GitHub account, but the logging in/registering process is a lot quicker. I think the website itself has a great UI overall. When you first log in, you are asked to pick areas of interest so that you can target your coding practice. This is a great feature, though the sheer number of options can be slightly overwhelming!

Users have the option of selecting problems from a multitude of domains, these could be topics like mathematics, algorithms and data structures, or languages like Python, Java and C++. This allows you to hone in on the topics with which you feel less confident. There are also a number of warm-up excises to ease you in. As the name HackerRank suggests, the more problems you solve the more points you earn, and these points are converted into a rank, which gives you an indication of how well you are performing compared to all the other competitors on the website.

Image of HackerRank Options

Image of HackerRank Coding Environment

Last but not least there is LeetCode. This is website I regularly use for my interview preparation. I like it because it is simpler and not as “busy” as HackerRank or TopCoder. There are not as many problem sets as either of the other two websites, and some of the problem sets are only available to paying customers, but I still think that there are enough challenging problems for an interview candidate to sink their teeth into. Also, the problem statements are not as long-winded as those on TopCoder, and in my opinion as the problems are more in line with the questions you are likely to be asked in a coding interview. Furthermore, it’s not necessary to register an account in order to use the website’s resources.

The coding environment provided on LeetCode supports C++, C#, C, Java, JavaScript, Python and Ruby.

LeetCode Problem Sets

Image of LeetCode Coding Environment

In summary, I would say that there are no better or worse coding websites, some are simply better suited to a specific purpose. If you are interested in tackling challenging problems, but don’t want to be given too much guidance I would advice trying LeetCode. For more more niche topics I would recommend HackerRank, and if you are interested in longer and rigorous problem sets TopCoder is the best site for you.


Resources mentioned in the blog post

  1. Hughes, J et al. (2015). TopCoder. [online]. Available from: https://www.topcoder.com/ [Accessed: 21/12/2015]
  2. Ravisankar, V et al. (2015). HackerRank. [online]. Available from: https://www.hackerrank.com/ [Accessed: 21/12/2015].
  3. Unknown (2015). LeetCode Online Judge. [online]. Available from: https://leetcode.com/problemset/algorithms/ [Accessed: 21/12/2015].

Other useful resources

  1. Miller, B. Ranum, D. (2011). Problem Solving with Algorithms and Data Structures Using Python. [interactive e-book]. 2nd Edition. Runestone Interactive. Available from: http://interactivepython.org/runestone/static/pythonds/index.html  [Accessed: 21/12/2015]
  2. GeeksforGeeks (2015). GeeksforGeeks – A Computer Science Portal for Geeks. [online]. http://www.geeksforgeeks.org/ [Accessed: 21/12/2015]

A Brief History of Programming Languages: A Review of “Codes That Changed the World”

By Neema Kotonya, on 9 December 2015

As part of the Make It Digital campaign, in April BBC Radio 4 first broadcast a series about “Codes That Changed the World,” in which journalist Aleks Krotoski presents a history of programming languages divided into five easily digestible 15-minute sound bites. The first four episodes focus on a different programming language in chronological order from Fortran, which is widely considered the progenitor of an modern computing languages, to Java, a language most of people have heard of even if they know little about it.

Family Tree of Computer Languages

Krotoski introduces key computing terms such as compilers, interpreters, low level languages, high level languages and functional programming languages using uncomplicated language and real-world analogies. I found this refreshing because often computer science theory is presented using mathematical notation and complex technical terminology, which can be daunting for beginners and non-engineers.

The episodes feature interviews with women programmers like Barbara Alexander (Ep 1, Fortran), Jill Clark (Ep 2, Cobol), Sophie Wilson (Ep 3, Basic) and Haskell coder Elise Huard. This disrupts the notion that computing and the tech industry is solely the realm of men and highlights the contributions made by women in tech. Although, this does not discount the fact the barriers-to-entry were high for women technologists in the fifties and sixties. Alexander remarks that upon graduating from Cambridge University she was told at the women’s job appointments board that she “must want to teach since she had done maths.” She firmly told them that no, she did not, and took herself to the men’s appointments board where she landed her first job as a Fortran programmer.

Also, a large part of the Cobol episode is dedicated to the work of Grace Hopper, an American computer scientist who was arguably one of the most influential women in twentieth century computing. Hopper sat on the committee responsible for developing Cobol (Common Business-Oriented Language) and strongly advocated that the language should be as close to written English as possible so as to encourage as many people as possible to take up programming. Hopper gives her name to the world’s largest celebration of women in computing and the London Hopper Colloquium, a conference for women computer science researchers that is co-hosted by UCL and the British Computer Society.

In the final episode Krotoksi and technology writer Rupert Goodwins discuss how we now have specialised programming languages, which are developed to perform niche jobs. They also explain how the existence of very large code bases and how the management of these code bases is essential for them to work properly and to avoid the high costs of system failure.

As a computer science student, I thought that the radio series was very informative and well-produced. Although, I did find the background music, what sounded like punch-card machine in the earlier episodes that evolved into electronic dance music and a computer-synthesised voice singing code, slightly off-putting and unnecessary. Overall, I’m really pleased that the BBC made a show about coding and the history of computer science.

Rating: 4 out of 5 stars.

Codes That Changed The World Episodes 1 to 4 (from Box of Broadcasts):

  1. Codes That Changed the World: Fortran, [radio programme, online], Prod. credit Peter McManus, Prod. British Broadcasting Corporation, Prod. country United Kingdom of Great Britain and Northern Ireland, 13:45 6/4/2015, BBC Radio 4, 15mins. http://bobnational.net/record/287133, (Accessed: 05/12/2015).
  2. Codes That Changed the World: Cobol, [radio programme, online], Prod. credit Peter McManus, Prod. British Broadcasting Corporation, Prod. country United Kingdom of Great Britain and Northern Ireland, 13:45 7/4/2015, BBC Radio 4, 15mins. http://bobnational.net/record/287134, (Accessed: 05/12/2015).
  3. Codes That Changed the World: Basic, [radio programme, online], Prod. credit Peter McManus, Prod. British Broadcasting Corporation, Prod. country United Kingdom of Great Britain and Northern Ireland, 13:45 7/4/2015, BBC Radio 4, 15mins. http://bobnational.net/record/287135, (Accessed: 05/12/2015).
  4. Codes That Changed the World: Java, [radio programme, online], Prod. credit Peter McManus, Prod. British Broadcasting Corporation, Prod. country United Kingdom of Great Britain and Northern Ireland, 13:45 7/4/2015, BBC Radio 4, 15mins. http://bobnational.net/record/287132, (Accessed: 05/12/2015).

Also, all the episodes can be downloaded as podcasts from the BBC:

  1. BBC iPlayer Radio Codes That Changed the World [podcast, online], Prod. credit Peter McManus, Prod. British Broadcasting Corporation, Prod. country United Kingdom of Great Britain and Northern Ireland, 10/4/2015, BBC Radio 4, 75mins.  http://www.bbc.co.uk/programmes/b05qqhqp/episodes/downloads (Accessed: 5/12/2015)