← Barclays questions

Max length edge from index array

Filed under Barclays

Given an array 'arr' where arr[i] represents a directed edge from i to arr[i], find the index 'i' that leads to the longest path without creating an explicit adjacency list.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Barclays questions

Collected from public candidate posts and coding forums. Updated Nov 2026.