How its done that when I publish some post on
stackoverflow.com, it at once becomes visible in google search?
The reason that your question shows up so quickly on Google is because Google's crawlers knows SO is a high-traffic site, so it keeps its eyes on the site more often, so-to-speak. It works that way for any major, high-content website. As the content produced scales up, and changes happen more often, Google indexes it more often.