I am sure you mean well and you don't do this maliciously, but the end result is still this oppressive machine like system.
Your comment hits me hard because it just shows the covert way we perpetuate this uncaring system.
I think OP's idea is brilliant (putting aside concerns of copyright). It is a evidence based approach to determine a lot of things from the engineering culture.
I was once rejected from an interview because I was asking "too many questions about how the work is done" this led the interviewer believe that I was "too focused on that and probably wasn't a good team player". Reading between the lines, it seemed he just wanted to hire another drone.
I really wish I could escape from this industry sooner. I frankly hate this.
this is the double standard.
just as, through their actions and words, a company is saying, "we need you to do Y in order to move forward", the engineer can also communicate that "I need you to do X in order to move forward." both needs are equally valid.
the way this would be presented and communicated about in the interview process definitely matters - if a prospective employee presents this need in an antagonistic way, that can definitely be a flag.
this need can be shared in a collaborative, kind, and curious fashion. that's how I would work to frame it.
I definitely wouldn't phrase it as an ultimatum in the hiring process.
I would say something like, "I'd like to understand what I'll be working with. Would you be up for letting me sign an NDA so that I can view the codebases on which you'll be having me contribute?"
If there's pushback on that and they are asking me to do a puzzle, I might then frame it as follows:
"I understand that you need a strong signal about the skill of engineers you hire. I also need a strong signal about the technical elements where I'll be spending the vast majority of my time. How can I gauge this without looking at some of your code?"
And just go from there, depending on their answer.
Perhaps I'll edit to reflect that.