CS50: How to take Harvard’s coding course online
CS50, Harvard’s over-subscribed and influential coding course for the world’s most elite minds is, unsurprisngly, incredibly hard to get on. That’s why Harvard gives you access to the bountiful CS50 resources online for free or as a paid course if you want to recieve a formal certificate of your skills at the end.
If you’re wondering how to access CS50 content online, there are four ways:
Take CS50 online: Harvard Extension School
Harvard’s own remote-learning branch, the Harvard Extension School, offers various flavours of CS50. The semester-long CSCI E-50 Intensive Introduction to Computer Science course offers four credits towards a degree and costs $2,400. Space is limited to 200 students and courses are heavily oversubscribed, however. Keep an eye on extension.harvard.edu for when registration opens for next year’s autumn and spring courses.
Take CS50 online: edX
Alternatively, the course is offered through the online education site edX, where you can tackle it at your own pace. According to the edX page for CS50, “students who earn a satisfactory score on nine problem sets (i.e. programming assignments) and a final project will receive a certificate from HarvardX”. Students can take the course for free, but must pay $90 if they wish to receive “an instructor-signed certificate with the institution’s logo to verify your achievement and increase your job prospects”.
Take CS50 online: iTunes U
The course and all of its materials is – like many other Harvard courses – also available on Apple’s iTunes U. You can download the app for free from the App Store (either on iPhone, iPad or Mac) and search for CS50 in the catalogue. All of the video lectures, problem sets, quizzes and other materials are in the pack, although a relatively recent redesign of iTunes U has made this mass of material much harder to navigate than it once was.
Take CS50 online: YouTube
The final way is to simply watch all the lectures – which is a worthwhile pursuit in itself – on YouTube. All of the lectures from the 2015 Computer Science 50 course can be found on the Harvard channel. There’s more than 20 hours of footage to work through, although each individual lecture is no more than an hour or so in length.
READ NEXT: Learn to code in the UK for free
Could you pass CS50?
Worried you don’t have the mental nouse to take on Harvard’s elite course? Here are some sample questions direct from Harvard’s course. Don’t worry, they don’t make sense to me either.
1: The Vigenère cipher
“Your final challenge this week is to write, in vigenere.c, a program that encrypts messages using Vigenère’s cipher. This program must accept a single command-line argument: a keyword, k, composed entirely of alphabetical characters.
“If your program is executed without any command-line arguments, with more than one command-line argument, or with one command-line argument that contains any non-alphabetical character, your program should complain and exit immediately, with main returning 1 (thereby signifying an error that our own tests can detect).
“Otherwise, your program must proceed to prompt the user for a string of plaintext,
p, which it must then encrypt according to Vigenère’s cipher with k, ultimately printing the result and exiting, with main returning 0.
“As for the characters in k, you must treat A and a as 0, B and b as 1, … , and Z and z as 25. In addition, your program must only apply Vigenère’s cipher to a character in p if that character is a letter. All other characters (numbers, symbols, spaces, punctuation marks, etc.) must be outputted unchanged.
“Moreover, if your code is about to apply the jth character of k to the ith character of p, but the latter proves to be a non-alphabetical character, you must wait to apply that jth character of k to the next alphabetical character in p; you must not yet advance to the next character in k. Finally, your program must preserve the case of each letter in p.”
2. The Game of Fifteen
“The Game of Fifteen is a puzzle played on a square board with numbered tiles that slide. The goal of this puzzle is to arrange the board’s tiles from smallest to largest, left to right, top to bottom, with an empty space in the board’s bottom-right corner.
“Implement God Mode for this game.
“First implement init in such a way that the board is initialised to a pseudorandom but solvable configuration. Then complete the implementation of draw, move, and won so that a human can actually play the game.
“But embed in the game a cheat, whereby, rather than typing an integer between 1 and d2 – 1, where d is the board’s height and width, the human can also type GOD to compel ‘the computer’ to take control of the game and solve it (using any strategy, optimal or non-optimal), making, say, only four moves per second so that the human can watch.
“Presumably, you’ll need to swap out GetInt for something more versatile. It’s fine if your implementation of God Mode only works (bearably fast) for d ≤ 4; you need not worry about testing God Mode for d > 4. Oh, and you can’t implement God Mode by remembering how init initialised the board (as by remembering the sequence of moves that got your program to some pseudorandom but solvable state). Nice try.”
All problems copyright of Harvard University. Full problem sets are published at: cs50.harvard.edu