Algorithm · OpenAI · Hard
Historical Follow Graph Hard · Topics · Company Tags · Hints Design a system that manages a directed graph of user follows, where every write operation generates a new historical snapshot. The graph begins empty at snapshot 0. You must process a series of commands that either modify the graph and advance the snapshot counter, or query the graph at a specified previous snapshot. The commands are: FOLLOW u v If the edge $$u \to v$$ is not already present, add it. Then advance…
Checking your access…