Here is the collection of TOP 25 frequently asked questions based on experience (mine and friends) of interviews in multiple companies. 1) Lowest common… Read More

All Medium Articles

Given a doubly linked list, write a function to sort the doubly linked list in increasing order using merge sort.For example, the following doubly linked… Read More

Prerequisite: Random Variable This post is about mathematical concepts like expectation, linearity of expectation. It covers one of the required topics to understand Randomized Algorithms.… Read More

Given an input number of sections and each section has 2 plots on either sides of the road. Find all possible ways to construct buildings… Read More

Given singly linked list with every node having an additional “arbitrary” pointer that currently points to NULL. Need to make the “arbitrary” pointer point to… Read More

Round One: 1. Find Min and Max of an array in only one traversal. 2. Given a chessboard find maximum number of squares present. 3.… Read More

Given a graph with both directed and undirected edges. It is given that the directed edges don’t form cycle. How to assign directions to undirected… Read More

Given a list of word lists How to print all sentences possible taking one word from a list at a time via recursion? Example: Input: {{"you",… Read More

I applied off-campus for internship. I got a call that my resume is shortlisted. Selection procedure consist of 4 rounds. Round 1: Online Coding Round… Read More

Design a data structure that supports the following operations in Θ(1) time.insert(x): Inserts an item x to the data structure if not already present.remove(x): Removes… Read More

Hi, Recently i was interviewed for Amazon SDE-1 Position in Hyderabad.There a telephonic round followed by 4 F2F rounds. Telephonic Round: 1. Inserting an element… Read More

Unlike C++ and Java, C doesn’t support generics. How to create a linked list in C that can be used for any data type? In… Read More

There are 1000 wine bottles. One of the bottles contains poisoned wine. A rat dies after one hour of drinking the poisoned wine. How many… Read More

I interviewed with Amazon, Hyderabad. Interview was in October, 2014. I was 4 months experienced, and was applying for SDE-1 position. I had 4 interviews,… Read More

Following is a typical recursive implementation of Merge Sort C++ // Recursive C++ program for merge sort #include<bits/stdc++.h> using namespace std; // Function to… Read More

Given a string ‘str’ of digits and an integer ‘n’, build the lowest possible number by removing ‘n’ digits from the string and not changing… Read More

Write a function subtract(x, y) that returns x-y where x and y are integers. The function should not use any of the arithmetic operators (+,… Read More

Given a universe U of n elements, a collection of subsets of U say S = {S1, S2…,Sm} where every subset Si has an associated… Read More

I gave this interview for Senior Software Developer Role. Round 1: Lots of puzzles and algo’s. The interviewer didn’t let me write code for anything,… Read More

Attended coding interview for myntra. Question was based on the movement of Robot. G-GO one unit L-Turn left R-Turn right Given an input of string… Read More