A function is a set of statements that take inputs, do some specific computation and produces output. The idea is to put some commonly or… Read More

All Basic Articles

Given a string, remove all spaces from the string and return it. Input: "g eeks for ge eeks " Output: "geeksforgeeks" Expected time complexity is… Read More

There are 3 ants sitting on three corners of a triangle. All ants randomly pick a direction and start moving along edge of the triangle.… Read More

Given an unsorted of distinct integers, find the largest pair sum in it. For example, the largest pair sum in {12, 34, 10, 6, 40}… Read More

1. Machine Coding: Two players, two field; and have multiple ships located in their fields. They are guessing each others ship position and hitting. Tell… Read More

We have introduced arrays in set 1 (Introduction to arrays in C). In this post array properties in C are discussed. 1) In C, it… Read More

Hope you liked my previous post “Top 25 Interview Questions”. Here comes the next 10. 1) Design discussion on elevator. Hint: Ask questions related to… Read More

An array in C/C++ or be it in any programming language is a collection of similar data items stored at contiguous memory locations and… Read More

In C, it is possible to have array of all types except following. 1) void. 2) functions. For example, below program throws compiler error int… Read More

We have discussed Introduction to Binary Tree in set 1 and Properties of Binary Tree in Set 2. In this post, common types of… Read More

We have discussed Introduction to Binary Tree in set 1. In this post, the properties of a binary tree are discussed. 1) The maximum number… Read More

The interview was scheduled after I passed the coding challenge. The coding challenge was kinda simple, it was a grid, with each cell connected to… Read More

Given an array of integers, update every element with multiplication of previous and next elements with following exceptions. a) First element is replaced by multiplication of… Read More

I had a total of 5 rounds.Initially I thought there will be only 3 rounds. Round 1: 1. Rotate a matrix by 90 degrees clockwise.(… Read More

Telephonic Round – 1: 1) Inversion count in an array – https://www.geeksforgeeks.org/counting-inversions/ 2) Iterative pre order traversal. Telephonic Round – 2: 1) Given an array… Read More

Given a Binary Tree and a key to be searched in it, write an iterative method that returns true if key is present in Binary… Read More

An interval is represented as a combination of start time and end time. Given a set of intervals, check if any two intervals intersect. Examples: … Read More

Given a Binary Tree, find the maximum(or minimum) element in it. For example, maximum in the following Binary Tree is 9. Recommended: Please solve… Read More

Given an array of integers print the missing elements that lie in range 0-99. If there are more than one missing, collate them, otherwise just… Read More

Round 1 Q1. Multiply two 2d matrices Q2 You are given a stack in which element are filled at runtime. And normal push and pop… Read More