I started out in engineering. I was a geophysical engineer. Throughout the course of my life I've done a lot of strange jobs and the effect has been to make me think a little more skeptically about our capitalist society.
Sometimes a character is really based on research that you do. Other times it's just based on your imagination or perhaps your conversation with the director. Or sometimes all of the above. It depends on the movie and character.