This blog is highly personal, makes no attempt at being politically correct, will occasionaly offend your sensibility, and certainly does not represent the opinions of the people I work with or for.
A nameless algorithm for hiring

There is a simple and fun algorithm that I don't know the name of (if it ever had one). If somebody does, please let me know.

In its most general form it allows for the selection of a element from a possibly infinite totally ordered set, after having analysed a finite set of elements. Note that in the most general form, there is a situation where the process doesn't terminate, but this case would not occur in the real life situations I will refer to.

So imagine that you have to hire a sales assistant for, say, a shopping centre. There is no time constraint for the recruitment (if there was, you would just put a deadline on CV applications and only work with the CVs you have received before the deadline) and you can also assume know that lots of people will be applying (you can assume an infinite number of people).

To simplify things, let us say that you can hire people on their CVs alone. Otherwise assume that people have to hand over their CVs in person, and that they get an instant face to face interview. In which case, you can use the CV together with the result of the interview to value the application.

One method is to go as follows: You first build a pool of 7 CVs using the first 7 CVs. Then, for each new CV, referred to as "incoming CV", you do:

  • If incoming CV is better than any of the CVs in your pool, you insert incoming CV to the pool (which then has 8 elements) and then you remove the weakest CV (so the pool goes back to 7 elements).
  • Otherwise, you discard incoming CV.
Then we need an additional rule: If the last 5 incoming CVs were all discarded (meaning that none of the last 5 incoming CVs were better than the weakest CV currently in the pool), then you stop the process and hire the best CV currently in the pool.

I don't know the name of that algorithm.

Obviously the general assumption that the set is totally ordered translates to always be able to compare any two given CVs. In real life this is harder than it sounds (but not impossible). More interestingly, the size of the pool (number 7 in the above example) and the termination condition (number 5 in the above example) can be customised (they are parameters of the algorithm). There might be good methods to chose the optimal values (I think statisticians know those kind of things), but I don't know it. Also you might want to put a sort of minimal condition to be met in order to apply, because you obviously should not even put in your pool of CVs any CV that you would actually mind hiring if that one person ended up at the top of your pool once the process stops.

[ add a comment ]


M @ 2016-03-27 01:20:31
I don't know the algorithm but the problem is also called secretary problem and the soulution famous as mathematical solution to dating (
Pascal @ 2016-03-27 17:37:28
Thanks, that was I was looking for, but the algorithm as explained in my entry, despite similar in spirit, is not the same as described in the literature. The purpose of my pool is to compensate for the fact that if the person you want to give an offer to (the top of the pool) refuses, then you go to the second best in the pool. In the literature there is no pool, it's just an instantaneous yes/no decision at each application. I think that the literature solution had the instantaneous feedback as a prerequisite, but in my case only somebody who doesn't match the existing pool, get an instantaneous (negative) feedback.

There is a variation of my solution with the added condition that if somebody has been in the pool for too long then that person is automatically removed. This creates another stopping condition where you stop the process because the current top candidate is about to expire if not giving an offer, despite the fact that the average value of the pool might have been steadily increasing... (I find this last set of rules the more interesting from a theoretical point of view...)
M @ 2016-04-09 09:49:10
Yep. That was just to give you the name of the problem. I know very little about it, I found out when reading a book about mathematics for the masses that were describing it in the chapter "Mathematics for dating".

If you scan the literature, there is a number of papers starting around the 70s that covers the finite-memory secretary problem in various form, finite and infinite, and other extensions. One that could be related to the first scenario is