Giving a job candidate a HARD problem

time to read 2 min | 386 words

Every now and then I’ll run into a problem and say, “Oh, that would be a great thing to give in a job interview”. In addition to the Corona issue, Israel has been faced with multiple cases of hung parliament. Therefor, I decided that the next candidate we’ll interview will have to solve that problem. If you are good enough to solve conflicts in politics, you can solve conflicts in a distributed system.

Here is the problem, given the following parliament’s makeup, find all the possible coalitions that has 61 or greater votes.

  • Likud – 36 seats
  • KahulLavan – 33 seats
  • JointList – 15 seats
  • Shas – 9 seats
  • YahadutHatura – 7 seats
  • IsraelBeitenu – 7 seats
  • AvodaGesherMeretz – 7 seats
  • Yemina – 6 seats

There is a total of 120 seats in the Israeli parliament and you need 61 seats to get a coalition. So far, so good, but now we come to the hard part, not all parties like each other. Here is the make up of the parties’ toleration to one another:

Likud KahulLavan JointList Shas YahadutHatora IsraelBeitenu AvodaGesherMeretz Yemina
Likud -0.5 -1.0 0.95 0.95 -0.2 -0.8 0.95
KahulLavan -0.9 -0.6 -0.5 -0.5 0.5 0.8 -0.2
JointList -0.9 -0.3 -0.6 -0.6 -1.0 -0.2 -1.0
Shas 0.96 -0.7 -0.6 0.9 -1.0 -0.7 0.8
YahadutHatora 0.97 -0.6 -0.6 0.92 -1.0 -0.6 0.7
IsraelBeitenu -0.4 -0.1 -1.0 -0.99 -0.99 -0.6 0.1
AvodaGesherMeretz -0.95 0.98 0.3 -0.89 -0.89 -0.01 -0.75
Yemina 0.999 -0.92 -1.0 0.86 0.85 -0.3 -0.4

As you can see, the parties are ranked based on how probable they are to seat with one another. Note that just this listing of probabilities is probably highly political and in the time since the last election (all of a week ago), the situation has likely changed.

All of that said, I don’t really think that it is fair of a job candidate to actually solve the issue at an interview. I’m pretty sure that would require dynamic programming and a lot of brute force (yes, this is a political joke), but the idea is to get a list of ranked coalition options.

If you want to try it, the initial parameters are here:

And hey, we won’t get a government out of this, but hopefully we’ll get a new employee Smile.