If you don't want to code in your spare time, reframing it the way suggested in the accepted answer is fine.
But I feel that by saying "code as a hobby" is missing the point of that question (or at least the reason I ask it), and everybody is tacitly accepting or even actively reinforcing that framing with phrasings like "your outside/leisure time is your own".
When I am interviewing a candidate for a software engineering position I am looking for someone who can solve problems with technology.
And the easiest/best problems to solve are frequently ones that we personally experience.
I have all sorts of problems in my life that can be solved by writing code. Not work problems, my problems. Work does not care that I want my iTunes music playlists from my MacBook to work on my Android phone. Task automation scripts. Development machine provisioning. Data format conversions. Dotfiles.
I don't put stuff on GitHub for fun, or to impress potential employers. I write it because I need it, personally and I put it on GitHub because it's convenient.
Now, GitHub is not the only form of proof I'll accept that you know how to solve real problems with code, but holy @#%$ is it a better option than a leet code challenge on HackerRank, which is itself a better option than an artificial interview-y question like "tell me about a time when your boss came to you with a problem and you had to deliver a solution".
But you'd better have some way to sell me in the interview that you know how to solve problems with code.
So I challenge you and the other readers of this answer, if you are privileged enough to not have to spend all of your waking hours meeting obligations, to spend some time thinking about something you'd like to be better/less inconvenient in your life, and how you might write some code to make that happen.
And then, if you want, put it somewhere like GitHub.