I've taught three people to code from scratch (my brother and two friends from college). All were able to get junior-level jobs in the SF Bay Area within 6-12 months. All have since made significant progress in their careers.

To answer your questions:

1. Is it possible to do in 4 months? Certainly, but you will have to work your ass off, and also work very efficiently.

2. How is it possible? Work 60-70 hour weeks (easy if you love programming and can finance yourself without a job, hard otherwise), and have a super efficient curriculum.

3. What path should you take? I'll give you my advice below. To do so I'll have to make lots of assumptions about your situation, but here goes anyway:

---

- Avoid bootcamps. Assuming you're more motivated than the average person in your class, they will only slow you down. (One of my friends started a bootcamp against my advice, regretted it, and quit halfway through. The pace was too slow. Very few of the graduates got jobs afterwards.)

- Give up on being full-stack. Four months is not long enough. You will need to strategically cut corners, and this is a big one.

- Buy a Mac, ideally a MacBook Pro. Get one used if you have to. Don't try learning on a PC.

- Right off the bat, start using the Terminal for everything: downloading files, installing programs, opening programs, navigating the directories on your computer, copying files, deleting files, etc. When you don't know how to do something, Google it. It will be painful at first, but you will get good eventually, and it will save you pain later.

- In general, remember that learning new things (everything below) will often involve lots of pain and frustration, but push through it. Once you start to develop mastery in an area, it tends to get much more fun.

- When learning, you want to "see saw" between reading and doing. Too many people try to read and memorize everything, but that's impossible. Reading is just to orient yourself so you can figure out where to start. Doing is how you learn and remove confusion. Then you read some more to answer specific questions. Repeat.

- Start with HTML/CSS. Find cool website screenshots on Dribbble.com and try to build rough versions of them from scratch. Don't neglect to learn flexbox. Do this regularly for a cpl weeks and you'll get good.

- Meanwhile, learn basic programming. Use JavaScript. Remember to see saw. Read just enough to get the just, then dive in and practice. There are lots of algorithmic practice problems online, e.g. http://codingbat.com/java. Do hundreds of them until recursion, and looping, and writing functions, and solving basic algorithmic questions you find online is easy.

- When you are good with HTML/CSS and familiar with JS, it's time to combine the two. Learn about the DOM and learn about jQuery. You'll see how JS can make your pages interactive. Work on small projects, the first of which should be a portfolio that you can showcase your subsequent projects on. Use Git and GitHub for these projects.

- Continue reading about JavaScript. Read books on it. Learn the intermediate and advanced parts of the language. People will tell you to learn frameworks like Angular, Ember, React, etc. Ignore them. Even jQuery (which is much simpler) will be a bit much for you to handle and will seem like magic at first. You don't have time to dive too deep. This is just the price you pay for learning in 4 months. But that's okay, you can still get a job.

- When you do get a job, don't stop learning. Everyone I've taught stopped (or significantly slowed) their learning after landing their first job. They regretted it later and eventually resumed learning.