Skip to content
All Hard Articles
The worst case running time to search for an element in a balanced in a binary search tree with n2^n elements is (A) (B) (C)… Read More
We are given an array of n points in the plane, and the problem is to find out the closest pair of points in the… Read More
Location: Guagaon Position: Software Developer I decided to write this post because when i was preparing, I didn’t find any help on google about the… Read More
We have discussed the problem to detect if two given line segments intersect or not. In this post, we extend the problem. Here we are… Read More
The problem is to find shortest paths between every pair of vertices in a given weighted directed Graph and weights may be negative. We have… Read More
Travelling Salesman Problem (TSP): Given a set of cities and distance between every pair of cities, the problem is to find the shortest possible route… Read More
In each round they ask me why I want to join amazon, why I am leaving my previous company with such a short span(around 2.5… 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 number of pairs such that x^y > y^x where x is an element from X[]… 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
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
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 following examples.Examples:  Input: azxxzy Output:… Read More
When we create our own copy constructor, we pass an object by reference and we generally pass it as a const reference. One reason for… Read More
How does C++ compiler differs between overloaded postfix and prefix operators? (A) C++ doesn’t allow both operators to be overlaoded in a class (B) A… Read More