System DesignHard#151Design a distributed key-value store.Focus on data partitioning, replication for fault tolerance, consistency models, and handling node failures.
AlgorithmsHard#152Implement a function to check if a binary tree is balanced.Use a recursive function to check the height of each subtree; return false if the difference is more than one.
System DesignHard#153Design a URL shortening service like bit.ly.Consider efficient hashing, collision resolution, database schema, scalability, and API rate limiting.
Machine LearningHard#154Design a recommendation system for a large e-commerce platform.Use collaborative filtering, content-based filtering, or hybrid methods; consider scalability and real-time processing.
AlgorithmsHard#155Write an algorithm to find the median of a stream of numbers.Use two heaps (max heap for lower half, min heap for upper half) to maintain the median.
Distributed SystemsHard#156Explain the Raft consensus algorithm.Discuss leader election, log replication, safety, and how Raft achieves consensus in a distributed system.
NetworkingHard#157Optimize a global, high-traffic content delivery network.Use strategies like caching, edge locations, load balancing, and optimizing routing and data compression.
System DesignHard#158Design a chat application that can scale to millions of users.Consider websocket protocol for real-time communication, efficient message broadcasting, and scalable backend architecture.
Low-level SystemsHard#159Implement a garbage collector for a programming language.Understand memory management concepts like mark-and-sweep, reference counting, and generational collection.
System DesignHard#160Design a scalable notification system for a social network.Focus on system architecture, push vs. pull models, handling peak loads, database optimization, and message queuing.