All Easy Articles

Lexicographically minimum string rotation | Set 1 2.8

Write code to find lexicographic minimum in a circular array, e.g. for the array BCABDADAB, the lexicographic minimum is ABBCABDAD. Source: Google Written Test More… Read More »

Microsoft Interview | Set 30 (On-Campus) 2.5

Online Round: 15 MCQ’s and 2 coding questions organized by CoCubes. Coding questions – Given a list of strings separated by space, return the position… Read More »

Construct an array from its pair-sum array 2.7

Given a pair-sum array and size of the original array (n), construct the original array. A pair-sum array for an array is the array that… Read More »

Microsoft Interview | Set 28 (On-Campus) 2

Microsoft Interview Experience(On Campus) 1st Round : Online test was taken in the morning by cocube with 15 MCQ. Time was given for this 30min.… Read More »

Amazon Interview | Set 106 (On Campus for Internship) 2.4

Amazon came to our campus recently for placements and internships. I attended for internship and i am sharing my experience here. First Round: Online: 20… Read More »

Print level order traversal line by line | Set 1 2.4

Given a binary tree, print level order traversal in a way that nodes of all levels are printed in separate lines. For example consider the… Read More »

Citrix Interview | Set 2 2

Written Round: The written round (conducted on Hackerearth) consisted of two sections: First section consisted of 50 MCQs to be attempted in 1 hours. The… Read More »

Check if characters of a given string can be rearranged to form a palindrome 2.2

Given a string, Check if characters of the given string can be rearranged to form a palindrome. For example characters of “geeksogeeks” can be rearranged… Read More »

Count ways to reach the n’th stair 2.6

There are n stairs, a person standing at the bottom wants to reach the top. The person can climb either 1 stair or 2 stairs… Read More »

A Problem in Many Binary Search Implementations 2.2

Consider the following C implementation of Binary Search function, is there anything wrong in this? filter_none edit close play_arrow link brightness_4 code // A iterative… Read More »

Print all pairs of anagrams in a given array of strings 2.7

Given an array of strings, find all anagram pairs in the given array. Example: Input: arr[] = {“geeksquiz”, “geeksforgeeks”, “abcd”, “forgeeksgeeks”, “zuiqkeegs”}; Output: (geeksforgeeks, forgeeksgeeks),… Read More »

Given a number as a string, find the number of contiguous subsequences which recursively add up to 9 2.1

Given a number as a string, write a function to find the number of substrings (or contiguous subsequences) of the given string which recursively add… Read More »

DBMS | SQL | Question 2 2

Which of the following command is used to delete a table in SQL? (A) delete (B) truncate (C) remove (D) drop Answer: (D) Explanation: drop… Read More »

Diffference between #define and const in C? 2.2

#define is a preprocessor directive. Things defined by #define are replaced by the preprocessor before compilation begins. const variables are actual variables like other normal… Read More »

Search in an almost sorted array 2.6

Given an array which is sorted, but after sorting some elements are moved to either of the adjacent positions, i.e., arr[i] may be present at… Read More »

Check if two nodes are cousins in a Binary Tree 2.6

Given the binary Tree and the two nodes say ‘a’ and ‘b’, determine whether the two nodes are cousins of each other or not. Two… Read More »

Decode a given pattern in two ways (Flipkart Interview Question) 2

A sender sends a binary string to a receiver meanwhile he encrypt the digits. You are given a encrypted form of string. Now, the receiver… Read More »

Amazon Interview | Set 99 (On-Campus) 2

Amazon interview experience :- 1st Round :- 20 mcq and 2 coding questions 1. Left view of binary tree 2. addition of 3 link list… Read More »

Binary Insertion Sort 2.3

We can use binary search to reduce the number of comparisons in normal insertion sort. Binary Insertion Sort uses binary search to find the proper… Read More »

Can we reverse a linked list in less than O(n)? 2.4

It doesn’t look possible to reverse a simple singly linked list. A simple singly linked list can only be reversed in O(n) time using recursive… Read More »