We consider an economy in which firms need to invest in capital before they can advertise a job, while applicants may have to compete for jobs. Our aim is to investigate how this competition affects the investment decisions of firms. Our first result shows that the economy always generates the right number of jobs. However, with random search firms under-invest in capital due to a hold-up problem. In contrast, if workers can direct their search to firms with different capital levels, the equilibrium is efficient. This result contrasts sharply with the predictions of models with ex post bargaining that never yield an efficient allocation. Moreover, our results extend the efficiency of auction mechanisms to an environment with non-contractible investments.