Best place for a beginner

I want to know a beginner-friendly site among codechef, hackerrank, hackerearth etc. I started with spoj and after a while, the complexity increased after 15 odd questions. I want to follow a step-by-step procedure where I can learn basics. I want to where you guys started, places you practised at and resources you guys followed.

Hackerrank is best place for #Beginners .

1 Like

Hackerrank.com and Hackerearth.com are by far the best. Hackerearth also has tutorials for the concepts/category of problems.

If you are clear with syntax of your language, and are starting with implementing stuff/algorithms, then I suggest practice questions from both side by side, else there are ā€œlanguage specific tutorialsā€ on hackerrank .

If you wish to improve debugging, then hackerearth is quite user-friendly as it gives details like from where your output went wrong, in addition to test cases. Remember to think of test cases by yourself first and only see actual test case if youā€™re unable to come up with one. Then analyse the type of test case it was, why it gave error on your logic, why it didnā€™t strike you &etc.

Codechefā€™s beginners problems are also good, but you might get stuck in some and since test cases arenā€™t available, things tend to be hard if you arenā€™t average-good at debugging. So I will say first see where you stand in finding corner cases. Also, they arenā€™t sorted by the concepts, meaning you may find a problem of graph theory in that section, whose concept you many not know yet.

That being said, remember that its mostly practice. Try to get/absorb a variety of concepts and tricks. Hackerrank is good here as problems are sorted by the techniques very nicely (eg-DP, graph theory, bit manipulation etc.)

Also, in case you feel a particular algo or something isnā€™t clear, http://www.geeksforgeeks.org/fundamentals-of-algorithms/ is good for reading it over. Also, some suggest youtube videos of tushar Kapoor (or tushar roy? I am forgetting the name, pardon me.).

I think this much is sufficient for you right now. Remember, if youā€™re stuck, you can always ask for help, but its also necessary that you attempt to fix it yourself first/give a try at debugging (as its vey important during contests, where you must debug your own code.)

EDIT- There are also some good tutorials like https://www.topcoder.com/community/data-science/data-science-tutorials/

Codechef also has some good tutorials https://www.codechef.com/wiki/tutorials

But I recommend check geekforgeeks first, and then check any other tutorial. Or you may also find which siteā€™s tutorials are more in sync with you, and stick to them.

Also, should something give problem in particular, its always good to ask it as a question as discussions tend to be good at doubt solving :slight_smile: .

2 Likes

It depends. You havenā€™t clearly specified how much of a beginner you are. Are you new to programming? Have you studied Data Structures and algorithms? Or have you studied both but are new to competitive programming?

The answer depends on that.
If youā€™re #1 or #2, then HackerRank is a good place to practice concepts. Make sure you learn from lectures like MIT OpenCourseWare or other good resources.
If youā€™re #3, then anything should work fine. Iā€™d still recommend HackerRank, but all the other sites are similar. (I think HackerRankā€™s user interface is a bit funky).

When you learn a new algorithm or trick you can solve some problem on that topic from uhunt . its a catalog of UVa(acm live archive) problems. They have a great collection of problems.

thanks a lot. Can you tell me the sequence and tracks to follow?. Also for number theory, should I first solve Project Eulerā€™s problems or directly go to mathematics section

If you can provide me with some details like which language you are trying, and/or if you had ANY previous experience of programming (learnt in high school or etc.) then I can provide a more accurate answer.

But yes, what I did (when I was learning c) was to start with 30 days of tutorial (did till 2-D arrays, after that I felt that my grasp on basics and syntax was good enough). You can also simultaneously follow your specific language tutorial side by side. (Also, I observed some overlapping questions between two, like 2-D hourglass problem).

I then started algorithms and first went to implementation (easy ones). I also used their test case system to improve my debugging and corner case finding. Once I did around 10-20 implementation problems to build my confidence, I switched to easy questions of other types, like string, search, greedy, bit manipulation (since medium level questions sometimes require you to know multiple concepts). Also, I simultaneously started participating in the contests organized by them.

(I later switched to C++ from C for competitions.)

I will be honest, even for easy questions, sometimes I had to spend 1-3 hours for the initial problems, especially in debugging part, but it pays off. As you start getting used to it and build confidence, you will see yourself skyrocketing. The most important tip is to stay up to dated with and participate in contests. They are the best learning resource, because sometimes the editorials of the problems give you a new insight or a new concept to absorb. Personally, I never knew C++ and Java had an in built sorting function until I saw one of the medium problems using it (I used to bubble sortā€¦and get lots of TLE XD) [PS: yes, it hit me like a brick back thenā€¦]

Also, donā€™t ā€œgive upā€ on contest problems just because ā€œIts a medium problem and I am still solving easy questions.ā€ Especially on hackerrank, where there is reasonable partial marking. I was able to get some score out of even hard questions, and see where my solution stands. (It gives all the more reason to check out editorial and see where we can improve!). Even if you are not even able to think of a code for the problem, just reading the problem has been beneficial to you as it brought you face-to-face with a concept you need to work on. It keeps you updated with what you still have to know (and trust me, solving such problems after knowing the concept is good fun. But not immediately, after some time, as such to avoid ā€œsolving under influence of memorisation.ā€ )

My personal experience- There was a mathematical contest , ā€˜Ad Infinitumā€™ on hackerrank. So, I was excited and immediately jumped to the easy problem. To my UTTER HORROR, it was BY NO FRICKā€™IN MEANS EASY. After hours of solving, debugging, REFINING REWRITING AND WHAT NOT, there were still cases giving me TLE. I then left it there to check other problem, after a score of 9 out of 15 or 20 (or perhaps 30, donā€™t remember lol).

The next problem was Medium, and if I correctly recount, before that I was able to solve NONE of the medium problems of contest or practice. But anyways, I go to it. It was something like a V-shaped cutter cutting an infinitely large rectangular cardboard, and we have to tell maximum possible pieces after N cuts.

So after reading the question, I was like ā€œ(T_T)ā€ but nevertheless I googled the concept of this cutting thing. And google led me to ā€œCutting a pieā€ concept. To my utter shock, I realized this problem was just a minor tweak in that algo, and the formula to be used was same but just with substituting 2n instead of n [derived via mathematical induction]. (To be precise, the answer for the V shape cutter at N= 1,2,3 was exactly same as for the pie at n=2,4,6. Easily seen via observation, or if you want a concrete proof, mathematical induction)

And yes, I got that problem correct. It was my first 8 line solution to a contest problem. Not only that, I also got placed in top 25% and won my first bronze medal (Top 12-25% users get bronze medal on profiles), and I was on the seventh heaven. All the more motivation to solve more problems and practice. But lol, soon my short 2 week vacation ended and college began. It got kinda hard to solve lots of problems (given that good Q make you cringe for 2-3 hours!) and also cope up with college. But I made sure to stay updated with contest and at least learn the concepts the contest editorials can teach. By and large I solve atleast 1-2 questions daily (tackling dp at the moment, it requires lots of patience and time after the elementary questions)

It doesnā€™t meant that after that contest all medium problems seemed easy, but yes, I found that its ALWAYS worth the try to check the concept on google and get acquainted with it. IT SERIOUSLY pays off. No matter what resource you are using, if you have an attitude of learning and excelling, you WILL go far, no matter what state you are I right now.

I hope that my experience helps you (by both, realizing my mistakes to seeing what good things I did)

3 Likes

@vijju123 Unlike other top contributors here, you really write your heart out. Keep up the good work!

1 Like

Thanks for your appreciation @aniketsanadhya :slight_smile:

1 Like