navigation-1048294_640

Uber Interview Questions – Map Implementation

In this week’s coding interview question post, I’m going to analyze one of the best questions I’ve seen in recent interviews. As many people ask for the pseudo code in order to help them understand the algorithm, I will also include that in the post as well.

It’s worth to emphasize again that what’s truly important is not the final code/solution, it’s all about the analysis process and I’m going to teach you exactly how to come up with the right idea.

(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

IMG_3832

How I Improved My Coding Speed In One Week

A lot of people are asking whether coding speed matters in coding interviews. The short answer is – yes, it’s extremely important.

Over the past, Gainlo interviewers have seen so many candidates who came up with the right solution quickly but failed to complete the code in the end. This phenomenon has become more and more common and that’s why we decided to talk about it this week.

(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

IK40ZZ01KY

3Sum

3Sum is one of the most popular questions in coding interviews. What’s more, it has several variations that seem to be more complicated, but in essence are same as the basic form.

We haven’t covered many topics about numbers in the past. Since 3sum questions have been asked by Google and Facebook recently, it’s a great time for us to analyze this topic in detail now.
(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

OLYMPUS DIGITAL CAMERA

Meeting Room Scheduling Problem

In our previous posts, we’ve covered topics like string, tree, linked list and so forth. In this week’s coding interview question, we’re going to discuss something different.

If you have taken many coding interviews, you will know that a lot of questions are quite close to real life projects and don’t have a focus on specific data structures. Some people find it hard at first glance. However, with some analysis, you’ll realize that there are no different from other questions.
(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

IU6HNPC2NT

Lowest Common Ancestor

Tree problems are so popular recently that we’ve seen so many candidates have been asked about it by companies like Google, Facebook, Microsoft and so on.

On second thought, this makes a lot of sense. Tree is one of the most useful and fundamental data structures in real products. For instance, tree structure is widely used in machine learning like decision trees. What’s more, tree related interview questions can cover a lot of topics like iteration and recursion.

(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

trekking-299000_640

Flatten a Linked List

Linked list is one of the most common data structures that are usually covered in coding interviews. Like I mentioned in our previous post, since data structures like binary tree, linked list have limited ways of operation, the problem usually can’t be too hard in an interview. The biggest thing is to really spend your time being familiar with them.

In this post, I would focus on topics including linked list manipulation, queue, BFS and summarize some common techniques as before.

(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

tumblr_nnmrdskJiY1qfirfao1_1280

Second Largest Element of a Binary Search Tree

Over the past several weeks, many of our users suggested us cover some questions about BST (Binary search tree) as they’ve been asked about this recently.

BST is a very good data structure to ask in coding interviews. Here are the reasons:

  • BST is a widely used data structure and it’s important to know it.
  • It’s neither too complicated nor too simple to ask in a coding interview.
  • Many concepts like traversing, recursion can be covered with BST related questions.

(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

OLYMPUS DIGITAL CAMERA

Subarray With Given Sum

This week, we’re going to talk about a popular question that seems simple at first glance, but can be quite difficult by removing particular restrictions. This type of question is very common in coding interviews as interviewers like to use the easy version as a warm-up question and if there’s still time remained, the follow-up question will be asked.

Also, in our previous posts, we didn’t cover much about array problems. So it’s definitely worth to analyze this problem in depth. In this article, we will talk about topics including array, sliding window, recursion and DP (dynamic programming).

(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

way-918900_640

Duplicate Elements of An Array

One common misunderstanding is that coding interview is all about solving algorithm questions. In fact, the answer itself is only part of the evaluation and sometimes it is not the most important part at all.

There are many other factors being evaluated during an interview. For instance, your analysis process is at least equally important. More specifically, interviewers care a lot about how you approach a problem step by step, how you optimize your solution, how you compare different approaches and so on so forth.
(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More

SWDR6XR7YS (1)

Group Anagrams

This is another post in the coding interview questions collection. In this series, we’ll cover recent hot questions from top companies like Google, Facebook, Uber, Linkedin etc.. More importantly, the goal of these posts is not giving you something like a standard answer.

Instead, we focus on telling you how to analyze each question and how to re-use the same techniques in similar problems. At the end of each post, we’ll summarize some common strategies used in the question.

In this post, we are going to cover topics including hash map, string manipulation and sorting as well.

(more…)

Share on FacebookTweet about this on TwitterShare on LinkedInShare on Reddit

Read More