Is it possible to complete a PhD in CS in 3 years?
In theory, yes, it is possible. In practice it depends on many things. Let me try to list a bunch of the variables that have affect the time required.
The minimum requirements that you are likely to find for a doctorate are (a) pass a set of qualifying exams and (b) write a dissertation acceptable to the faculty. There may be a few exceptions but most of the exceptions will add requirements.
To pass the examinations, you normally take certain courses. You may already have the knowledge needed to take the exams from your masters, but many courses are designed specifically to ready you for the exams. If you don't have the knowledge you need to get it (courses or elsewhere) and that takes time.
The examinations normally guarantee that you have a solid but broad knowledge of your field. Research, on the other hand requires deep but narrow knowledge of a small sub-field. The graduate courses are also fairly broad, but also start to take you into the depths of some subfield and many will stress recent advances in some field.
To write a dissertation requires that in a small area of your discipline you become a subject expert - world class. That may require additional course work in the form of seminars with faculty and a few students. If you start out close to the boundary of the known world in the area in which you want to do research then you can move quickly. Otherwise it may take time and study to gain the required focus.
To write a dissertation, requires some knowledge of research process and in some fields that can take time to master. It is less likely to be an issue in mathematics, say, or in some parts of CS. But if you lack the knowledge of how to do the specific sort of research required of you, it will take time to gain it.
To write a dissertation requires a suitable problem. That problem can come from you or from a suitable advisor. But if there is no problem at hand then it will take time and study just to find a problem. Moreover, the problem has to be suitable. If it is too easy to solve or too hard then it isn't suitable. I worked, briefly, on both too hard and too easy problems in my math degree. But disposing of them and coming to the right problem only took several weeks of study. But it is hard to put a time limit here as research, by definition, is an exploration of the unknown.
To write an acceptable dissertation you have to produce some valuable work at the boundary of knowledge by solving the problem(s) posed. You also have to write it up and make sure there are no gaps that might invalidate the work. This can take time.
You have to make your advisor happy. Sometimes this is easy but sometimes not. Usually, however, there is the question of "How much is enough?" This is a value judgement, of course, and you and your advisor need to come to agreement.
Finally, you need, in most places, to defend your dissertation before a committee or the public and you need to handle a fair amount of paperwork. This can take some time, also, but isn't normally a big issue.
Note that lots of these things take time, but most of them require an amount of time that is hard to estimate and impossible to bound. If you are well prepared for exams and research and you have a suitable advisor and a suitable problem then three years is feasible, provided that the problem itself doesn't have hidden traps that aren't apparent at the start. Again, the existence of those traps is impossible to predict since you are extending the known world.
There are countries where the standard duration of a PhD is 3 years so yes it's possible, but it usually means that the PhD is structured differently and the expectations differ. Even there it's very common that PhD last more than the standard duration: a PhD is research work and even in the best conditions it's often difficult to anticipate how the research is going to pan out. There can be all sorts of unexpected obstacles: somebody might publish some new finding which makes your approach obsolete, insufficient data for an experiment, an initial assumption might not be verified, etc.
So overall it's quite risky to set yourself a hard deadline from the start, as things often take a bit more time than expected. On the other hand, thinking of a serious PhD plan from the start can minimize the risk of delay.
In a US program, it is certainly possible, but it is substantially faster than average. It is easier in some areas (e.g. theory) than others (e.g. systems) where having a few brilliant ideas is sufficient, without the need to build an actual working piece of software. There are two ways I have seen it happen in theory:
1) Be a star: solve a few long standing open problems in your first couple of years, and write them up. This is obviously very hard; if you can pull it off, no need to stick around in the PhD program.
2) Publish a few mediocre papers and decide that research isn't for you. If you have enough material to barely clear the bar for a PhD, you can get out of the PhD program in 3 years, but not with a strong PhD. Usually the people who go this route just take software engineering jobs afterwards: so this isn't the kind of fast PhD you would want if you already have such a job.
Short of being a real star, good PhDs take longer than 3 years.