Farquhar joined the East India Company as a cadet at the age of 17. Shortly after arriving in Madras on 19 June 1791, he was promoted to a low-rank commissioned officer of the Madras Engineers on 22 June 1791. Two years later, on 16 August 1793, he became a lieutenant in the Madras Engineers.