yes you can be denied employment if it's stipulated from the beginning that it's a drug-free workplace. if during the course of you being considered, it's explicitly stated that they conduct pre-employment and random drug tests, then stop smoking weed.
flush that system out.
it's a very unusual scenario because several states have bent over to unions, passing laws that require companies that choose to perform random drug testing to provide drug counseling to employees that give a positive result, instant termination is not possible in these states, and small-medium sized companies don't drug test to avoid these costs. immediate termination because of a failed drug test will only be the result:
if the employment contract says that the result of a failed drug test is immediate termination;
if the employment contract states that you are working 'at will', which means that you reserve the right to quit at any time without penalty, and the employer reserves the right to fire you without cause, pay you the wages due, and thats the extent of the relationship;
or if the corporate by-laws, approved by the board of directors and shareholders, state that drug use is not tolerated...
again, different states have differnet laws, but the general idea is that if you're smoking a shit ton of weed, avoid jobs that include pre-employment drug screening as part of the job description, or avoid big companies altogether.
If you work for a government contractor you're fucked too. they don't allow any drug use, and since almost all fortune 500 companies have some sort of government contract, don't try and look for a career in Boeing or Lockheed Martin while smoking weed anytime soon. it's doable, but the pain in the ass of having to know when the drug tests are coming would drive any normal person completely insane. i know a buddy of mine who pulls it off, at raytheon, and he has to walk to work with a fake piss bag on him all the time, nervous n shit, i swear he's lost some hair since he started that job....