Why do you think that's a bad question for a senior engineer? I think it's great. This is much closer to the actual work that software engineers have to do!
That's what I do most of the time when I'm working with code, it's always an existing system that you need to add a feature to without breaking something else.
What do you think is a good question for a "senior software engineer"?
Because it doesn't tell you the upper limits of their abilities, only the lower limits. You hardly get any insight into their ability to design a new system, or into how they might deal with problems that require more than 2 seconds of straightforward planning, etc. Again, for a senior engineer, it's not really a bad question, just a very mediocre warm-up/filter question. It's just too easy to copy-paste or modify a few functions and get the task over with, and the result ends up giving you very little information other than "this senior engineer can, in fact, complete a very straightforward task".
Good questions aren't easy to come up with, I'm not an expert in interviewing by any means, but for a senior engineer you'd want to ask questions that start straightforward like this, but become progressively less straightforward (and maybe one that's a more subtle design issue) so you can get a better feel for their skills as you work with them.
Okay, I guess I have been in a position to interview senior software engineers who can "design new systems" all day on a whiteboard with artificial "interview" constraints but who could never actually solve this problem. I think this is a better question for senior engineers than junior ones. You seem to be assuming that a senior candidate who could blag their way through a "hard" design question in an hour could ALSO solve this problem and I don't know where you've worked but in my experience that is not at all true. In my experience, senior engineers often can't code much at all because they have worked at places with a ton of people writing code where code just "happens" and they are good at all the other processes that are code adjacent but "I haven't written much code recently". You better test that they can write real code and not leetcode.
I'm a senior engineer and I do a lot of design and architecture and code review every day but I would probably fail most generic leetcode tests and I think I would pass this one, so I feel kind of personally validated by that, so excuse the passionate response. :)
No one performs at the upper limit of their abilities on anything like a regular basis and it's basically a crapshoot whether your question and dialogue is actually able to test their limits. Most people, myself included, have a whole litany of things they need to perform well and doing it on-demand in a fundamentally stressful situation like an interview with a person you don't know is unlikely at best.
There's also a tendency for interviewer to choose questions from their personal expertise rather than something appropriate to the person or role.
It's only one question though. You probably shouldn't have a question that simultaneously evaluates many different things - the different signals would be mixed and harder to interpret. This seems like a good question to add a simple feature to an existing product and also seems very much like the work of a software developer - certainly much more like actual work than "Invert this binary tree" or whatever.
Given a Tech document that addresses the risk of change, the rollback plan, the security implications etc, and a suite of metrics demonstrating load and failure conditions with appropriate alerting. And of course the PR with appropriate test suite, shown to work in a test environment in concert with the rest of the ecosystem, that stuff is just table sakes. convince a director to approve the change. Ideally a director that doesn't report to the same vp as your org.
That's what I do most of the time when I'm working with code, it's always an existing system that you need to add a feature to without breaking something else.
What do you think is a good question for a "senior software engineer"?