I went to UIUC for CS ('14), in our Systems class we had one project where we had to write our own version of malloc() in C.
They made it into a competition and it was so much fun (graded on latency and efficient space usage). I remember the person who won was a PhD student who had to take the undergrad course as a prereq for some Grade level class.