Member-only story
Facebook Hacker cup 2021 experience
I have participated in Facebook Hacker cup annual programming competition for 7 years (2013–2017, 2020–2021). Hacker cup competition happens in several rounds: Qualification Round, Round 1–3, Final Round. In every year when I participated I advanced to Round 1. This year in 2021 for the first time I advanced to Round 2. In this story I will go over my experience in 2021 and what I learned over the years of participating in Hacker cup.
Qualification Round
I solved 4 out of 5 problems in this Round scoring 64 points (out of 100 points) missing only the hardest problem. To qualify for Round 1, at least one problem needed to be solved. My solved problems were related to simulation, bfs/bfs, floyd-warshall algorithm, Least Common Ancestor(LCA) algorithm etc. Although I solved Gold Mine: Chapter 1 problem using LCA, it could have been solved using just graph traversal algorithm such as bfs/dfs.
Round 1
I solved 3 out of 5 problems in this round scoring 42 points. 24 points were needed to qualify for Round 2. Problem A1: Weak Typing — Chapter 1 was kind of a greedy problem if I name it. The ideal approach to Problem A2: Weak Typing — Chapter 2 is combinatorics, but my accepted solution was based on prefix sum approach. Problem B: Traffic Control was an interesting one because at first glance this problem seems daunting. Once you think about building a constructive algorithm, this problem becomes quite straightforward.
Round 2
I could not solve a single problem in this round mostly because this round is harder than the first 2 rounds. Also the easiest problem of this round seemed quite ambiguous to me. The real motivation to participate in this round was to win a t-shirt if I could secure a rank position within first 2000 competitors by solving at least one problem. Once I realized I won’t be able to accomplish that, I gave up within one hour of the competition.
My takeaway from this year’s experience is to practice advanced level coding problems on Tree, LCA, Edge centroid decomposition, Segment tree etc. The harder problems in Hacker cup are usually based on these topics.
Details of Facebook Hacker cup of 2021 is here: https://www.facebook.com/codingcompetitions/hacker-cup/2021
You can find all of my accepted solutions written in python in my github repository.
Thanks for reading the article. If you are not already a paid member of Medium, you can do so by visiting this link. You’ll get unlimited full access to every story on Medium. I’ll receive a portion of your membership fees as a referral.