If we ignore skill of all programmers involved and just categorize how difficult it is to write software, then roughly from easiest to hardest:
- Designing small programs from scratch.
- Debugging/maintaining small programs written solely/partially by yourself.
- Designing large programs from scratch.
- Debugging/maintaining large programs written solely/partially by yourself.
- Debugging/maintaining large programs written by others.
The last one is by far the hardest and usually requires a veteran as you can only learn this with experience. Or otherwise you end up with plenty of bugs at every patch. Which you might do anyway, in case the original code base is badly designed, poorly documented or just the victim of years of "code rot".
Also, maintaining code written by others is usually not very fun. It is difficult, it is not creative work, it is depressing if the state of the code is bad, which is common. Very few want to work with that 8 hours per day, so as a manager set your expectations accordingly: you need a senior dev and you need them to do boring work for you. Yikes... You'll likely need to both pay them well and otherwise motivate them to keep them around for the long term.
The way to test someone's experience at maintaining big code bases is not to have them write code - if you do that you merely test their ability to at all function as a programmer, by checking their ability to perform the easiest task in my list above.
But if you are specifically recruiting a senior dev who needs to maintain a large code base, then ask them about program design. Or show them some code and let them comment on the design. Or development life cycle stuff. Debugging, coding standards, version control etc. Meaning that you either need to be an experienced dev yourself or have one present at the interview for this part.
Those who know nothing about program design are probably not suitable for writing large code bases from scratch - they'll make a mess - and they are for sure not suitable for the even more difficult task of maintain large code bases written by others. People who sneer at design, coding standards and general discipline are usually not anywhere near as good as they think they are.
Similarly, a red herring is programmers who constantly talk about "refactoring" their own code, aka throw everything away and do it correctly instead. They are probably not veterans but intermediately skilled. All programmers go through this phase when they are reasonably experienced: they suddenly take a step back and realize what would make the code they've just worked on a lot better. But they are not yet experienced enough to write the code like that to begin with. Whereas veterans get most of the design right from scratch.
When learning programming, there's this process where you will always look at older projects you've made with dismay, realizing you would have done things very differently today. Over time, this dismay effect will fade as you get more experienced. When you eventually find yourself looking back at project you made a few years back thinking "hey this code is pretty good", then you probably have some 10+ years of full time programming experience.
(Not to be confused with programmers talking about "refactoring" the existing code written by others. You can be dead certain that they will eventually insist on reworking it at some extent, perhaps particularly so if they are veterans.)
You could also hand them a big code base and ask them to find out where it does one particular thing, or where a particular (planted) bug is located. Then see how they go about it.
Expected behavior would be lots of file content searching, following identifiers deeper and deeper, doing "divide and conquer" - all while you truly don't care about what anything does, not until you've dug down to the part you are interested in and only then stop and consider - what is this file, what does it do, what's the specifics of the code. If they have found the place you asked for within reasonable time, they are good enough. If they have also found the cause of the bug or have an idea about a solution, even better.
Whereas someone starting at reading project documentation and looking at big picture stuff like file hierarchies probably isn't very experienced - that's all well and good but there's a time and place for everything. During an interview or when putting out fires by trying to quickly patch a fatal bug, there's no time to stop and smell the flowers.