Little is known about the education of Sherlock Holmes. It's assumed from references to "the university" in "The Gloria Scott", "The Musgrave Ritual", and to some extent "The Adventure of the Three Students", that Holmes attended Oxford or Cambridge, although the question of which one remains a topic of eternal debate. Baring-Gould  believed textual evidence indicated that Holmes attended both, though Dorothy L. Sayers  thought he was a chemistry student at Sidney Sussex, Cambridge, which would fit in with his evident knowledge of forensics.
He was born on January 6, 1854, which would put his student years in the 1870s, but there's no evidence of a Sherlock Holmes at the college then, though a photograph from 1878 (one of the earliest college photos ever taken) has several blanks amongst the captions, and several faces smeared by the long exposure, one of them suspiciously Holmesian.
During his detective career he visited Cambridge several times, taking the train from King's Cross. He betrays neither familiarity or ignorance of Cambridge in these episodes, though there are clues that he knew something of the surrounding area.
In "The Adventure of the Missing Three-Quarter" he uses a tracker dog in Cambridge.
"In half an hour, we were clear of the town and hastening down a country road. ... The dog had suddenly turned out of the main road into a grass-grown lane. Half a mile farther this opened into another broad road, and the trail turned hard to the right in the direction of the town, which we had just quitted. The road took a sweep to the south of the town, and continued in the opposite direction to that in which we started. ... This should be the village of Trumpington to the right of us."From this one might deduce that Holmes' knowledge of the centre of Cambridge seems rather vague, though Trumpington seems familiar to him. In "The Hanover Square mystery" his older brother Mycroft says
"Assuming that she comes into the town via the London road -Trumpington Street - she could cycle to Bridge Street and then to the Huntingdon road. That will get her to Girton. Alternatively, she could turn left at Silver Street which will bring her through the Backs, a more sheltered route."Mycroft's clearly well acquainted with Cambridge. Perhaps Sherlock never was an under-graduate but visited his older brother Mycroft while Mycroft was a student. If so, it's far from unlikely that when he did so, Holmes explored Trumpington. After all, he was well-versed in the greats of literature so he may have been interested in tracking down the location of Chaucer's "The Reeve's Tale" - "At Trumpingtoun, not fer fro Cantebrigge"
If we could recognise existing buildings in the description of Holmes' travels then perhaps this connection with Trumpington would be confirmed. After finding Trumpington to his right, Holmes "sprang through a gate into a field" where "A footpath led across to the lonely cottage". There's really only one cottage that this could be. Coming off the M11 at junction 11 and heading towards Cambridge, Trumpington will be on your right. On your left obscured by foliage in the middle of a field was the dwelling where Godfrey Staunton's beautiful wife breathed her last. Alas, the cottage has recently been knocked down to make room for a new estate. The photo shows all that's left.
- "Sherlock Holmes of Baker Street", William S. Baring-Gould, (1962)
- "Unpopular Opinions", Dorothy L. Sayers (1946)