Skip to content
All Medium Articles
Given a string, find the longest substring which is a palindrome. For Example:   Input: Given string :"forgeeksskeegfor", Output: "geeksskeeg". Input: Given string :"Geeks", Output: "ee".  Attention… Read More
We have discussed assignment operator overloading for dynamically allocated resources here . This is a an extension of the previous post. In the previous post,… Read More
Given a string, find the longest substring which is palindrome.  For example, Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts… Read More
Following is a typical recursive implementation of Quick Sort that uses last element as pivot.  Attention reader! Don’t stop learning now. Get hold of all the… Read More
Predict the output of following C++ programs. Question 1 #include <iostream> using namespace std;    class A {     public:     A& operator=(const A&a)     {         cout <<… Read More
Given an unsorted array of positive integers, find the number of triangles that can be formed with three different array elements as three sides of… Read More
Given preorder traversal of a binary search tree, construct the BST. For example, if the given traversal is {10, 5, 1, 7, 40, 50}, then… Read More
Given a string, find its rank among all its permutations sorted lexicographically. For example, rank of “abc” is 1, rank of “acb” is 2, and… Read More
Given an array of non-negative integers. Find the largest multiple of 3 that can be formed from array elements. For example, if the input array is… Read More
Given a linked list where every node represents a linked list and contains two pointers of its type: (i) Pointer to next node in the main… Read More
Given a binary matrix, print all unique rows of the given matrix.  Example: Attention reader! Don’t stop learning now. Get hold of all the important DSA… Read More
How to implement LRU caching scheme? What data structures should be used? We are given total possible page numbers that can be referred. We are also… Read More
Recently I attended Microsoft Campus Interview and got selected. Below is my Interview Experience and I just wanna share it to GeeksforGeeks viewers. 1st Round:… Read More
Given N machines. Each machine contains some numbers in sorted form. But the amount of numbers, each machine has is not fixed. Output the numbers… Read More
You are given a set of n types of rectangular 3-D boxes, where the i^th box has height h(i), width w(i) and depth d(i) (all… Read More
You are given a function foo() that represents a biased coin. When foo() is called, it returns 0 with 60% probability, and 1 with 40%… Read More
Multiple Inheritance is a feature of C++ where a class can inherit from more than one classes. The constructors of inherited classes are called in… Read More
We have discussed a similar topic in Java here. Unlike Java, C++ allows to give more restrictive access to derived class methods. For example the… Read More
Predict the output of following C++ programs. Question 1Want to learn from the best curated videos and practice problems, check out the C++ Foundation Course… Read More
Given n numbers (both +ve and -ve), arranged in a circle, find the maximum sum of consecutive numbers.  Examples: Attention reader! Don’t stop learning now. Get… Read More