Surprisingly simple math (like
https://news.ycombinator.com/item?id=5854593), the data you just described, and also IP addresses. I wouldn't be surprised if they also use browsing habits (search history on LinkedIn, profiles visited on LinkedIn). So they might guess the friend's name from the data, but not know which exact profile out of several identically-named profiles represents the person you know.