The problem with this is that many jobs require weeks worth of on ramping into internal systems, code bases, etc, not to mention many aspects of the job would be working on otherwise secretive stuff. I don’t think this would work at a FAANG, and many bigger companies.
of course — so you have to make it accessible to the candidate. using the internal code base is probably not the best choice. we had them write up a small API with specific requirements in the tech of their choice, and tried to have someone programming with them familiar with their choice of tech.