Fact-checked by Grok 2 weeks ago

Andrew He

Andrew He is an competitive renowned for his exceptional performance in algorithmic contests, including gold medals at the 2014 and 2015 (), silver and gold medals at the ACM (ICPC) World Finals in 2016 and 2019 respectively as part of the () teams, and victory in the 2021 Hacker Cup. He achieved a maximum legendary grandmaster rating of 3741 on , one of the highest in the platform's history, reflecting his mastery of advanced data structures, , and optimization techniques central to . Born and raised in , He began competing in high school, achieving notable success in the USA Computing Olympiad (USACO) as a three-time finalist from 2013 to 2015, which paved his path to the gold medals in 2014 and 2015, including third overall in 2015 with a score of 555.72 points. At , where he studied mathematics and computer science, He contributed to the university's strong showing in the ICPC, securing sixth place and a in 2016 with teammates Brian Chen and Steven Hao on the MIT ZERO team, and second place with a in 2019 alongside Kevin Sun and Yinzhan Xu on the MIT NULL team. His competitive record also includes top finishes in other prestigious events, such as first place in the 2017 and multiple high rankings in TopCoder Open and Distributed Code Jam. Beyond competitions, He has applied his expertise to , maintaining an open-source repository of C++ code examples for on , which supports educational resources in the field. Currently, he serves as a founding member at Cognition AI, an applied AI laboratory developing advanced tools like Devin, the first AI software engineer, where his background in algorithmic problem-solving informs innovations in automated coding and debugging.

Early Life and Education

Personal Background

Andrew He was born in 1997 in Cupertino, California, United States. His early exposure to mathematics began during middle school, where he participated in his first competition in sixth grade in Hong Kong. He continued with competitions including the American Mathematics Competitions (AMC) with top 20 finishes. In 2011, as an eighth grader, he represented California in the national Mathcounts competition, contributing to the team's championship win. He attended Monta Vista High School in Cupertino, California, from 2011 to 2015. During high school, in 2012, he was introduced to , marking the beginning of his involvement in algorithmic problem-solving contests.

Academic Journey

Andrew He completed his at Monta Vista High School in , graduating in 2015 as a senior participant in national competitions. Following high school, He enrolled at the () in 2015, where he pursued a dual degree in and . He graduated from in 2019. During his undergraduate years at , He was actively involved with the university's team, contributing to team efforts in international contests that honed his skills at the intersection of and algorithm design.

Mathematical Accomplishments

Olympiad Successes

Andrew He's prowess in mathematical competitions emerged early during his middle school years. In 2011, as an eighth-grader representing , he contributed to his team's victory as at the Mathcounts competition, showcasing strong problem-solving skills in a high-stakes environment. His consistent high performances in the (AMC) from middle school onward, often placing in the top percentiles, qualified him repeatedly for the (AIME) and advanced stages. Building on this foundation, He achieved significant recognition in national-level math olympiads during high school. In 2013, he was named a winner of the , earning a spot among the top performers and qualifying for the training camp, which he attended in 2012, 2013, and 2014. This accomplishment highlighted his ability to tackle complex, proof-based problems under time constraints. On the international stage, He excelled in prestigious math contests. At the 2015 Romanian Master of Mathematics (RMM), he earned a with a 12th-place finish overall, demonstrating his competitive edge in advanced international math challenges. These successes underscored his versatility in during his high school years.

Research Publications

