Bad neighborhood denotes a poor neighborhood in which a website is located. The website in question is close to sites that violate search engine guidelines or have even been penalized. Being close to a site here means that links direct to the target page or links from the target page direct to your own website. Penalties are levied on manipulative, unauthorized techniques such as keyword stuffing, cloaking, paid link building or targeted massive link exchange.
Poor neighborhood on the Internet concerns the trust of a domain. This has nothing to do with the IP address, subnet or the host, rather it relates to the quality of links.
In the past, webmasters and SEOs have frequently sought to manipulate the backlink profile by targeted accumulation of links. This was possible because of the algorithms used by Google, in particular the PageRank algorithm. Google responded to these techniques, also called black hat SEO, with different algorithm changes and introduced other criteria, such as the TrustRank, which has the purpose to facilitate the identification of spam. 
If a bad link directs to the website in question or if an outgoing link directs to a site with many bad links, then that website is considered to be in a bad neighborhood and will lose Google’s trust. It may be a low-quality link if one of the sites violates the guidelines of search engines such as Google or Bing. Specifically, techniques such as cloaking, link farming, paid link building, keyword stuffing or spamming are indicators of one or more violations of these guidelines. A website that has been hacked may also be the reason why Google and associate websites consider it a bad neighborhood as hackers often use links that are out of content, which might direct to poor quality sites.
Bad neighborhoods can therefore arise due to various factors which can be identified by analyzing the backlink profile. If you want your site to retain the trust of the search engines, you will have to ensure that websites you link to follow the Webmaster Guidelines in addition to your website being in compliance with them. It does matter whether it is an outgoing or incoming link. However, any connection with a bad neighborhood is bad for the “trust relationship” between search engines and websites. A website being in a bad neighborhood can endanger its rankings or result in being excluded from the search engine index.
Therefore, one should avoid outbound links to suspicious websites. Penalties may also be levied on inbound links, even if there was no active work on the link profile. In this case too many inbound links from a bad neighborhood were set. All links are not equal.
It depends on many different factors, each of which impacts the backlink profile. The links on your website can be checked by using a link checker. You can also manually compare all incoming and outgoing links with the index of a search engine. If you search a domain linked to your website and this domain does not show up in the index, it is possibly a bad neighborhood.
As a general rule, a backlink profile should be as “natural” as possible, as if it was “grown organically.” The key word in this context is the link pyramid, a graphic collection of various links that are sorted according to quality. Links from bad neighborhoods should ideally not be contained in the link pyramid at all.