Skip to content
All Medium Articles
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
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
Consider the following function: int unknown(int n) {     int i, j, k = 0;     for (i  = n/2; i <= n; i++)         for (j =… Read More
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
Output of following program? #include <iostream> using namespace std;    template <class T> class Test { private:     T val; public:     static int count;     Test()  {  … Read More
#include<iostream> using namespace std;    class Base { public:     int fun()  { cout << "Base::fun() called"; }     int fun(int i)  { cout << "Base::fun(int i)… Read More
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
Can a constructor be virtual? Will the following program compile? #include <iostream> using namespace std; class Base { public:   virtual Base() {}    }; int main()… Read More
#include<iostream> using namespace std;    class Base { public:     virtual void show() = 0; };    class Derived: public Base { public:     void show() {… Read More
Predict the output of following program. #include<iostream> using namespace std; class Base { public:     virtual void show() = 0; };    class Derived : public… Read More
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
Output of following program #include<iostream> using namespace std;    class Base { public:     virtual void show() { cout<<" In Base \n"; } };    class… Read More
Predict output of the following program #include<iostream> using namespace std;    class Base { public:     virtual void show() { cout<<" In Base \n"; } };… Read More
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
#include<iostream> using namespace std;    class Base { public:     void show()     {         cout<<" In Base ";     } };    class Derived: public Base { public:… Read More
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
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
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
itoa function converts integer into null-terminated string. It can convert negative numbers too. The standard definition of itoa function is give below:- char* itoa(int num,… Read More
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