FastPrepCalculate Change
Problems/Calculate Change

Calculate Change

PayPay logoPayPay● EasyOA

Updated Sep 2026

QuestionFunctionExamples

Problem statement

Given 2 non-negative double numbers first representing price of product (pp) bought by customer and second representing cash given by customer. Cashier has (100,50,20,10,5,2,1,0.5,0.25,0.1,0.05,0.01) as bills. Return bills returned to customer as a comma separated string. String has to be alphabetically sorted.

Function

calculateChange(pp: float, cash: float) → String

Examples

Example 1

pp = 230.0cash = 500.0return = "Fifty,One Hundred,One Hundred,Twenty"

:O

More PayPay interview questions

  • Next Greater Value in a Circular ArrayPHONE SCREEN · Seen Sep 2026
  • Sum Consecutive Identical DigitsOA · Seen Mar 2024
  • Palindromic Array TransformationOA · Seen Nov 2023
  • Find Maximum Two-Digit FragmentPHONE SCREEN · Seen Sep 2021

Similar questions at other companies

  • Server InvestmentRippling · OARippling interview questions
  • Maximum Three-Server Difficulty ScoreVisa · OAVisa interview questions
  • Particle Moves to TargetCresta · OACresta interview questions
  • Digit Changes for a Multiple of 9Nutanix · OANutanix interview questions
  • Warehouse Allocation (Distribute)Amazon · OA
  • Find Maximum Even SumIBM · OAIBM interview questions
  • Server InvestmentSnowflake · OASnowflake interview questions
  • Delete and Freeze GameRubrik · OARubrik interview questions
  • Minimum Rounds to Complete All TasksInfosys · OAInfosys interview questions
  • Server Upgrade PlanningWells Fargo · OAWells Fargo interview questions
All PayPay interview questionsSee PayPay hiring insights
Saved
class Solution {
    public String calculateChange(float pp, float cash) {
      // write your code here
    }

}
Checking account…