How I Learned DSA and got into Microsoft

Being a non-CS student, how did I start coding? What was my motivation and which course did I take? How did I start? Which course did I choose to begin with? What was my schedule? How did I do time-division? How did I use lead code? What is the perfect time to get into CP? And how do we prepare for the interviews in the last 15-20 days and how did I prepare? I will be telling you about my experience of how I learned DSA and got into Microsoft.

How Did I Start Coding?

So let’s get started. 1st question is, being a non-CS student, how did I start coding? What was my motivation and which course did I take? Since I was in the circuital branch, I had many friends who had already started coding and many companies don’t for electronics. That’s why I went into the coding thing. I asked my friends which course to take. A lot of my friends were doing this DSA foundation course from Coding Ninjas. So I took it because I really liked it. The style of their teaching, the way they used to portray and tell us about the concepts. I had really liked Ankush sir. That’s how I started with the course.

What Was My Schedule?

I had first chosen the course of DSA Foundation course. Then as soon as covid started, I had started my preparation during covid since it was a complete lockdown during covid, I had a lot of time to prepare. I did my time division like this – I used to study at night because while studying. I needed to study at a stretch. It’s not that we study for 1 hour and then take a break for half-hour. I have never done this. My schedule was to sleep at 4 during the day and wake up at 8-9 pm at the night. After waking up at 8-9 pm, I used to study till 6 am.

In between, I used to eat my dinner and all but I used to study at a stretch. I used to study in a stretch. I have studied at a stretch and then used to manage 15-16hrs. per day because at the night, there is absolutely no noise. It’s very peaceful. That was the perfect time when I started coding.

When I completed my course, the 1st thing I did was, concentrated only on the course. Some people ask, ‘should I practice along with the course?’ I say, ‘1st complete the course, because the questions that you are doing now ‘you may not know the alternative way to do it, you will not know how to reduce its complexity. ‘But once you complete the course, you may find another way to solve your old questions.’ It will be a good method.

So first finish the course so that you get an overall knowledge as to which data structure we can use there. So my schedule used to be like this – I used to study till 6 am at a stretch. Then I took some break and again study till 12noon. Then I used to sit at 8 am again, studying from 8 am-12noon. After that I did other work and go to sleep. Like this, I used to have 14hrs. a day and like this I got time.

How Did I Practice?

After that, as soon as my course got over, after the course completion what did I do was, I started solving questions in their Code Studio because I didn’t know where we can practice. So I practiced a lot in Code Studio. After Code Studio, I had a talk with my senior. He told me that for cracking Microsoft, you should try doing Leet Code. I started with Leet Code.

To answer, how did I start using LeetCode effectively? There is a way to use Leet Code. First and foremost – what I did was I did all the easy questions. Why? There were many easy questions. They were more than 300-400 questions. So I easily did 200-300 questions. Why? Because when you do the easy questions, that too 200-300 you come to know that these types of questions can come to these type of questions are there and when you do 200 questions you get an overall sense that this method can be applied. Because in 200 questions, it’s quite possible that you see the same question again.

So I first did all the easy questions so that I get good practice in code. Practice coding is very important and if you do easy questions, then your hands will be used to it. So I got a very good practice in writing codes. I started with the easy questions and then I shifted to medium. I had this thing of doing at least 10-15 questions per day. How? I used to do 8 easy questions, 5 medium-level, and 2 hard questions.

Like this, I had done my division. 8 easy so that I never lose the practice of writing the code. 5 medium because we must always keep our level high and 2 hard because hard questions are very important for the interview. So this was my system. I did 15 questions per day. That’s enough for Leet Code.

How To Use LeetCode Effectively?

After that, how to use Leet Code effectively. On Leet Code, there is a contest every Sunday morning at 8 for 1.5hrs. it was DSA-oriented. I used to wake up every Sunday at 8 am and appear for the contest. 4 questions used to come. 2 questions came in the starting because everything has a start. When I used to prepare, only 2 used to come. So this was it. Editorials are very important.

What’s the method for studying editorials on Leet Code? As soon as solve the questions, after solving the questions, don’t jump to the next question. Try to read the discussion section. My favorite users were @lee215 and @hypeit. I used to read the editorials of these 2 users.

Because why editorials are important? What happens many times is that you try and write very long codes. You write big codes but it has a shorter version also. Like if you want to do a sum, then there is an innumerate function inside the STL function. You can directly use that function and remove the sum. So you come to know of shortcodes, ‘Ok, this question can be done like this also’. And @lee215 and @hypeit are very good users. Their editorials are very good, you can understand them.

So whenever I used to do Leet Code, after every question, after the solution I used to see the solution of at least 3-4 users and not only this. In Leet Code, you get a graph telling you in which time region your code is lying. I always went to the short time region, clicked on it the random users who are there who have taken less time, I used to see their codes and see why they have taken less time and why my time execution is more. Like this, I used to see 4-5 codes. Because of this, the domain that I have for coding increased this function, this method, we can do it using this method also.

This is how you can use Leet Code effectively. You have to do 10-15 questions 8 easy, 5 medium, and 2 hard. There are questions from every level. Never leave the Sunday morning 8 contests and I also told you how to read editorials. @Lee215 and @hypeit and there are many other good users. Read theirs also but it’s very important to read editorials because you know only one way of coding. But there are a lot of methods.

