Factorial of a non-negative integer, is the multiplication of all integers smaller than or equal to n. For example factorial of 6 is 6*5*4*3*2*1 which… Read More

All Medium Articles

Recently i was interviewed for the position of Software Engineer(Fresher) in Bangalore. Round 1: In the first round there was some aptitude questions and one… Read More

Given a Binary Tree and a number k, remove all nodes that lie only on root to leaf path(s) of length smaller than k. If… Read More

Online Round 1 hour coding contest, different set of coding problems were given. They were manually evaluated. I was able to score 2nd highest score… Read More

Round 1-Coding test:-(3 questions) based on parsing of a file and extracting some values from it. Round 2-(1 hour) Q1>Calculate no. of thursdays between two… Read More

We have already discussed 2 different ways to clone a linked list. In this post, one more simple method to clone a linked list is… Read More

The output of following C program is #include <stdio.h> char str1[100]; char *fun(char str[]) { static int i = 0; if (*str) { fun(str+1);… Read More

Given a dictionary, a method to do lookup in dictionary and a M x N board where every cell has one character. Find all possible… Read More

Given a matrix where every element is either ‘O’ or ‘X’, replace ‘O’ with ‘X’ if surrounded by ‘X’. A ‘O’ (or a set of… Read More

Hi all. I would like to share my experience about my recruitment process with ORACLE. Oracle procedure consists of. 1) Online aptitude Round 2) Coding… Read More

Recently I attended amazon bangalore interview for SDE 2 position. All f2f and no phone/written screening as i had attended one before and cleared those.… Read More

Round one: Note: They have two patterns, for me they asked programming pattern, which is really tough. Time: 2.15 hrs 40 Questions full of programming,… Read More

Off campus- Delhi drive (SDE-1 Bangalore) 1st round: f2f Tell me about yourself. Most challenging task. Extract Leaves of a Binary Tree in a Doubly… Read More

What is 8 puzzle? Given a 3×3 board with 8 tiles (every tile has one number from 1 to 8) and one empty space. The objective… Read More

Given a string you need to print all possible strings that can be made by placing spaces (zero or one) in between them. Input: str[]… Read More

Given a Binary Tree and a key ‘k’, find distance of the closest leaf from ‘k’. Examples: A / \ B C / \ E… Read More

Given a set of n nuts of different sizes and n bolts of different sizes. There is a one-one mapping between nuts and bolts. Match… Read More

Given a string ‘str’ of digits, find the length of the longest substring of ‘str’, such that the length of the substring is 2k digits… Read More

Consider lines of slope -1 passing between nodes (dotted lines in below diagram). The diagonal sum in a binary tree is the sum of all… Read More

We have discussed implementation of Reverse DNS Look Up Cache. Forward DNS look up is getting IP address for a given domain name typed in… Read More