The Cayley formula, a cornerstone of and , states that the number of distinct on n labeled vertices is n^{n-2}. First established by in 1889, this result enumerates the spanning trees of the complete graph K_n and holds broad significance in modeling connected structures, including applications in random graph processes, theory, and the enumeration of phylogenetic in . The formula's elegance lies in its simple closed form, which captures the exponential growth of tree counts while bridging algebraic and combinatorial perspectives. Andrew He, as a high school student, co-authored two influential papers providing accessible probabilistic proofs of the Cayley formula, showcasing advanced combinatorial techniques through random models. In the 2013 publication "A Simple Proof of the Cayley Formula using Random Graphs" (), He collaborated with Scott Wu, Ray Li, and Steven Hao to derive the formula using a random model on n vertices with n^{n-1} total configurations, where each configuration corresponds to each of n-1 non-root vertices independently choosing a parent uniformly from the n vertices. The core insight is a proving that the probability of such a graph containing a equals p = (n-1)/n, established via strong on n; thus, the probability of acyclicity is $1 - p = 1/n. The number of acyclic graphs is therefore n^{n-1} \cdot (1/n) = n^{n-2}. These acyclic structures are bijected to labeled trees on n vertices via directing edges away from a fixed , obtaining the formula. This method is notably elementary, relying solely on basic probability, , and graph bijections without requiring generating functions or matrix-tree theorems. The 2014 follow-up, "An Elementary Proof of the Cayley Formula Using Random Maps" (arXiv:1409.1614), by Steven Hao, Andrew He, Ray Li, and Scott Wu, shifts to random mappings (or functions) from an n-element set to an (n+1)-element set, of which there are (n+1)^n total. The authors prove, again by strong , that the probability of a in such a random map is n/(n+1), implying (n+1)^{n-1} cycle-free maps. A maps these acyclical structures—interpreted as rooted forests on n+1 points with one distinguished external point—to labeled trees on n vertices by contracting the external point and relabeling, yielding n^{n-2} trees. Developed during their high school tenure at Monta Vista High School, these proofs exemplify how random graph models and mappings can demystify classical enumerative results, making them suitable for introductory combinatorial education while demonstrating precocious mastery of probabilistic .

Competitive Programming Achievements

International Competitions

Andrew He represented the at the (IOI), a prestigious annual competition for high school students focused on algorithmic problem-solving, where he earned medals in both 2014 and 2015. Building on his entry into competitive programming in 2012, He excelled in the 2014 IOI held in Taipei, Taiwan, securing a medal with a total of 472 points out of 600, with strong performances including full scores on several subtasks. In 2015, at the event in , , he placed third overall with a score of 555.72 out of 600, again earning through strong performances across all six tasks, including maximum scores on several. These achievements highlighted his ability to tackle diverse challenges in data structures, , and optimization under individual time constraints of five hours per contest day over two days. During his time at the (MIT), He transitioned to team-based competitions in the (ICPC), a global event emphasizing collaborative algorithmic implementation. In 2016, as a member of the MIT ZERO team alongside Brian Chen and Steven Hao, he contributed to a and sixth-place finish worldwide at the ICPC Finals in Phuket, , solving nine out of thirteen problems. The team prepared through regional contests, including a second-place finish at the Northeast Regional Contest (NENARC) and third at the North American Invitational, which helped build coordination among the members—all experienced "red"-rated competitive programmers with IOI medal histories. Team dynamics were strengthened by their shared backgrounds in high-level contests, enabling efficient division of problems during the five-hour finals, where only one computer is shared among three participants. He returned for the 2019 ICPC World Finals in , , as part of the team with Kevin Sun and Yinzhan Xu, securing a and second-place ranking globally by solving nine out of eleven problems and claiming the North American championship. Preparation mirrored the prior year, involving practice in invitationals and regionals to refine team strategies, with the group's complementary skills—rooted in advanced topics like dynamic programming and —facilitating rapid debugging and solution integration. The competitions posed intense challenges, requiring teams to devise efficient algorithms for real-world-inspired problems, implement them in languages like C++ without external libraries, and manage time pressure to maximize solved problems while minimizing penalties for incorrect submissions.

Online and Professional Contests

