Practically, the geologist will do boring at different location at the site, we call it Bore Hole.
Based on their preliminary assessment, they will decide the depth of boring. Or by experience or trial & error. Whatever it is, the main thing we are looking for is hard layer. For it to be hard rock or hard dense sand layer.
Basically we can get a soil ...
The answer to this is that, engineers have to come out with different idea / creative solution to increase the span of the slab.
I believe there are many other solutions in other places that not mentioned in the following:
1.) Cold-form steel trusses
2.) Post/Pre-tensioning concrete structure
3.) Arc shape structures support with tensioning rod.