Meta logo

Meta Software Engineer System Design Questions

39 practice questions for Meta Software Engineer interviews

Meta software engineer interviews cover algorithms, data structures, system design, and coding problems drawn from real interview rounds.

All Roles Software Engineer Backend Engineer Frontend Engineer Full Stack Engineer Mobile Engineer Data Engineer Data Scientist ML Engineer DevOps Engineer DevOps Engineer Product Manager SRE Security Engineer Engineering Manager Data Analyst UX/UI Designer QA Engineer

No verified questions yet for Meta.

system design Hard caching #1

1. [OA] LRU Cache — Implement the caching system for Instagram feed

Instagram relies on providing quick access to user feeds, which requires an efficient cache management system. Design an LRU Cache to ensure optimal performance.
Class LRUCache:
- LRUCache(int capacity): Initializes the cache with a positive size capacity.
- int get(int key): Returns the value of the key if the key exists, otherwise returns -1.
- void put(int key, int value): Update the value of the key if present, or add the key-value pair if not existing. When the cache reaches its capacity, it should invalidate the least recently used item before inserting a new item.
Example 1:
Input: LRUCache(2); cache.put(1, 1); cache.put(2, 2); cache.get(1); cache.put(3, 3); cache.get(2); cache.put(4, 4); cache.get(1); cache.get(3); cache.get(4);
Output: 1; -1; 3; 4
Constraints:
- capacity is always positive and will not exceed 1000
- The operations get and put will always be called with valid keys.

Related Meta Software Engineer interview prep

Start practicing Meta questions

Sign up for free to access walkthroughs, AI-generated questions, and more.

Get Started Free