If the interest on your debts is only 4%, then you should at minimum contribute enough to get your company's 401(k) match.
Let's do the math here. A common company match scheme is something like "match 50% of your contributions, up to 8% of your salary". In that case, the money you invest is getting an immediate 50% return, plus whatever returns the investments earn, plus the fact that all of this is tax deferred. That's way more than the 4% return you would get by paying down the loans, even if you get only mediocre performance out of your investments. Therefore, you're better off investing. The only reason you should forgo that matching is if you absolutely can't make your minimum payments any other way.
I would argue that you should go further than that and invest as much as you can into your retirement accounts (subject to still being able to make your minimum payments, of course, and you should establish some emergency savings too). However, the case for this isn't quite the slam dunk that investing up to the matching limit is. The additional investment won't be getting matched, so you will only be getting the investment returns, plus the tax deferment. However, in my experience, it's not at all hard to get investment returns that beat the 4% that you're paying in interest. My own 10 year annualized returns are more than twice that, and that's not doing anything special, just investing in plain old low-cost index funds. With those returns, you'll have more money by the end of your career if you invest than if you pay off the loans first and only start investing afterward.
Finally, I urge you to ignore the "debt snowball" and any other such talk. The logic behind these tactics is that reaching arbitrary milestones like "this or that loan account is closed out" provides a psychological lift that is somehow necessary for mustering the self-discipline to get out of debt. In my opinion, it's a bunch of snake oil. Getting out of debt is a numbers game. Sit down and run the numbers, figure out what you can afford to put toward paying debt, paying bills, saving, and so on. That's your budget, and if you stick to it, you'll do fine. If you need an emotional lift from time to time, look back at how you did on your budget each month, and give yourself a pat on the back for each category where you managed to come in under budget. It's no less effective than Ramsey's techniques, and it doesn't cost you money in the long run. Remember, this is a marathon, not a sprint. The goal of this sort of planning is to maximize your long-term financial well-being, not to score quick wins that leave you worse off in the long run.
Good luck with your career, and your financial planning. You're asking the right questions, and you've got the right priorities. That alone is well more than half the battle.