While most college graduates eventually find jobs that match their qualifications, the possibility of long spells of unemployment and/or underemployment—combined with ensuing difficulties in repaying student loans—may limit and even dissuade productive investments in human capital. The author explores the optimal design of student loans when young college graduates can be unemployed and reaches three main conclusions. First, the optimal student loan program must incorporate an unemployment compensation mechanism as a key element, even if unemployment probabilities are endogenous and subject to moral hazard. Second, despite the presence of moral hazard, a well-designed student loan program can deliver efficient levels of investments. Dispersion in consumption should be introduced so the labor market potential of any individual, regardless of the family’s financial background, is not impaired as long as the individual is willing to put forth the effort, both during school and afterward, when seeking a job. Third, the amounts of unemployment benefits and the debt repayment schedule should be adjusted with the length of the unemployment spell. As unemployment persists, benefits should decline and repayments should increase to provide the right incentives for young college graduates to seek employment.