All Hard Articles

## Drishti-Soft Solutions Interview | Set 1 4

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 »

## Given n line segments, find if any two segments intersect 4.1

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 »

## Johnson’s algorithm for All-pairs shortest paths 4.1

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 | Set 1 (Naive and Dynamic Programming) 4.3

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 »

## Amazon Interview | Set 53 (For SDE-1) 4.5

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 »

## Qualcomm Interview | Set 2 4.5

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 »

## Find number of pairs (x, y) in an array such that x^y > y^x 4.1

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 »

## GATE | GATE CS 2013 | Question 65 4

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 »

## GATE | GATE CS 2013 | Question 24 4.7

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 »

## GATE | GATE CS 2013 | Question 65 4

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 »

## GATE | GATE CS 2013 | Question 65 4

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 »

## GATE | GATE CS 2013 | Question 4 4

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 »

## C++ | Virtual Functions | Question 13 4

filter_none edit close play_arrow link brightness_4 code #include <iostream> using namespace std;     class A { public:     virtual void fun() { cout << “A::fun() “;… Read More »

## C++ | Virtual Functions | Question 11 4

Can static functions be virtual? Will the following program compile? filter_none edit close play_arrow link brightness_4 code #include<iostream>  using namespace std;       class Test {… Read More »

## C++ | Virtual Functions | Question 5 4

filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std;    class Base { public:     virtual void show() = 0; };    int main(void)… Read More »

## Recursively remove all adjacent duplicates 4.2

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:… Read More »

## Why copy constructor argument should be const in C++? 4

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 »

## C++ | Operator Overloading | Question 5 4

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 »

## Adobe Interview | Set 7 (On-campus for MTS-1) 4

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 »

## Algorithms | Graph Shortest Paths | Question 9 4.3

Following statement is true or false? If we make following changes to Dijkstra, then it can be used to find the longest simple path, assume… Read More »