Yes, you can shred carrots ahead of time for carrot cake. In fact, shredding them can save you some prep time when you are ready to bake the cake. Once you shred the carrots, store them in an airtight container or a zip-top bag in the refrigerator until you're ready to use them to prevent them from drying out.   I recommend pre-shredding them one or two days in advance for the best quality.