Given two sorted arrays, such that the arrays may have some common elements. Find the sum of the maximum sum path to reach from the… Read More

All Medium Articles

Given a number n, find the smallest number that has same set of digits as n and is greater than n. If n is the… Read More

I’m a 3rd year grad and amazon visited our campus. My interview had only 3 rounds. Round 1 (Online round 20 MCQ’s and 2 coding… Read More

What is an algorithm? Informally, an algorithm is any well-defined computational procedure that takes some value, or set of values, as input and produces some… Read More

Can a destructor be pure virtual in C++? Yes, it is possible to have pure virtual destructor. Pure virtual destructors are legal in standard C++… Read More

In C++, stream insertion operator “<<” is used for output and extraction operator “>>” is used for input. We must know the following things before we… Read More

Let 1 represent ‘A’, 2 represents ‘B’, etc. Given a digit sequence, count the number of possible decodings of the given digit sequence. Examples: Input:… Read More

Hi, Below is my interview experience for Amazon for SDE-I position. Round-1(F2F) 1.) Traverse a binary tree in a spiral manner. (zig-zag manner) 2.) Given… Read More

Engineers from core branches like Electronics, Mechanical, Chemical today are often found chasing lucrative employment in fields like IT and analytics, areas unrelated to what… Read More

Given a binary tree in which each node element contains a number. Find the maximum possible sum from one leaf node to another. The maximum sum… Read More

In general, array is considered a data structure for which size is fixed at the compile time and array memory is allocated either from Data… Read More

Consider the following log sequence of two transactions on a bank account, with initial balance 12000, that transfer 2000 to a mortgage payment and then… Read More

Inorder traversal of a Binary tree can either be done using recursion or with the use of a auxiliary stack. The idea of threaded binary… Read More

Constructor is a special member function that is automatically called by compiler when object is created and destructor is also special member function that is… Read More

Given a Perfect Binary Tree, reverse the alternate level nodes of the binary tree. Given tree: a / \ b c / \ / \… Read More

Online round: 1) Program to check if two rectangles overlap. 2) Program to find if a given string, say S, contains another given string, say… Read More

In shellSort, we make the array h-sorted for a large value of h. We keep reducing the value of h until it becomes 1. An… Read More

I had three technical round of interviews. Two were telephonic followed by one skype interview with the team leader. 1st Round ->Whether a number is… Read More

Given a sorted array arr[] and a value X, find the k closest elements to X in arr[]. Examples: Input: K = 4, X =… Read More