Google Interview Question

A system design question, Graphs, Stack