All Hard Articles
  Travelling Salesman Problem (TSP):  Given a set of cities and the distance between every pair of cities, the problem is to find the shortest… Read More
It was a very good experience to face interview at Qualcomm. I have attended the interview for a position of Embedded SW application developer and… Read More
Given two arrays X[] and Y[] of positive integers, find a number of pairs such that x^y > y^x where x is an element from… Read More
The current erection cost of a structure is Rs. 13,200. If the labour wages per day increase by 1/5 of the current wages and the… Read More
A RAM chip has a capacity of 1024 words of 8 bits each (1K × 8). The number of 2 × 4 decoders with enable… Read More
What is the return value of f(p,p), if the value of p is initialized to 5 before the call? Note that the first parameter is… Read More
The following figure represents access graphs of two modules M1 and M2. The filled circles represent methods and the unfilled circles represent attributes. If method… Read More
A shared variable x, initialized to zero, is operated on by four concurrent processes W, X, Y, Z as follows. Each of the processes W… Read More
Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is 1/2. What is the… Read More
Three concurrent processes X, Y, and Z execute three different code segments that access and update certain shared variables. Process X executes the P operation… Read More
Assume that source S and destination D are connected through two intermediate routers labeled R. Determine how many times each packet has to visit the… Read More
What is the maximum number of reduce moves that can be taken by a bottom-up parser for a grammar with no epsilon- and unit-production (i.e.,… Read More
Which one of the following is the tightest upper bound that represents the time complexity of inserting an object into a binary search tree of… Read More
The smallest integer that can be represented by an 8-bit number in 2’s complement form is (A) -256 (B) -128 (C) -127 (D) 0 Answer:… Read More
#include <iostream> using namespace std;     class A { public:     virtual void fun() { cout << "A::fun() "; } };     class B: public A… Read More
Can static functions be virtual? Will the following program compile? #include<iostream>  using namespace std;       class Test {    public:       virtual static void fun()  { }… Read More
#include<iostream> using namespace std;    class Base { public:     virtual void show() = 0; };    int main(void) {     Base b;     Base *bp;     return 0;… Read More
Given a string, recursively remove adjacent duplicate characters from the string. The output string should not have any adjacent duplicates. See the following examples. Examples: … Read More
#include<iostream> using namespace std;    class Base {};    class Derived: public Base {};    int main() {     Base *bp = new Derived;     Derived *dp… Read More
First of all, I would like to sincerely thank the entire GeeksforGeeks team for creating and maintaining such an awesome site. GeeksforGeeks has tremendously helped… Read More