Texas Instruments interview question

Implement graph from scratch in any language