Book

Exploring Freelancing

Navigate freelancing as a developer; find clients, manage contracts, ensure timely payment, and learn from experiences!

I solved a few hundred questions on LeetCode in Swift for my internship preparation in my third year. And I want to share my journey. This post summarises my planning and lessons learned along the way.

This is an excerpt from my upcoming book, “From a Small Startup to the Fruit Company: Internship Experiences.”

Introduction

The introduction dates back to my fifth semester, around December 2019. My final semester exams were going on, and I was almost flunking them. (Except management, I love the subject)

I didn’t plan to interview anywhere for the following summer. Instead, I wanted to apply to Google Summer of Code again while working on my apps.

Before the second last exam, someone at Apple posted on Twitter that they are hiring interns for summer 2020. With a note that their DMs were open for a referral. I sent them a subtle introduction and waited for their reply.

First Mail

A few hours later, I got a mail that Apple wanted to interview me. At this point, I hadn’t given a single coding interview nor prepared for it. So I asked them to keep the interview eleven days later to finish my exams. As they mentioned that there may be a coding round, I wanted to start grinding LeetCode as soon as possible.

The Journey Begins

I went through Reddit, Quora and YouTube to understand the interview procedure. Unfortunately, from what I read online, this fruit company doesn’t have a standard format.

I kept my strategy simple.

Buy LeetCode premium.

Go through all the questions under the “Apple” tag, and solve all Easy ones before jumping on Medium ones.

This was my plan for the next eleven days. I followed half of it, leaving out Tries and Graphs, in the end, to focus more on Trees.

  • 8th December - Linked List and Binary Search

  • 9th December - Arrays and Merge Sort

  • 10th December - Stacks and Quick Sort

  • 11th December - Queues and Bit Manipulation

  • 12th December - Heaps and Recursion

  • 13th December - Hash Tables

  • 14th December - Trees and BFS

  • 15th December - Tries and DFS

  • 16th December - Graphs and Dynamic Programming

  • 17th and 18th December - Revision and more practice

My focus was only on solving easy problems. This was the first time I was solving such questions and was struggling hard. I sorted the questions based on their success ratio. Solving those boosted my confidence with every successful compilation.

While solving the questions, I gave two to three attempts to every question. If I couldn’t, I would jump on YouTube to find an explanatory video for it.

I referred to the following YouTubers -

Their solutions were in Java, but I focused on the idea of the solution in layman terms. This helped me to code down the answer in Swift.

First Round

When the interview date arrived, I had done a hundred questions under the easy category. However, I definitely knew that I may get a question that can be a medium level or a hard one at max.

I started off the interview with a lot of confidence, talking about myself and my experience. But, the interviewer jumped into the coding part after five minutes, and I wasn’t ready for that.

I don’t know why I had made up my mind that it would be an initial round to get an easy question to test my basics. But, instead, the interviewer gave me a medium-level question I had no idea how to start with. At that moment, I knew I ducked.

I started the question with an anxious state of mind, hardly able to make any progress. The interviewer sensed that and asked me to come up with a solution first. While explaining the answer, it struck me that I could use a Dictionary/Set for this question for constant time complexity. So, as time slipped out, I described the linear solution with chunks of code and jumped to the faster one. The time got up before I could clean up my solution.

Day In, Day Out

After the interview, I had mixed feelings about it. I was able to convince the interviewer that I can code but wasn’t confident enough. Within a few hours, I got a mail that they want to proceed to the second round. I scheduled this one a week later. I recognized I had to grind Medium questions now to be able to breeze through the next one.

It meant doing LeetCode, day in, day out.

I went into what I call the berserk mode. Again, I spent most of the day on LeetCode, and utilized the breaks for practising behavioural questions. This time, I was comfortable solving Easy questions but struggling with the Medium ones.

I changed my strategy to do Easy and Medium questions alternatively. The YouTube videos and the discussion section played a vital role to sharpen my programming solving skills. Knowing how professional coders come up with the solution helped me shape my mindset.

A few days before the interview, the recruiter contacted me. Fortunately, the team went on a holiday, and the interview got rescheduled for 6th January 2021. That was more than two weeks of practice!

LeetCode had a package with 62 questions under the Apple category. (back in December 2019) It had a similar question to the one that Apple asked to me in the interview.

So my goal for the next two weeks was to finish this package. I. genuinely made this wrong decision made in haste. Instead of focusing on the basics, I wanted to take a shortcut, hoping to get a similar question again.

This package contained the following popular questions on topics -

  • Arrays and Strings

  • Linked Lists

  • Trees and Graphs

  • Recursion

  • Sorting and Searching

  • Dynamic programming

  • Design

I did these questions twice and was comfortable with them by the new year. But, again, I want to iterate that this was a flawed determination.

