What you need to know is that you only have to edit two files. One is the Test file and is obvious from looking at the code. The other file is called DefaultEventManagerImplementation or something similar. This is the class that you have to understand and focus all your time on understanding what is going on in here. When i went for the interview i was taken to a room, handed a bit of paper describing the system, and told i would be left alone to look at the code for 10 minutes. Your pair then comes back into the room and starts drip feeding questions. ( The point here is you do not know how many questions he is going to ask ). In the 10 minutes alone, i had read the paper ( not very useful ) and started clicking around the 10 or so classes that are provided to try and understand the code. I had no real understanding of the code within this first 10 minutes. As you are then asked your first task, you feel obliged to start making changes. This was my mistake. My advice to anyone is spend the first 30 minutes understanding the DefaultEventManagerImplementation class. Tell your peer you want to understand this before hacking at the code. He can go if he wants, but dont touch the code until you understand this class. If you do this, you will sail through the four or five tasks which are rather simple, and finish within the hour. If you do what i did, and start modifying things after 10 minutes ( which they try to make you ) you end up confused and making mistakes as you are not familiar enough to confidently make the changes. I got everything working but took about 1hr 20 mins. If i spent 30 mins up front i would have killed it in an hour, easy. DO NOT TOUCH THE CODE until you are comfortable with what is going on.
Thanks for sharing. Do you mind sharing a little bit more about that 'DefaultEventManagerImplementation' ? e.g. the existing methods implemented already and their logic; the expectation of your changes there ?
My first solution was to use a sequential search - O(1) space and O(n^2) time. My second solution was to use a bitmap index, assuming we could allocate enough words to represent the entire range of integers as sequential bits - O(n) worst case time. Other possible solutions included doing an on disk bucket sort using in place quicksort (or mergesort) as the sub-sort.