Tag: Interview Question

Reverse a Linked List – Interview Question

Given a singly linked list, reverse it. Let’s find out how to answer this question in a technical interview. Suppose Here is the list:     And here is how the output should look like: A linked list node has 2 components: the value and the reference to the next node. public class Node {…
Read more


September 9, 2020 0

URL Shortener System Design – Interview Question

Design a URL Shortener System. Let’s find out how to answer this question in a technical interview. Since it’s a system design question, it’s very open ended. As a candidate, you need to ask lots of questions and have a good discussion about various approaches that you can take. You can even discuss similar pre-existing…
Read more


April 4, 2020 0

Are Parentheses Balanced – Interview Question

Given a string expression, find out if the parentheses are balanced or not. Let’s find out how to answer this question in a technical interview. To begin with, let’s understand the question first. In an expression, you can have different types of brackets or parentheses. You need to check whether they are in correct pair…
Read more


January 22, 2020 0

Get the nth Fibonacci Number

Given the index n, find nth Fibonacci number. To begin with, let’s first take a quick look at what Fibonacci series is. The Fibonacci numbers are the numbers in the following integer sequence. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144 The first two numbers are 0 and 1. And…
Read more


August 24, 2019 0

Add Numbers without using Plus operator – Interview Question

You have to write an algorithm that adds two numbers but you are not allowed to use the plus operator. The first thought that comes to my mind is using binary numbers. We need to think how we can do addition using binary numbers and what all are the steps you follow when you actually…
Read more


May 23, 2019 0

Detect Loop In Linked List – Interview Question

To begin with you can draw a linked list on the whiteboard. A linked list has nodes in it which are connected to each other. Each node has two components: the value and reference to next node. The head node points to the first element of the linked list. The first thing that comes to…
Read more


January 18, 2019 0

Degree of Array – Interview Question

Find the degree of an array where degree of an array is the maximum frequency of any element in the array. Also find the smallest possible sub-array with the same degree. To begin with, make sure you understood the question correctly. Write a sample array on the whiteboard and ask them if the degree you…
Read more


November 9, 2018 0

Are Characters Unique in a String – Interview Question

Does a string have all unique characters? Let’s find out how to answer this question in a technical interview The first solution that comes to mind is to have two for loops. In the outer for loop, you pick one character from the string, let’s call it c1. You then compare c1 to rest of…
Read more


October 28, 2018 0

Find Middle Element in a Linked List – Interview Question

Find out middle element in a linked list. Let’s see how to answer this question in a technical interview. To begin with you can draw a linked list on the whiteboard. A linked list has nodes in it which are connected to each other. Each node has two components: the value and reference to next…
Read more


October 12, 2018 0

How HashTables Work

How do Hash Tables Work? To Begin with, what is a HashTable? Simply, it is a data structure that can map keys to values. Why is it important? You can look up the data in constant time i.e. O(1). How does it work? Internally, it’s an array of buckets or slots. There is something called Hash…
Read more


September 13, 2018 0