We study a particle system without branching but with selection at timepoints depending on a given probability distribution on the positive real line. The hydrodynamic limit of the particle system is identified as the distribution of a Brownian motion conditioned to not having passed the solution of the so-called inverse first-passage time problem. As application we extract a Monte-Carlo method to simulate solutions of the inverse first-passage time problem.