FastPrepJump Game IV
Problems/Jump Game IV

Jump Game IV

Zomato / Eternal logoZomato / Eternal● HardFULLTIMEONSITE INTERVIEW

Updated Oct 2026

QuestionFunctionExamples

Problem statement

Source note: This problem is backed by a real Zomato onsite interview report that directly linked the named Jump Game IV task. The report did not restate the exact interface, examples, or constraints. The core task match is about 95%.

Given an integer array arr, start at index 0. From index i, one jump may move to i - 1, i + 1, or any index j such that arr[i] == arr[j].

Return the minimum number of jumps needed to reach the last index. Indices outside the array are not valid destinations.

Function

minJumps(arr: int[]) → int

Examples

Example 1

arr = [100,-23,-23,404,100,23,23,23,3,404]return = 3

One shortest route is index 0 -> 4 -> 3 -> 9.

Example 2

arr = [7]return = 0

Source note: Source images are source-neutral excerpts of author-reported interview prompts.

More Zomato / Eternal interview questions

  • Find the Two Unique NumbersONSITE INTERVIEW · Seen Oct 2026
  • Flipping MatrixONSITE INTERVIEW · Seen Oct 2026
  • LFU CacheONSITE INTERVIEW · Seen Aug 2026
  • Special KeyboardONSITE INTERVIEW · Seen Jul 2026
  • Detonate the Maximum BombsPHONE SCREEN · Seen Dec 2026
  • Friend Circles and Redundant ConnectionsPHONE SCREEN · Seen Sep 2026
  • Maximum Production Within PowerOA · Seen Jul 2026
  • Rearrange Songs by AuthorOA · Seen Jul 2026
  • Robot Warehouse OptimizationOA · Seen Jul 2026

Similar questions at other companies

  • Largest Island After One FlipOracle · ONSITE INTERVIEWOracle interview questions
  • Bus RoutesBloomberg LP · PHONE SCREENBloomberg LP interview questions
  • Linked Merchants Within Two HopsStripe · PHONE SCREENStripe interview questions
  • Shortest Path Through Numbers Sharing a DigitGoogle · PHONE SCREENGoogle interview questions
  • Fewest Buses with the Full RouteMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
  • Minimum Bus Routes to a DestinationPinterest · PHONE SCREEN · ONSITE INTERVIEWPinterest interview questions
  • Find Duplicate Files in a FilesystemHarvey · PHONE SCREEN · ONSITE INTERVIEWHarvey interview questions
  • Find All People With SecretIDFC Bank · ONSITE INTERVIEWIDFC Bank interview questions
  • Word LadderGoldman Sachs · PHONE SCREEN · ONSITE INTERVIEWGoldman Sachs interview questions
  • Word Ladder II: All Shortest TransformationsPeopleStrong · ONSITE INTERVIEWPeopleStrong interview questions
All Zomato / Eternal interview questionsSee Zomato / Eternal hiring insights
Saved
class Solution {
    public int minJumps(int[] arr) {
      // write your code here
    }
}
Checking account…