The primary point was one of mindset, but the second example in the cited section is a tailor-made sed example:
Let's say you're on my team, and I've decided I'm a real stickler for code formatting. But I've got peculiar tastes, and one day I decide I want to have all parentheses stand out very clearly in your code.
So let's say you've got a set of source files in C, C++, or Java. Your choice. And I want you to modify them so that in each source file, every open- and close-paren has exactly one space character before and after
Y'know - after thinking about it a little, I'd argue that this is a question that could serve a second purpose. The obvious out-of-the box implementations of this in sed/perl/etc. would all fail to properly handle open and close parens in strings and comments. Particularly multi-line comments and strings with escaped quotation marks inside of them.
I like sed. I like perl one-liners. I would consider it a mistake to try to do this on a real codebase in a batch manner with just a regexp. You'd be far better off googling to find a source code formatter that includes a real parser, like clang-format.
The question specification is such that you don't need special handling of comments, strings, etc. "every paren" isn't qualified as "that is part of the code".
The point of the question is more to gauge your understanding of/familiarity with available tools and ability to think laterally rather than immediately jump to "I've got to write some real code to solve this"
I'd probably reach for ANTLR to write a quick parser since working with such a stickler is likely to require more code formatting changes in the future.
As an aside, the stuff I used sed/awk for in the past have pretty much been replaced by Python for me. These days it's pretty rare to not have a default Python install on any Unixy box one spins up and in the rare cases I use Windows I tend to install Anaconda so it's also slightly more cross-platform for my use cases.