# Category Archives: Algorithms

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
In Manacher’s Algorithm Part 1 and Part 2, we gone through some of the basics, understood LPS length array and how to calculate it efficiently… Read More
In Manacher’s Algorithm – Part 1, we gone through some of the basics and LPS length array. Here we will see how to calculate LPS… Read More
Given a string, find the longest substring which is palindrome.  if the given string is “forgeeksskeegfor”, the output should be “geeksskeeg” if the given string… Read More
In MS-Paint, when we take the brush to a pixel and click, the color of the region of that pixel is replaced with a new… Read More
The following is a simple recursive Binary Search function in C++ taken from here.  C++ // CPP program for the above approach #include <bits/stdc++.h> using… Read More
LinkedIn Interview Experience (On Campus – Day 1) Online Round : 3 coding Questions in 1 hour : 1. We have to implement int getIntComplement(int… Read More
How many people must be there in a room to make the probability 100% that at-least two people in the room have same birthday? Answer: 367… Read More
There was 1 coding round and 4 F2F interviews. This was for Software Developer Position(Note:-It was not for the research division in Walmart Labs)  Coding… Read More
We recommend reading the following posts as a prerequisite for this post.K’th Smallest/Largest Element in Unsorted Array K’th Smallest/Largest Element in Unsorted Array | Expected Linear… Read More
Given an integer as input and replace all the ‘0’ with ‘5’ in the integer.  Examples:  Input: 102 Output: 152 Explanation: All the digits which… Read More
Round 1 : Written : Q1. Given a stream of around billion numbers in an array, which has approximately only 1000 unique numbers. Print the… Read More
We recommend reading the following post as a prerequisite of this post. K’th Smallest/Largest Element in Unsorted Array | Set 1 Given an array and… Read More
Given an array and a number k where k is smaller than the size of the array, we need to find the k’th largest element… Read More
Given an array and a number K where K is smaller than the size of the array. Find the K’th smallest element in the given… Read More