He was born the son of Robert Dundas Cay, an
Edinburgh lawyer, and Isabella Dyce (1811–1852). In 1844 the family moved to Hong Kong following his father's appointment as Registrar to the Supreme Court of that city. His mother died there as the result of injuries from a carriage accident in 1852 and is buried in the Happy Valley Cemetery in Victoria, Hong Kong. William returned to
Edinburgh soon after this, to study mathematics at
Edinburgh University, winning the prestigious Straiton Gold Medal in 1856. He then moved to
Belfast to serve as an apprentice engineer under Lord Kelvin's brother, James Thomson. On completion of his training in 1858 he began to specialise in harbour design, and spent the bulk of his working life improving Aberdeen's docks and harbours. From 1873 he was assisted by
James Barron who later set up as an independent harbour engineer. He was elected a Fellow of the
Royal Society of Edinburgh in 1882. In 1890 he obtained a house on Blackford Road in
Edinburgh. He died at
Folkestone, Kent on 13 December 1925. ==Known works==