ServiceNow Interview Question

Weighted graph walking piece in JS or Java.