If you're sitting in a formal job interview with a hat on you've got worse problems than eccentricity.^^^^^^
I occasionally field questions from customers asking what hat I’d recommend they wear to a job interview. I typically respond “none at all,” unless the job is in entertainment or the arts or maybe advertising. You want the interviewer to remember what you said, I tell them, not that you wore a hat to the interview. “Proper” hats haven’t been the norm outside certain specific contexts in more than half a century, and it’s probably best not to come across as an eccentric, nor as a person who pays an inordinate level of attention to his appearance.