Apple Coding Interview: Designing LFU Cache with TTL write behind (I bombed it)

Ex-FAANG here, laid off about a year ago. (3 yoe)

After several months I got an Apple coding interview. The interviewer asked me to design and implement an LFU Cache with TTL.

At first I honestly struggled to fully understand the requirements. LFU by itself is already a pretty involved design problem, and layering TTL on top made it exponentially harder to reason through all the edge cases.

I spent a long time thinking through the approach while the interviewer patiently waited. When I finally started coding, I kept running into logic issues. He gave hints, walked through examples, and gently nudged me in the right direction, but I couldn’t put the pieces together. Every time I fixed one thing, another problem popped up.

The entire hour felt like I was digging myself deeper into a hole.

When the interview ended, I already knew it was not going well. I walked away thinking, “Yeah, that’s probably a rejection.

This has been a case for me in previous interviews also.

Anyone here could point me right directions (other than leetcode) to ace these interviews ? and help me with referral if possible

reddit.com
u/RevolutionaryStrider — 27 days ago