So, without further ado, here’s the interview –
Mayank – I started this when I was in 2nd year of my B.Tech.
Few months before, there was a coding practice test organized by my seniors.
I had also participated in that test but was unable to attempt even a single question.
All the questions were totally flowing over my mind, have never thought that coding is that much difficult.
Then after my first year was completed, in summer, I started competitive coding at hackerrank.
Everyday seems like failure as even easy questions ware unexpected and wasn’t able to figure out solution.
But, after so many hard practices, participating in various competitions and sleepless nights, I win over it.
Aiyush -Thanks! Awesome answer! A few more questions 😛
Which data structures do you use most often when participating in competitions?
Which topics like dynamic programming, greedy algorithms etc have given you the most benefit in terms of solving problems?
Like one can’t use arrays in place of segment trees for queries, for storing path mappings for a spanning tree, it would be so naive to use 2D array as it will be sparse and thus memory inefficient so adjacency list should be preferred , etc.
Now talking about topics, solving pure implementation problem i found to be a good prior as it reflects the ability of an algorithm designer without knowing any particular set of algorithms.
However there are also some nice topics like string manipulation, graph theory, bit manipulation, greedy algorithms.
Lastly I think understanding some DP problems is necessary first,looking at that how it’s solution is working and then proceeding towards finding a DP solution for other problems .Having overlapping sub problems is i think , an algorithm designer will benefit from, most. 😀
Aiyush – Last question – how did practicing competitive programming influence your style of writing code?
And what is your advice to beginners in this domain?