(I did go to CC specifically to transfer eventually, so I didn't take courses randomly)
(Which is to say, the courses were a mix of good and not good, just like I experienced at the university.)
They had a big list of in-state transfers, where you could see which courses you could transfer in, and which you couldn't. Also, you could see if they satisfied any specific requirement.
This anecdote is almost 20 years old at this point though, but I believe this is still possible to do.
In my area, the community and state college have a program that allows students to transfer directly into a four year degree after completing core classes at the community college. All credits transfer so long as they’re part of the program.
For us, it was roughly half the tuition cost and student lived at home the first couple years. Worked well for us.
The public universities in my state have agreements with the community colleges to maximize credit transfer. Took all my prerequisite courses at a community college, including calculus, linear algebra and statistics with calculus.
The first two years of an undergraduate degree are pretty general anyway.
edit: Illinois.
(And if you make 65k or less a year you are also granted free tuition.)
Its not perfect though. When I was transferring for my CS degree, some colleges only accepted my CS courses as general credit to be applied to a selection of non CS courses in the program. You would have seen this ahead of time if you went to the website but it was still a bummer to know that you'd have to take CS classes at the community college and then repeat them at the new institution. This would essentially require me to retake Core CS classes at the school (Rutgers). It would have added at least 1 more semester to my college career. In hindsight, I understand why they did it. The institution I selected(NJIT) accepted the credits as equivalent classes and I was immediately thrown into more advanced classes where I struggled for a while because I hadn't quite mastered the fundamentals.
Still overall super straightforward to get from filling out the application for Community college admission -> working hard in classes -> Getting that final Bachelor's degree.
"Through system agreements, students who graduate from one of Virginia’s 23 community colleges with an associate degree and a minimum grade point average may obtain GUARANTEED admission to more than 30 of the commonwealth’s colleges and universities. Please see the list below for copies of the current agreements."