PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Uber

Solve Prime Jumps and Pipeline Scaling

Last updated: May 2, 2026

Quick Overview

This question evaluates algorithmic problem-solving skills in constrained path optimization and resource-allocation throughput maximization, including concepts such as graph modelling with prime-step constraints, dynamic programming, number-theoretic reasoning, and combinatorial optimization.

  • medium
  • Uber
  • Coding & Algorithms
  • Software Engineer

Solve Prime Jumps and Pipeline Scaling

Company: Uber

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: medium

Interview Round: Technical Screen

An online assessment contains two independent coding problems. Solve both. ### Problem 1: Prime-Constrained Score Jump You are given an integer array `score` of length `n` and an integer `k`. You start at index `0`, and your initial total is `score[0]`. On each move, you may jump from index `i` to index `j` only if: - `j > i`, - `j - i <= k`, and - `j - i` is a prime number. When you land on an index, you add `score[j]` to your total. Return the maximum total score you can obtain when reaching index `n - 1`. If index `n - 1` cannot be reached, return `null`. Assume `score` may contain negative values. ### Problem 2: Maximize Pipeline Throughput You are given a serial processing pipeline with `n` services. Service `i` has: - base throughput `t[i]`, and - expansion cost `cost[i]`. The pipeline throughput is the minimum throughput among all services. You may expand any service any nonnegative integer number of times. If service `i` is expanded `x` times, then: - its throughput becomes `t[i] * (1 + x)`, and - the total money spent on that service is `x * cost[i]`. Given a total budget `budget`, return the maximum possible overall pipeline throughput.

Quick Answer: This question evaluates algorithmic problem-solving skills in constrained path optimization and resource-allocation throughput maximization, including concepts such as graph modelling with prime-step constraints, dynamic programming, number-theoretic reasoning, and combinatorial optimization.

Related Interview Questions

  • Implement Minesweeper and Word Search - Uber (medium)
  • Implement Store Autocomplete - Uber (medium)
  • Implement Cache Eviction And Seat Assignment - Uber (medium)
  • Schedule Non-Overlapping Meetings Efficiently - Uber (hard)
  • Evaluate an Arithmetic Expression - Uber
Uber logo
Uber
Jan 30, 2026, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
1
0

An online assessment contains two independent coding problems. Solve both.

Problem 1: Prime-Constrained Score Jump

You are given an integer array score of length n and an integer k. You start at index 0, and your initial total is score[0]. On each move, you may jump from index i to index j only if:

  • j > i ,
  • j - i <= k , and
  • j - i is a prime number.

When you land on an index, you add score[j] to your total. Return the maximum total score you can obtain when reaching index n - 1. If index n - 1 cannot be reached, return null.

Assume score may contain negative values.

Problem 2: Maximize Pipeline Throughput

You are given a serial processing pipeline with n services. Service i has:

  • base throughput t[i] , and
  • expansion cost cost[i] .

The pipeline throughput is the minimum throughput among all services.

You may expand any service any nonnegative integer number of times. If service i is expanded x times, then:

  • its throughput becomes t[i] * (1 + x) , and
  • the total money spent on that service is x * cost[i] .

Given a total budget budget, return the maximum possible overall pipeline throughput.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Uber•More Software Engineer•Uber Software Engineer•Uber Coding & Algorithms•Software Engineer Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.