Amazon Interview Question

topological sorting, word pattern, design a vending machine management system.