Your research statement (aka “statement of I’m the aunt witch Halloween shirt 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. And neither is a 4.0 GPA. 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 Ph.D. 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 the strong potential for high-quality independent research. In particular: In the past, Facebook had a boot camp for all new employees. You were expected to learn how to code and ship some sort of feature at that time. If you weren’t able to, no hard feelings but it was time for you to move on. Not making the grade for Facebook’s boot camp is very different from being fired for malfeasance or incompetence. It’s an absence of positive data in a fixed time frame.
Your recommendation letters must specifically address your I’m the aunt witch Halloween shirt 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.