Efficient Order Log Storage February 6, 2025 Data Structure / dsa / Twitter You manage an e-commerce website and need to keep track of the last N order IDs in a log. Design a data structure that supports the following operations efficiently:
Select a Random Element from a Stream February 3, 2025 Algorithm / dsa / Twitter You are given a stream of elements that is too large to fit into memory. Write an algorithm to select a random element from the stream with equal probability
Autocomplete System Implementation January 10, 2025 dsa / DSA Sheet / Twitter Build an autocomplete system that, given a query string s and a set of possible query strings returns all strings from the set that start with s as a prefix.