Never seen a DevOps actually code. These people are just systadmin that use modern tools and write a lot of yaml. No clue why they ask them coding on interviews.
Some DevOps engineers code, some dont and it can depend on the organisation / tasks they are involved in. Some DevOps engineers will code extentions to some of the tools they use, to cover off tasks that may be unique to their orgainisation. One example could be writing Python modules for Ansible or SaltStack to be used n the configuration of their internal servers and platforms. Some may need to code applications to act as in an interface between existing Off-the-shelf applications (e.g. get the build server to update ticket status in Jira / ServiceNow depending on the outcome of the automated tests).
You must have worked in some pretty crappy places. For me a DevOps/sre/platform engineer (call it what you want) who can't code in bash + at least one other (node, golang, python) is just out.