Andrew He has achieved notable success in online and professional coding competitions following his college years, establishing himself as one of the top individual competitors globally. In 2021, he won the Facebook Hacker Cup (now known as the Meta Hacker Cup), securing the championship title against a field of elite programmers. He previously earned third place in the same competition in both 2018 and 2020, demonstrating consistent high performance in its challenging algorithm-focused rounds. His accomplishments extend to Google-sponsored events, where he placed third in in 2019 and 2020, qualifying for the world finals each year among thousands of participants. Earlier, in 2017, He won the , a specialized contest emphasizing parallel and algorithms. Additionally, he finished as runner-up in the 2020 Topcoder Open Algorithm competition, highlighting his prowess in high-stakes, timed problem-solving environments. In recent years, He has maintained his competitive edge with strong showings in international online contests. He placed ninth in the 2024 finals, earning a spot among the top 25 global finalists. That same year, he secured a silver medal in the Cup 2024 Algorithm track and won the AtCoder World Tour Finals 2024, placing first and earning a gold medal onsite in against the world's leading algorithmic experts. On platforms like Codeforces, He holds legendary grandmaster status, with a peak rating of 3741, reflecting his exceptional skill in rapid contest programming and problem analysis. Across these contests, he has accumulated approximately $62,213 in prize money, underscoring the professional impact of his achievements.

Professional Career

Role at Cognition AI

Andrew He joined Cognition AI as a founding member in November 2023, after working as a software engineer at Impira from July 2019 to October 2021 and at Modal from October 2021 to November 2023, following his Bachelor of Science in mathematics and computer science from the Massachusetts Institute of Technology in 2019. At the company, he serves as a software engineer, focusing on the development of AI systems designed to assist with coding tasks and complex problem-solving. He played a key role in the development and launch of Devin, Cognition's flagship AI software engineer, which was announced in March 2024. The tool, capable of autonomously handling end-to-end engineering projects, was demonstrated in part through He maintaining and debugging his open-source competitive programming book, showcasing its practical application in real-world software tasks. Cognition AI emphasizes recruiting top competitive programmers to its team, leveraging their expertise in algorithmic efficiency and rapid debugging to advance AI capabilities; notable hires include Gennady Korotkevich, a multiple-time world champion in programming contests. He applies his competitive programming background to enhance AI model training processes and debug open-source projects, drawing on skills like efficient algorithm design that directly inform the creation of autonomous coding agents.

Ongoing Contributions

Andrew He continues to maintain open-source resources for , notably through his repository "cp-book," which provides a library of generic, efficient implementations designed for contest use. This project, described as a reference code book, receives ongoing support from AI tools like Devin, an software engineer developed by , which assists in debugging and maintenance tasks. His contributions extend to the broader community via platforms such as under the username ecnerwala, where he shares code and resources, and , where he has accumulated +67 points in community contributions through problem discussions and engagements. He remains active in educational and inspirational roles within the competitive programming ecosystem, participating in alumni talks and interviews that highlight the intersection of contest skills and professional development. For instance, in April 2024, he delivered "My ICPC Story," discussing how competitive programming shaped his career as a developer. Later that year, at the 2024 ICPC World Finals in Astana, he gave an alumni talk on his experiences and conducted a post-contest interview, emphasizing the enduring value of algorithmic problem-solving. These engagements, along with his YouTube channel featuring competitive programming content and analyses, foster mentorship for aspiring programmers. Transitioning from a background in high-level contests to a founding role at Cognition , He sustains his involvement in through participation in major events, including head-to-head matches at the 2025 ICPC World Finals. As of 2025, his work bridges algorithmic expertise with advancements, with potential explorations in integrating contest-honed techniques into AI-driven research and tools.

