roshane / addresscache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

alt text

Programming Exercise

Congratulations, you have passed the first phase of our interview.

On this second phase we are going to test your programming skills, so we have a exercise template writen in Java that you will need to complete. (you could easily change to a language of your preference)

Follow the instructions of the exam below, and produce the given results in any language of your preference.

The solution should be complete and production ready. Please do not write just the core code algorithm, leaving out e.g. error handling. Your code should be covered by unit tests. Feel free to use any kind of unit test framework

The exercise consists on implementing a mem local cache ready to be used on a multi threading context.

You're given an incomplete class AddressCache.java. The AddressCache has a max age for the elements it's storing, an add method for adding elements, a remove method for removing, a peek method which returns the most recently added element, and a take method which removes and returns the most recently added element.

Please complete the class and make sure all your unit tests pass :)

Good luck!


All material herein © 2005 – 2014 Agoda Company Pte. Ltd., All Rights Reserved.
AGODA ® is a registered trademark of AGIP LLC, used under license by Agoda Company Pte. Ltd.
Agoda is part ofPriceline (NASDAQ:PCLN)

About


Languages

Language:Java 100.0%