However they're able to do more than just regurgitating code, I can have them explain to me the underlying (mathematical or whatever) concept behind the code and write new code from scratch myself, with that knowledge.
Can/should this new code be considered as derivative work, if the underlying principles were already documented in literature?