PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/Visa

Compute distinct sums from limited coins

Last updated: Mar 29, 2026

Quick Overview

This question evaluates algorithmic problem-solving skills in combinatorics and resource-constrained subset-sum computation, focusing on dynamic programming, optimization, and complexity analysis within the Coding & Algorithms domain.

  • Medium
  • Visa
  • Coding & Algorithms
  • Software Engineer

Compute distinct sums from limited coins

Company: Visa

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

You are given two integer arrays, denom[0..n-1] and count[0..n-1], where denom[i] > 0 is a coin denomination and count[i] >= 0 is the number of available coins of that denomination. Return the number of distinct positive sums that can be formed using at most count[i] coins of value denom[i] (each coin is identical and can be used at most once). Describe your algorithm and analyze its time and space complexity. Discuss how you would handle large maximum reachable sums (e.g., up to 1e 6).

Quick Answer: This question evaluates algorithmic problem-solving skills in combinatorics and resource-constrained subset-sum computation, focusing on dynamic programming, optimization, and complexity analysis within the Coding & Algorithms domain.

Related Interview Questions

  • Solve Two Algorithm Challenges - Visa (hard)
  • Solve Three Array Coding Problems - Visa (medium)
  • Maintain pair-sum counts under replacements - Visa (Medium)
  • Design rotating warehouse simulator with closures - Visa (Medium)
Visa logo
Visa
Aug 11, 2025, 12:00 AM
Software Engineer
Technical Screen
Coding & Algorithms
3
0

You are given two integer arrays, denom[0..n-1] and count[0..n-1], where denom[i] > 0 is a coin denomination and count[i] >= 0 is the number of available coins of that denomination. Return the number of distinct positive sums that can be formed using at most count[i] coins of value denom[i] (each coin is identical and can be used at most once). Describe your algorithm and analyze its time and space complexity. Discuss how you would handle large maximum reachable sums (e.g., up to 1e 6).

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Visa•More Software Engineer•Visa Software Engineer•Visa 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.