FastPrepFind the Path
Problems/Find the Path

Find the Path

LinkedIn logoLinkedIn● HardFULLTIMEOA

Updated Sep 2026

QuestionFunctionExamples

Problem statement

Given a graph of N nodes named with 1 to N and M bidirectional weighted edges. Find the path from 1 to N such that weight of maximum in the path is minimum and the number of edges in path won't exceed K.

Function

findThePath(N: int, edges: int[][], K: int) → int

Examples

Example 1

N = 4edges = [[1, 2, 4], [1, 3, 2], [2, 4, 5], [2, 3, 6]]K = 3return = 5

Note: I'm more than happy to make modifications if anything in the input seems incorrect. You can reach me in our Discord group! 😊 Possible routes from 1 to 4 is [1->2->3, 1->3->2->4] As the maximum in path 1 -> 2 -> 4 is 5 on the edge 2->4, while in 1->3->2->4 is 6 at edge 3->2.

More LinkedIn interview questions

  • Allocate Mailboxes with Squared DistanceONSITE INTERVIEW · Seen Nov 2026
  • Find Leaves of a Binary TreeONSITE INTERVIEW · Seen Nov 2026
  • Max Points on a LineONSITE INTERVIEW · Seen Nov 2026
  • Maximum Product of a Contiguous SubarrayPHONE SCREEN · Seen Nov 2026
  • Maximum Sum of a Contiguous SubarrayPHONE SCREEN · Seen Nov 2026
  • Merge Two Sorted ListsPHONE SCREEN · Seen Nov 2026
  • Sqrt(x)PHONE SCREEN · Seen Nov 2026
  • Total Years of Work ExperiencePHONE SCREEN · Seen Nov 2026
  • Explore an Unknown Grid and Find a PathONSITE INTERVIEW · Seen Nov 2026
  • Fire Station Response BillONSITE INTERVIEW · Seen Nov 2026

Similar questions at other companies

  • Sum Dynamic Weighted Tree DistancesJuspay · OA
  • Minimum Fuel Cost Between CitiesMicrosoft · OAMicrosoft interview questions
  • Drone Delivery with Battery Swap StationsCisco · OACisco interview questions
  • Optimal TransferSuperhuman · OASuperhuman interview questions
  • Minimum Travel Time With Periodic Fast RoadsAdobe · OAAdobe interview questions
  • Energy CrisisRubrik · OARubrik interview questions
  • Avoiding the Obstacles (IMC Sydney 🦪)IMC Trading · OAIMC Trading interview questions
  • Compute Number of LocationsMoney Forward · OA
  • Best Telescope SiteAtlassian · OAAtlassian interview questions
  • Cheapest Flight with Its PathAirbnb · OA · PHONE SCREEN · ONSITE INTERVIEWAirbnb interview questions

LinkedIn interview experiences

  • LinkedIn Senior MLE Interview Questions: 1 Experience
  • LinkedIn Staff AI Engineer Phone Screens: 1 Experience
  • LinkedIn Experienced MLE Onsite: 1 Experience
  • LinkedIn Coding with AI Interview: 4 Experiences
  • LinkedIn Experienced Infrastructure SWE Onsite: 1 Experience
All LinkedIn interview questionsSee LinkedIn hiring insights
Saved
class Solution {
    public int findThePath(int N, int[][] edges, int K) {
      // write your code here
    }

}
Checking account…