Thursday, March 17, 2016

Mock interview (practice III) - Award budget cut

March 17, 2016

Julia likes to figure out best ways to help herself grow as a software programmer. She likes to find peers to work together, solve the algorithm problems. She never had chance to interview others as a software programmer before 2016, she started to practice now.

So far, she did practice 4 times.
Lessons learned:
Learned to calm down, and set a small goal for each interview:
1. First 5-10 minutes, work on a test case, come out the solution to solve the test case; <- People are complaining about Julia about this.
2. Communicate the ideas using the test case, make sure that both are clear how to solve the problem;
3. Ask permission to write code
4. Code for test case, and then, extend the solution, fix the bug etc.

Mock Interview 3 -    Award budget cut
The awards committee had planned to give n research grants this year, out of a its total yearly budget.
However, the budget was reduced to b dollars. The committee members has decided to affect the minimal number of highest grants, by applying a maximum cap c on all grants: every grant that was planned to be higher than c will now be c dollars.
Help the committee to choose the right value of c that would make the total sum of grants equal to the new budget.
Given an array of grants g and a new budget b, explain and code an efficient method to find the capc.
Analyze the time and space complexity of your solution.
Julia got feedback:

2 comments:

  1. This is from a website called Pramp. You get feedback on both how you acted as an interviewer and as an interviewee.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete