Minimum Energy Route Across a Network-on-Chip With Hop Limit

Last updated: November 29, 2026

Quick Overview

A Snapdragon network-on-chip is a directed graph of routers where each link has a non-negative energy cost. Find the minimum total energy route from a source block to a destination block that uses at most H hops (to meet a latency budget), and return the route.

Qualcomm
Coding & Algorithms
Software Engineer
Qualcomm
November 29, 2026
Software Engineer
Onsite
Coding & Algorithms
Hard

0

0

0 solved


A Snapdragon network-on-chip is a directed graph of routers where each link has a non-negative energy cost. Find the minimum total energy route from a source block to a destination block that uses at most H hops (to meet a latency budget), and return the route.

Qualcomm's SoC and performance teams reason about traffic between CPU, GPU, NPU and memory controllers where both energy and latency matter. This onsite problem checks whether you notice that plain Dijkstra breaks under a hop constraint and can extend the state space or use bounded Bellman-Ford, then reconstruct the path.

What the Interviewer Expects
  • Explains why plain Dijkstra on nodes is wrong when a cheaper route uses too many hops
  • Expands the state to (node, hops used) or uses H rounds of Bellman-Ford
  • Prunes states dominated by a cheaper-or-equal state with fewer hops
  • Reconstructs the actual route through parent pointers keyed by state
  • States complexity in terms of V, E and H and tests against brute force
Key Topics to Cover
constrained shortest path
Dijkstra
state-space expansion
Bellman-Ford
path reconstruction
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • What if you must minimize energy subject to both a hop limit and a bandwidth limit per link?
  • How would you answer many queries for the same graph and H efficiently?
  • If some links carried negative cost (for example a scheduling credit), what breaks and what would you use instead?
  • How would you return the Pareto frontier of (hops, energy) instead of one answer?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • n routers labeled 0..n-1, directed links (u, v, energy) with energy >= 0.
  • Find the minimum energy path from src to dst using at most max_hops links.
  • Return (energy, path); `(-1, ...
High-Level Design

Run Dijkstra over states (node, hops). Popping states in energy order means the first time dst is popped, it is with minimum energy among all hop counts up to H. A new state (v, h) is skipped if...


Submit Your Answer
Markdown supported

Related Questions