Wednesday, May 2, 2018

Being interviewee: Budget cut

May 1, 2018

Introduction


It is the algorithm I still have some confusion how to get the optimal solution. I tried to draw something and explained the algorithm starting from sorted array first element, checked if it can survive for new budget.

The peer did not ask me questions and challenge me. I like the peer to challenge me and question me if I memorize the algorithm. I like to see if I need to figure out something new to work on.

Mock interview


Here is my mock interview C# code.


Actionable Items


I need to come out some analysis about my approach. Since the requirement is to get minimum impacted recipients, the biggest number of impacted recipients is the total number of grants array. So sort the array first in ascending order, iterate the array, the first one is to consider worst case, maximum impacted recipients is 5 in the sample test case. If the budget is available then move to next iterated element.

No comments:

Post a Comment