Apple interview question

design lru followed by optimization