Amazon interview question

Basic DS questions: LRU cache, trees, count the islands.