References

  1. [1]
    Andrew He - IOI - International Olympiad in Informatics
    Rel. 2015 · United States of America · 100 · 55.72 · 100 · 100 · 100 · 100, 555.72, 92.62%, 3/322, 99.38%, Gold. 2014 · United States of America · 56 · 100 ...
  2. [2]
    Standings for ACM-ICPC 2016 World Finals
    May 19, 2016 · Silver medal 6. United States · Massachusetts Institute of Technology (MIT ZERO):. Andrew He, Brian Chen, Steven Hao ; Silver medal 7. Russia.
  3. [3]
    Standings for ICPC 2019 World Finals
    Apr 4, 2019 · Andrew He, Kevin Sun, Yinzhan Xu. 9, 1191. North America Champion. $9900. Gold medal 3. Japan · The University of Tokyo (Gifted Infants):. Kohei ...
  4. [4]
    Standings for Facebook Hacker Cup (all years)
    Facebook Hacker Cup 2021 ; Gold medal 1. United States · Andrew He (ecnerwala) ; Silver medal 2. Ukraine · Алексей Данилюк (Um_nik) ; Bronze medal 3. China.
  5. [5]
    ecnerwala - Codeforces
    ecnerwala. Andrew He, Cupertino, United States. From MIT. User''s contest rating in Codeforces community Contest rating: 3555 (max. legendary grandmaster, 3741) ...<|control11|><|separator|>
  6. [6]
    AlphaStar Alumni
    ANDREW HE. During his high school years, Andrew participated in USA Computing ... Facebook Hacker Cup, TopCoder and Codeforces. ANDREW LIN. Andrew is a ...
  7. [7]
    Profile of Andrew He - Competitive Programming Hall Of Fame
    Andrew He. Country: United States. Prize Money: ~$62213.02. External Profiles: AtCoder profile ecnerwala at AtCoder · Codeforces profile ecnerwala at Codeforces.
  8. [8]
    [PDF] The Kazakhstan Competitive Programming Federation - ICPC Global
    Sep 20, 2024 · The ICPC Foundation is honored to announce a presentation by Andrew He, founding member of Cognition AI. We hope it will inspire future ...
  9. [9]
    Introducing Devin, the first AI software engineer - Cognition
    Mar 12, 2024 · Devin helps Andrew maintain and debug his open source competitive programming book. Devin can train and fine tune its own AI models. Devin sets ...
  10. [10]
    M(IT)^2 2024 Spring Epilogue - MIT Informatics Tournament
    Andrew He - Cognition AI (500 points, 05:43:21); Andrew Gu - Massachusetts Institute of Technology (410 points, 03:49:13); Adam Gąsienica-Samek - XIV LO im ...
  11. [11]
    Best Competitive Programmers in the World - OpenGenus IQ
    Gold medal at International Olympiad in Informatics (IOI) 2004. Andrew He. Name: Andrew He Country: USA First appeared: 2014. Born: 1997. Affiliations: ...
  12. [12]
    2008 MAA AMC 8 Results & Awards - Studylib
    ... American Mathematics Contest 8 (AMC 8). The winners are listed on the ... Andrew He 6th grade Olympia Institute San Francisco, CA No photo available ...
  13. [13]
    Sophomore Andrew He wins grand prize at Santa Clara University ...
    Feb 20, 2013 · Sophomore Andrew He wins grand prize at Santa Clara University High School Mathematics Competition ... “I was surprised, but it wasn't unexpected.
  14. [14]
    South Bay middle school students — again — win national ...
    May 12, 2011 · The team included eighth-grade students Andrew He of Cupertino and Alex Hong of Los Altos, and seventh-graders Celine Liang and Sean Shi, both ...
  15. [15]
    Scott Wu, Louisiana 8th Grader, Crowned National Middle School ...
    May 6, 2011 · Team members include Andrew He, of Cupertino, Calif. ... "I want to congratulate our 2011 MATHCOUNTS champions for all their hard work and ...
  16. [16]
    Andrew He - Wikipedia
    Andrew He (born 1997) is an American competitive programmer and the winner of the 2021 Facebook Hacker Cup. Andrew He. Born, 1997 (age 27–28).
  17. [17]
    [PDF] Security - USENIX
    Mar 19, 2016 · • Andrew He, a senior from Monta Vista. High School in California. • Alexander Wei, a junior from Phillips. Exeter Academy in New Hampshire.
  18. [18]
    Trip Report: IOI 2015 in Kazakhstan - MIT Admissions
    While I was there independently, for Anglophonic reasons I tagged along with the American delegation, including Andrew H. '19, who placed third ...
  19. [19]
    NAC-NAPC Trainers - College of Engineering and Computer Science
    He participated in ICPC World Finals held in Beijing, 2018. ... He was the first person to break the 4000 rating barrier on Codeforces. Close. Andrew He. Andrew ...
  20. [20]
  21. [21]
    RMM 2015 - Romanian Master of Mathematics
    FRA 2, 7, 7, 0, 7, 7, 3, 31, SILVER. 12, ANDREW HE, USA 2, 7, 7, 7, 7, 0, 3, 31, SILVER. 13, SHYAM NARAYANAN, USA 5, 7, 7, 4, 0, 6, 7, 31, SILVER. 14, WARREN LI ...
  22. [22]
    History - USACO
    Andrew He (3rd place) Daniel Chiu Alexander Wei Demi Guo. 2014: Taipei, Taiwan. Scott Wu (1st place) Steven Hao (6th place) Joshua Brakensiek Andrew He. 2013 ...
  23. [23]
    Profile of Massachusetts Institute of Technology
    2. Massachusetts Institute of Technology (MIT NULL):. Andrew He, Kevin Sun, Yinzhan Xu. 9/11. North America Champion. $9900. 19 Apr 2018, ACM-ICPC 2018 World ...
  24. [24]
    Team Preview: MIT ZERO | ICPC News
    The line up (Steven Hao, Brian Chen and Andrew He) is quite solid as well – all of them are “reds”, Steven has received both gold and silver medals on IOI ...<|control11|><|separator|>
  25. [25]
    Regional Rules - ICPC Global
    The total time is the sum of the time consumed for each problem solved. The time consumed for a solved problem is the time elapsed from the beginning of the ...Missing: algorithmic | Show results with:algorithmic<|control11|><|separator|>
  26. [26]
    [PDF] world-finals-2019-brochure.pdf - ICPC Global
    Andrew He. Kevin Sun. Yinzhan Xu. PRINCETON UNIVERSITY princeton.edu. Team name ... ICPC 2019 WORLD FINALS. 76. THE 2019 ICPC FOUNDATION. GLOBAL IMPACT AWARD.
  27. [27]
    ICPC World Finals Baku
    A team-based algorithmic programming competition that challenges university students to solve real-world problems under time pressure.
  28. [28]
    Congratulations to the winners of the 2018 Hacker Cup Finals 1st
    Nov 2, 2018 · Congratulations to the winners of the 2018 Hacker Cup Finals 1st: Mikhail Ipatov 2nd: Makoto Soejima 3rd: Andrew He.
  29. [29]
    Standings for Facebook Hacker Cup 2020
    Final ; Bronze medal 3. United States · Andrew He (ecnerwala), 76, 7:06:26 ; 4. Switzerland · Petr Mitrichev (Petr), 76, 7:24:44.Missing: placement | Show results with:placement
  30. [30]
    Standings for Google Code Jam 2019
    Aug 9, 2019 · San Francisco, CA, United States ; Duration: 240 minutes ; Number of Finalists: 25 ; Scoring: (5+22)+(5+22)+(5+22)+(5+30)+(5+30)+(19+30)=200.Missing: Andrew placement
  31. [31]
    Standings for Meta Hacker Cup 2024
    Dec 7, 2024 · Facebook Hacker Cup. Official Page: https://www.facebook.com ... Andrew He (ecnerwala), 66, 6:58:30. $500. 10. Poland · Wojtek Nadara (Swistakk) ...<|control11|><|separator|>
  32. [32]
    Standings for Yandex Cup 2024 Algorithm
    Dec 3, 2024 · Gold medal 1. Russia · Денис Мустафин ; Silver medal 2. United States · Andrew He ; Bronze medal 3. Russia · Федор Ромашов ; 4. Japan · Yui Hosaka ...
  33. [33]
    Top Participants by Prize Money
    Competitive Programming Hall Of Fame. ... Andrew He (ecnerwal), ~$62213.02. 10, Tiancheng Lou (ACRush), $59950.00. 11, Benjamin Qi (Benq), ~$51510.49. 12, Egor ...
  34. [34]
    Andrew He - MIT ESP
    ANDREW HE, ESP Teacher. Major: 18, 6. College/Employer: MIT Year of Graduation: 2019, Picture of Andrew He. Brief Biographical Sketch: Not Available. Past ...
  35. [35]
    Cognition AI 2025 Company Profile - PitchBook
    When was Cognition AI founded? Cognition AI was founded in 2023. Where is Cognition AI headquartered? Cognition AI is headquartered in Naples, FL.
  36. [36]
    Andrew H Email & Phone Number | Cognition Human Software ...
    Andrew H, based in Cupertino, CA, US, is currently a Human Software Engineer at Cognition. Andrew H brings experience from previous roles at Modal, Impira, ...
  37. [37]
    Gold-Medalist Coders Build an AI That Can Do Their Job for Them
    Mar 12, 2024 · Cognition AI is full of sport-coders. Its staff has won a total of 10 gold medals at the top international competition, and Scott Wu says this ...
  38. [38]
    Cognition's AI Developer 'Devin' Eyes $10 Billion Valuation—Even If ...
    Jul 24, 2025 · For now, Cognition continues to hire competitive programmers—its ... Gennady Korotkevich and Andrew He, both renowned for their coding ...
  39. [39]
    Cognition, competitive programmers, and Devin, the first AI software ...
    A startup, built by mostly competitive programmers, launching a demonstration of which is the state-of-the-art. You can watch their demo of Devin, the first AI ...
  40. [40]
    ecnerwala/cp-book: Book Code for Competitive Programming - GitHub
    This is my library of reference code for competitive programming. The goal is to write generic, fast, and clean algorithm implementations for use in contests.
  41. [41]
    Andrew He ecnerwala - GitHub
    Software Engineer || Top Competitive Programmer. 1.3k followers · 7 following. Achievements: Achievement: Starstruck x3, Achievement: Arctic Code Vault ...
  42. [42]
    My ICPC Story - Andrew He - YouTube
    Apr 15, 2024 · ICPC alumnus Andrew H. talks about the role of competitive programming in his evolution as a developer.
  43. [43]
    Alumni Talk featuring Andrew He - YouTube
    Sep 16, 2024 · Welcome to live broadcast of Alumni Talk at 2024 ICPC World Finals Astana! Visit https://worldfinals.icpc.global/ for more information!Missing: Labs | Show results with:Labs
  44. [44]
    2024 ICPC World Finals Postcontest Interview by Andrew He ...
    Sep 19, 2024 · This content isn't available. 2024 ICPC World Finals Postcontest Interview by Andrew He (ecnerwala) ... Why competitive coding is not just about ...<|control11|><|separator|>
  45. [45]
    Please meet ICPC Alumni Andrew He @ecnerwala, founding ...
    Sep 16, 2024 · Meet ICPC Alumni Andrew He @ecnerwala, founding member of Cognition AI at #ICPCAstana. Alumni Talk featuring Andrew He.
  46. [46]
    ICPC World Finals Livestream: ecnerwala and SecondThread ...
    Aug 29, 2025 · One of the most accomplished competitive programmers in the world, Andrew is a Codeforces Legendary Grandmaster, two-time IOI gold medalist, ...Missing: ongoing contributions
  47. [47]
    ICPC World Finals Baku: ecnerwala vs SecondThread - YouTube
    Sep 2, 2025 · https://codeforces.com/contests/2141,2142 Join us live from the ICPC World Finals in Baku! Watch Andrew 'ecnerwala' He take on David ...<|control11|><|separator|>