Visa Inc. interview question

question on stacks and graphs