Senior Engineering Management Interview Questions | Glassdoor

Senior Engineering Management Interview Questions


Senior engineering management interview questions shared by candidates

Top Interview Questions

Sort: RelevancePopular Date

Given US denomination coins, what is the algorithm to make change for any amount?

3 Answers

Greedy algorithm will work in this case

Code is in JAVA : public class USCoins { public static void main(String args[]) { int[] coinDenominations = {25,10,5,1}; double totalAmountInDollars = 3.46; int[] numberOfEachCoin = getNumber(coinDenominations,totalAmountInDollars); for(int number : numberOfEachCoin) System.out.println(number); } private static int[] getNumber(int[] coinDenominations, double totalAmountInDollars) { int numberOfEachCoin[] = new int[coinDenominations.length]; int totalAmountInCents = (int) (totalAmountInDollars*100); for(int i=0;i<coinDenominations.length;i++) { int denomination = coinDenominations[i]; numberOfEachCoin[i] = totalAmountInCents/denomination; totalAmountInCents = totalAmountInCents%denomination; } return numberOfEachCoin; } }

Inspired by this problem, I have proposed a solution that print out all possible change combinations per given amount. I demo the problem solving process in this video:

Complexity of Binary search algorithm

1 Answer

They asked me if I have ever lead a project where a stakeholder was difficult to engage

1 Answer