What does it take to get into the top 10 graduate programs in Computer Science?
You need a GPA of about 3.5 or above to have a chance of even being considered for admission in a top-10 CS PhD program, but once you’re above that threshold, other parts of your application start to matter more. Admissions committees in top departments are looking primarily for strong potential for high-quality independent research. In particular:
Your research statement (aka “statement of purpose”) must describe your research experience and interests, in explicit, technical, personal, and credible detail. In particular, your statement should read as though it was written by a (potential) researcher, not from the point of view of a successful student.
Your recommendation letters must specifically address your potential for research, in explicit, technical, personal, and credible detail. Letters that merely reiterate that you got a good grade are worthless. In particular, you must interact with faculty as more than just another student, so that they know who you are and what you can do outside the classroom.
You must have evidence/experience that you and your recommenders can point to as evidence of your potential for research. The best such evidence is published high-quality research, but independent study classes, open-source projects, internships (that aren’t just coding-monkey jobs), teaching/tutoring experience, blog posts, contributions to Wikipedia, and even participation on Q&A sites like Quora can be useful. (I first met one of my current PhD students on Theoretical Computer Science StackExchange.)
Finally, you must be very very lucky.