With the average student loan debt for the class of 2018 reaching $29,800, according to Student Loan Hero, it can be difficult for many young workers to set aside money for a distant retirement date when debt repayment is a top priority. But according to Erin Lowry, author of "Broke Millennial Takes on Investing," the two goals don't have to conflict — you can invest for retirement and pay off your loans at the same time. "It's really the question on most millennials' minds," Lowry tells CNBC Make It. "No one ever said they regretted paying off their debt, but at the same time if you take a 10-year hiatus on investing those are critical years that your money can be compounding and growing."

How much to invest when you have loans

When to focus on loan repayment