coderz.py

Keep Coding Keep Cheering!

Efficient Order Log Storage

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:

February 6, 2025 | Data Structure, dsa, Twitter | No comments

Select a Random Element from a Stream

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

February 3, 2025 | Algorithm, dsa, Twitter | No comments

Autocomplete System Implementation

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.

January 10, 2025 | dsa, DSA Sheet, Twitter | No comments

Advertisement