Patent examination is a problem of moral hazard followed by adverse selection: examiners must have incentives to exert effort, but also to truthfully reveal the evidence they find. I develop a theoretical model to study the design of incentives for examiners. The model can explain the puzzling compensation scheme in use at the U.S. patent office, where examiners are essentially rewarded for granting patents, as well as the variation in compensation schemes and patent quality across patent offices. It also has implications for the retention of examiners and for administrative patent review.