As for modals, that's UI. Google's algorithm doesn't care that I've seen.
FYI, Google runs quite a large spam team which flags scammy sites manually. Sites with such a modal are usually rather on the spammy side of life and gets flagged by the team. If you get too many flags you get severe penalties slowly eating your traffic in a way that it’s not clearly obvious and it can take years to recover.
But since it’s Medium such UI seems to be tolerated.
If I ran that team I would have killed Medium's, Quora's and Pinterest's search traffic. And soon maybe StackOverflows as well.
Certainly not my intent. I come across stuff like GGP and I have a gut reaction "Oh! I know a thing! Here, see what I know?! I am helpful!"
I do this occasionally at work, too: where I explain something fundamental to people who have been doing the work for 20+ years.
Part of it is that I'm reinforcing my mental model, and part is I'm trying to be helpful. I suppose this can come across as patronizing or insulting. That's never my intent. I try not to assume what people do or don't know, because I don't know quite a lot and the asides that people make are super helpful to me (especially in fields that I know nothing about).
1. If you use Google signed in, they know (I assume) you preference technical material (which is the bucket Medium falls in)
2. On-site links; one of the most powerful (and underutilized methods of SEO) is interlinking pages on a site. I'm not sure why this is the case, but it can be a determining factor in top-ranked sites (see Wikipedia as the canonical example of onsite linking).
3. Inbound links; lots of people link to Medium content. If Medium uses Google's tracking tools, Google has a good idea of the inbound traffic and can adjust based on the site's popularity.
None of this has to do with user experience. Unfortunately.
I'm sure there is more (like page load times, how information is organized in the HTML, etc.) that factors in, but these are the ones that occurred to me.