This happened to me last year while I was interviewing with a company for a position I didn't get. I'm currently employed elsewhere but I'd like to know for future applications.
I had an excellent phone screening, according to them - they said I was a strong candidate, and the first technical interview with one engineer went very well. Between that second interview and the final interview I found their software had an open-source API on GitHub, written in Python. I looked at it for a while and found a much simpler and future-proof way to write one function, and I opened a PR with the change without mentioning that I was currently interviewing.
When we started my third interview with two engineers one of them mentioned that he saw my pull request and it was inappropriate for me to open it. He said that it came across like I know more than them as a fresh college grad, and that I haven't considered why they coded it how it was. I didn't end up getting the job.
Was it really inappropriate for me to do this?