When To Start Competitive Programming?

Now 4th thing. Let’s come to the 4th question when is the perfect time to start competitive programming? When did I start my competitive programming? Once I crossed 300-400 questions of my Leet Code, then I thought that I know DSA. I know every data structure, maybe more. So now let’s skip to competitive programming because Google and other big companies always asked questions about competitive programming. Good concepts were asked.

So I spoke to a senior and asked whether competitive programming is important and how to do it? They told me that Code Chef and Code Forces are good to go. So what I did was – there are extra maths in competitive programming like Euler Totient, and Number Theory, so all these are not taught in regular courses to us. So for that, what I did was, I did a course from Coding Ninjas. I took the competitive programming course in which there was Parikh sir, our mentor. It was an excellent course.

I started with that course and because I knew coding here the pre-requisite for a competitive programming course is DSA. I had learned coding really well during DSA and I knew how to write code. Now along with the topics of competitive programming, I used to search for those types of questions on Code Chef and Code Forces. I used to practice them there.

After doing Leet Code, I did the topic-wise practice of competitive programming. On Code Chef and Code Forces, I started practicing the DSA series along with the questions which were in the Coding Ninjas course. I did this. This is when I started with competitive programming.

Along with it, since the domain of competitive programming is very big so there was another good website called CP Algorithms, here you will get a very good theory. So from CP Algorithms, I did the theory of graphs because many questions on graphs were asked. That I did graphs theory from CP Algorithms and did practice on Code Chef, Code Forces, and on Code Studio of Coding Ninjas. I used the platform on all these 3 and practiced them here.

When we appear for contests, our ratings always fall. I never got scared of that because we knew that if today was bad but tomorrow will be good. It’s never like this that on the 1st day, you started with Code Forces you are thinking that today let me become an expert, and tomorrow I will become a candidate master. It’s a gradual process. Many times, I lost hope but I had to go on, I had to study. With this enthusiasm, even that will happen.

Last-Minute Interview Preparation

Last question, before the interview, the 15-30 days which were there how did I study in them? The last 15-30 days are crucial and before the Microsoft interview, I was already prepared. I had already done a lot of coding. I had done 400-500 questions on Leet Code. On Code Chef and Code Forces, I had done 250,250 questions and I had already done many questions on Coding Ninja’s Code Forces. So I had no issue with coding before the interviews. I knew that I will crack coding.

The main issue was how to do OSDBMS and OOPS? So what I did for this, I had done the course. And apart from that, I studied ‘Cracking the Code Interview’. In Cracking the Code Interview, they had given very good system designs. So I did system design from there.

I did OOPS from Coding Ninjas theory. For OS and DBMS, I did GFG’s lemons, and last-minute notes, I did. Whichever topic was there, I used to go on seeing them and I also attended one of their conferences. So because of that, I learned a bit about OS and DBMS. But they didn’t ask me much about it in my interview. OOPS are very important. I did OOPS from Coding Ninjas notes and system design, as I told you. I did from CTCI.

In the last 15 days, the preparation is done quite comfortably. Never panic because interviews are quite easy. It’s only our fear that they will not be good. Don’t think like this. Just go on preparing comfortably. What did I do for coding? In the last 15 days or last 3 days, there is so much pressure on you as you don’t know if you can do coding or not.

So what I did were the top 50 questions that the company had I used to remove them and keep them. Whichever question I knew, for whichever question I got the instant solution in my mind I used to write the code. I used to write handwritten codes. It took 5 mins to write the code, I used to write codes. I wrote and submitted them.

If I made a mistake, I came to know where I made the mistake. But if I didn’t get the solution to the question within 5-10mins, I used to see tutorials because I didn’t want to waste time. I see the tutorial as to how to do it within 5 mins. Then I got it. So I did one now and one I used to do later. Like this, it got ingrained in my mind. In the last 15 days. I had to do lemons of OSDBMS and OOPS. I did them.

The questions which I knew, I used to instantly code them and for the questions which I didn’t get, I saw their tutorial for them. So I started very easily. The schedule was a bit tight but still, I did it. My internship started in August and I started my preparation in March/April. I had only 4 months with me to do it, that’s why I had a very tight schedule.

I used Leet Code very effectively. The course is very important. Do the course very well and once you start doing the questions well take the course on competitive programming. For competitive programming, you will have a lot of other platforms. Do the questions. In their course, there are very good questions. I had done a course from Coding Ninjas, there are very good questions in them. I learned a lot from there and used CP Algorithms. The last 15 days are very important. I remained completely calm and gave my interview.

This was my overall learning experience. It was very good. I enjoyed studying it, that’s why I could do 14-15 hrs. a day. So this was it – my overall learning experience. And I hope, if you find my path proper, then follow it. Adjust the time as per your convenience. It’s not that you have to study for 14-15hrs. It’s like, if you like it then you will study it. Editorials are very important. Do the preparation for the last 15 days very comfortably. Don’t waste your time. Just do it well. All the best! I hope you guys are all safe. Study well. Take care.

Make Your DSA Notes precise and easy to revise: Read Here.

Leave a Comment