Due to some family reasons, I had to go to another city for a week with internet connectivity issues. Before the trip, I bought Cracking the Coding interview to read during the flight. Yep, I was overworking myself. The questions in this book are similar to what I practised on LeetCode, so it ended up being more of a revision.

Bombing the Interview

A couple of days before the interview, I had only two feelings - get over it as soon as possible and somehow get the internship because I don’t want to intern anywhere else.

Again, the interviewer jumped into the coding part after five minutes. They started with a basic fundamental data structure question that I didn’t expect at all. A data structure I forgot to revise. I was like, I was expecting some LeetCode Medium level question, what is this?

I panicked.

Somehow I told him the correct approach and partially coded it.

I knew I bombed this one.

After the interview, I was just cursing myself for wasting the time of the Apple engineer, the recruiter, the coordinator, and the person who referred me. The feeling is hard to express in words. I worked so hard on my technical skills, practised so hundreds of questions on LeetCode, gave my everything into it.

I got the rejection a few days later, and I still remember those words from the mail -

Unfortunately, we will not be moving forward in the interview process, but we encourage you to apply to future opportunities for which you qualify.

The biggest mistake I regret committing was — Apple or nothing. Thinking it was the end of the world if I fail the interview, which mounted an immense amount of pressure to perform flawlessly in the interview.

Another one was not giving mock interviews. I had no idea how to maintain my calm if my plan doesn’t go according to my plan. The best and free site I can recommend is - https://www.pramp.com.

Applying Everywhere

As with anyone else, it was the denial phase that was extremely tough to get over. Within a break of few days, I randomly started applying everywhere.

Microsoft, Coinbase, Thumbtack, Lime, Bose, Twitter, Yelp, FiscalNote, Redfin, Nike, Pocket Gems, Google, Wren Kitchens, Skydio, etc. XYZ company in the US, and I applied there. Most of them didn’t reply, and the rest sent the generic rejection emails after a few months.

After a month of running away from denial, I accepted my fate. I started looking for an internship in a startup in my country. At this point, I left LeetCode ultimately and open-sourced my solutions.

Promotion time! You can find the repository here - LeetCode in Swift

I got an internship at a client/product startup and decided to intern there in the summer if I earned the opportunity.

Second mail

Around mid-March, I got another mail from Apple that they want to interview me. After that miserable rejection, I took this mail casually. The mail specifically mentioned a coding round, so I decided to get back to LeetCode again. I scheduled the interview four days later.

Repeating the Same Routine

As the heading says, I was repeating the same routine. This time, I focused more on the basics instead of more brutal Medium and Hard questions. I mostly solved the same questions again under the Apple tag while concentrating on the fundamentals.

This time, I didn’t pressure myself to give my everything; instead, I focused on being calm and content with my preparation.

Nailing the Interview

I went with the attitude that I’m already selected, and my interviewer is my manager, who’s going to have a friendly conversation with their incoming intern. So this thought process removed all the anxiety and pressure of performing well.

Although, the interview didn’t turn out to be what I expected. Instead of jumping into the coding around five minutes in the discussion. The interviewer focused on my previous projects and tested my knowledge of the technology they were working on. I was excited to work on Voice Control, so I breezed through the questions and this round.

I eventually got the internship.

Worth it?

I’ve mixed feelings while answering this question.

If I look back, was it worth sacrificing my sleep? Nope.

Was it worth getting into Apple? Yes. I learned a freaking lot from my manager, their decade of experience working in the industry, my coworkers, and other interns. How the code at a company of this scale looks like, empowering millions of users.

However, I hope the interview process shifts to more essential questions about the team you’re applying for instead of unrelated programming questions.

Lessons Learned

I’ll outline the lessons I learned over the few months of solving problems on LeetCode. This is me talking to my past self.

  • Be true to yourself. If you cannot solve a problem, don’t look up a question, copy-paste the answer, and mark it as solved. Instead, understand the concept behind it. So, if a similar but distinct question turns up in the interview, you can solve it without hassle.

  • Give as many mock interviews as you can. If you cannot solve a question in a mock interview, don’t expect to miraculously solve one under real interview pressure.

  • I won’t aim for a particular company the next time I interview for a job. It’s okay to fail an interview. Or even bombing it, for that matter. Having an abundance mindset helped me later in the next set of interviews.

  • Not being good in LeetCode is not the end of the world. I’ve got far better job opportunities with development skills than I would spend my time on LeetCode. This can be subjective person-to-person, but working remotely has opened many possibilities to earn in foreign currencies. A good deal of foreign startups test you purely on your development skills. For example, the interview process tests on iOS-related questions for the role of iOS engineer.

Thanks for reading this post!

Book

Exploring Freelancing

Navigate freelancing as a developer; find clients, manage contracts, ensure timely payment, and learn from experiences!