As a first iteration of our programming competition, we will start slow, nice and easy. Here are some exercise. You are expected to do them individually, so I could know who is participating and get an idea of your skill levels. Team assignments will come next.
1) You are asked to implement a data structure that stores integers and that defines three operations:
-
push(): appends a value to the end (tail) of your structure.
-
pop(): returns the tail value of your structure, and removes it from the structure.
-
getMin(): returns the lowest value of the structure.
These operations should execute at
constant time, regardless of the size of the structure.
This exercise was given to me in my interview with Google.
2) The prime factors of 13195 are 5, 7, 13 and 29.
You are asked to give a code that ouputs the largest prime factor of the number 600851475143.
3)
Here's a text written in bbcode. Download it. Create a program that parses this text and transofrm it into an HTML valid document. Program should take input as a File.
Rules
- Each exercise is worth 10 points.
- There's a list of the allowed languages. Other languages are tolerated but at the cost of
three points per exercise. Allowed languages: C, C++, C#, PHP, Python, Java, Ruby, Perl, bash, LISP, OCaml.
- There will be heavy penalties for code that does not compile or return obvious run-time errors. That means you are expected to turn in a complete code, not simply a chunk of code that roughly does the trick.
- 30% of the grade goes to code clarity, that means comments, naming of variables, indentations, ... I will be reading all your codes, help me remain sane.
- Your solution should be sent to
lebgeeks.rahmu at gmail.com in the form of a zipped package containing your source codes and a README file giving your nickname and your answer to the exercises.
- Deadline to send me your solutions is
Wednesday, October 20th 2010, 2PM Beirut time. No use sending your solution after the deadline, it won't be graded.
- 3 bonus points for the first one to send me his/her solution. However, once your code is sent, you cannot correct it anymore.
Grades will be announced during the course of next week, as well as a date for the next exercises.