Object-Oriented Programming · OpenAI · Hard
Design an in-memory social-network component. Users are identified by integers in the range $$0$$ to $$n-1$$, where $$n$$ may be large. The component maintains a directed follow relation — writing $$a \rightarrow b$$ means that user a follows user b, and this implies nothing about $$b \rightarrow a$$. On top of that relation the component must answer three families of requests: plain membership questions, historical membership questions against frozen snapshots of the graph,…
Checking your access…