Apple Interview Question

Solve a design problem using Graph theory. Rewrite one of the core Java APIs.