You effectively get unlimited trial & error attempts, and nobody judges you on how you got to the end result (as long as the end result is working). Compare that to an interview (which sets a baseline level of knowledge necessary, not to mention trick questions and/or leetcode) and then the actual job (where you are under time pressures that may not allow unlimited time for a non-expert to get there by trial and error, and there are certain code quality standards to follow).