Coding Challenge

I have been thinking about an optimal solution for a real-world problem but just haven’t had any time to have a crack at it. A friend at work suggested I should put it up as a challenge and see who is the ultimate programmer.

The Problem
A manager has allocated Shifts to their Staff for a given week.
Can you allocate the same shifts to different people for a lower wage cost?

Staff have Availability which is what shifts they are available for each day of the week.
They also have a Wage category which based on the day of the week and the Shift will give you the DayWage or cost of that shift.
For instance, a Wage might be $19/hour, but on Saturdays, after 7pm, over 8 hours in day etc it could be different.

Can you implement an Optimiser that calculates a cheaper combination that is still valid? Download the intelliJ project now!

Bonus Points

  • Quick! This would be on a web based application so time is important.
  • Reduce movement. If two staff cost the same and are both viable candidates but one of them was in the original roster, pick the original.

I have tried porting across to Java the essence of the problem. The major component that is missing is that Wages have a end-of-week processing. For instance, if a Staff member works over 38 hours in the week, any further hours worked will get at time and a half. I think this adds too much complexity to the scenario and for now have left it out for now.

About the Author


Mannan is a software engineering enthusiast and has been madly coding since 2002. When he isn't coding he loves to travel, so you will find both of these topics on this blog.

Leave a Reply

Your email address will not be published. Required fields are marked *