As for your example of mathematicians, and to offer a sense of how easy it can be to accidentally and innocently give these things away, something as simple as preposition use can give away a mathematician (or at least someone who's had some exposure to mathematical writing and usage). Consider: "over", and "in", for example, and also seemingly-innocent usage like the transitive verb "having", in a revealing context.
See the commas after the closing quotation marks, in that second paragraph? If I'm American, and not obviously-deficient in the rest of my writing, that's a fairly reliable signal that I'm a programmer.
Consider that people will do all of their writing in an educational or formal context. I.e. nobody grows up writing to their parents, siblings, and neighbourhood kids in a particular sociolect the way they do with speaking. Many people who speak with not just the accent but also the sociolect of a particular class group will nonetheless write in a way that only really reflects their education since that is the context where they have done most of their writing.
There are definitely stylistic tics that reflect certain ways of thinking. Someone who describes an idea as a "first order approximation" which is "correct to an order of magnitude" reveals that they have come from a particular way of thinking about the world. I'm not sure how may social class related style "tells" would make it into someone's written communication though. Especially task-related communication during a hiring process. Unlike accent which is always on, particular sociolect may only be deployed in a particular context.
It is often pretty easy to tell writing, even if grammatically correct, which comes from someone who is not highly educated and doesn't used writing as a main method of communication. They tend to ramble and their writing reads like a transcript. I used to follow the legal advice subreddits and often the people with the most complex and troubling problems would describe them in this wildly digressive way where right in the middle of a paragraph about something that X had done to Y we're suddenly treated to completely irrelevant details about Y's sister of X's uncle.
Again though, this only shows up in the writing of someone who hasn't had a lot of education. Someone from a humble background but a lot of practice writing may have an obvious accent while writing like any other educated professional. Unlike accents which are almost indelible.
People would try choosing their words to make them sound like they're part of the "in" group.