All Medium Articles

## GATE | GATE CS 2013 | Question 44 3

Consider the following operation along with Enqueue and Dequeue operations on queues, where k is a global parameter. MultiDequeue(Q){ m = k while (Q is… Read More »

## GATE | GATE CS 2013 | Question 65 3

Determine the maximum length of the cable (in km) for transmitting data at a rate of 500 Mbps in an Ethernet LAN with frames of… Read More »

## How to count set bits in a floating point number in C? 3.9

Given a floating point number, write a function to count set bits in its binary representation. For example, floating point representation of 0.15625 has 6… Read More »

## C++ | Templates | Question 4 3

Output of following program? filter_none edit close play_arrow link brightness_4 code #include <iostream> using namespace std;    template <class T> class Test { private:     T… Read More »

## C++ | Inheritance | Question 8 3.5

filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std;    class Base { public:     int fun()  { cout << “Base::fun() called”; }     int… Read More »

## Python Program for How to check if a given number is Fibonacci number? 3

Given a number \’n\’, how to check if n is a Fibonacci number. First few Fibonacci numbers are 0, 1, 1, 2, 3, 5, 8,… Read More »

## C++ | Virtual Functions | Question 12 3.1

Predict the output of following C++ program. Assume that there is no alignment and a typical implementation of virtual functions is done by the compiler.… Read More »

## C++ | Virtual Functions | Question 14 3

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

## C++ | Virtual Functions | Question 7 3

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

## C++ | Virtual Functions | Question 6 3.5

Predict the output of following program. filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std; class Base { public:     virtual void show() =… Read More »

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

Which of the following is true about pure virtual functions? 1) Their implementation is not provided in a class where they are declared. 2) If… Read More »

## C++ | Virtual Functions | Question 3 3

Output of following program filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std;    class Base { public:     virtual void show() { cout<<“… Read More »

## C++ | Virtual Functions | Question 2 3

Predict output of the following program filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std;    class Base { public:     virtual void show()… Read More »

## Find the first non-repeating character from a stream of characters 3.5

Given a stream of characters, find the first non-repeating character from stream. You need to tell the first non-repeating character in O(1) time at any… Read More »

## C++ | Inheritance | Question 7 3

filter_none edit close play_arrow link brightness_4 code #include<iostream> using namespace std;    class Base { public:     void show()     {         cout<<” In Base “;     } };… Read More »

## Amazon Interview | Set 51 (On-campus for SDET) 3

Hello Everyone!! Recently, I have been through the interview experience of Amazon India and I would like to share my experience with everyone. Position :… Read More »

## Directi Interview | Set 3 3.8

Online round: 1. There exist a binary tree with each node containing a character (lower case letters for leaf nodes and upper case letters for… Read More »

## Find maximum number of edge disjoint paths between two vertices 3.4

Given a directed graph and two vertices in it, source ‘s’ and destination ‘t’, find out the maximum number of edge disjoint paths from s… Read More »

## Implement your own itoa() 3.9

itoa function converts integer into null-terminated string. It can convert negative numbers too. The standard definition of itoa function is give below:- filter_none edit close… Read More »

## Remove all nodes which don’t lie in any path with sum>= k 3.4

Given a binary tree, a complete path is defined as a path from root to a leaf. The sum of all nodes on that path… Read More »