Index.com interview question

Closest neighbour problem. LRUCache.