My LeetCode Method

I am currently going through the job hunting process. This includes applying to new grad positions, emailing recruiters, attending career fairs, and *of course* doing LeetCode problems. If you haven’t applied to jobs yet, you’ll soon find out that you’ll receive an online assessment (OA) as the first step in the interview process. I’ve received and done about 12 different OAs on various sites such as Codility, CodeSignal, and Hackkerrank. Each company can customize their OAs, so you’ll experience a broad range of difficulties and questions. Later in the interview process, you’ll be asked similar questions in the technical interview. From my experience, I’ve noticed that startups tend to require you to complete an at-home assignment while most mid-sized to large-sized companies tend to ask LeetCode-style questions in their interviews, so it’s best to practice them.

Here’s what to expect

There are several scenarios where you’ll be asked to complete a technical problem.

  • Over the phone, where you’re expected to write code on a shared document
  • Online assessment
  • Technical Interview (whiteboard)

The general approach

The approach I take when tackling a technical question is UMPIRE.

U: Understand the problem

  • Validate your assumptions by thinking of different inputs and outputs.
  • Ask the interviewer questions about the problem

M: Match the problem with the interviewer

  • Try to think about known categories of problems (Linked List, Dynamic Programming) or patterns that match the problem.

P: Plan your approach and solution

  • Use visualizations and pseudocode to plan your approach.

I: Implement your solution

R: Review your solution

  • Go through your code as if you’re debugging it and there’s a bug. Step through the code line by line.
  • Evaluate some of the common edge cases.

E: Evaluate your solution

  • Discuss the pros and cons of your algorithm, what you like about your algorithm, and what you could do differently.
  • This is where you also discuss the Big-O time complexity of your algorithm.

One more comment: when solving a technical problem, a good strategy is to come up with the native solution first and then optimize your code later on.

Remember, the interviewer wants to see your approach and thought process, so don’t forget to talk out loud, use visualizations, and break down the problem into smaller steps. It’s ok if you don’t finish the problem completely in the end.

Study tips and resources!

It really comes down to practicing like how you would in an interview.

  • Try to use the approach above when solving a problem.
  • Time yourself.
  • Find a study partner, so you can practice problems with each other and do mock interviews.
  • Study by topic

Here are some of my favorite resources:

Online study platforms:

  • Leetcode
  • Codesignal
  • Codility

What’s cool about CodeSignal is that they have an “Interview Practice” section that has problems for each topic.

What’s cool about Codility is that for each lesson there’s reading material to go along with it. Codility will also evaluate the time complexity and performance of your program giving you a score after submitting.

Books

Youtube

To conclude

Mastering algorithms and data structures can be overwhelming and tough. It comes down to consistency and practice. Do a couple of problems every day while implementing the approach and strategies I outlined above and you’ll definitely see improvement over time. Good luck & thanks for reading!

Print Friendly, PDF & Email

Posted

in

by

Tags:

Comments

2 responses to “My LeetCode Method”

  1. Jennifer Lam Avatar
    Jennifer Lam

    I’m glad the professor shared your blog! I found it really useful and have bookmarked the materials you recommended. Thanks for sharing and good luck!!

    1. Rina Easterday Avatar
      Rina Easterday

      Thanks Jennifer!

Leave a Reply

Your email address will not be published. Required fields are marked *