(A) May cause runtime error (B) May cause compiler error (C) Always works fine. (D) 0 Answer: (A) Explanation: Since we return reference to a… Read More »
Predict the output of following C++ program. (A) Compiler Error: Function cannot be used as lvalue (B) 10 (C) 30 Answer: (C) Explanation: When a… Read More »
Let us first define Overloading and Overriding.
Given two arrays which represent a sequence of keys. Imagine we make a Binary Search Tree (BST) from each array. We need to tell whether… Read More »
Given three strings A, B and C. Write a function that checks whether C is an interleaving of A and B.
Given a function ‘int f(unsigned int x)’ which takes a non-negative integer ‘x’ as input and returns an integer as output.
You are given a set of links, e.g. a —> b b —> c b —> d a —> e Print the tree that would… Read More »
Given an input string and a dictionary of words, find out if the input string can be segmented into a space-separated sequence of dictionary words.… Read More »
I recently attended a walk-in for Software development Engineer (SDE- 1) at Amazon, Bangalore.
Can a class be static in Java ? The answer is YES, we can have static class in java. In java, we have static instance… Read More »
In C, fopen() is used to open a file in different modes. To open a file in write mode, “w” is specified.
This article is not for those algo geeks. If you are interested in systems related stuff, just read on…
Eulerian Path is a path in graph that visits every edge exactly once. Eulerian Circuit is an Eulerian Path which starts and ends on the… Read More »
Given a linked list and two integers M and N. Traverse the linked list such that you retain M nodes then delete next N nodes,… Read More »
How to implement a stack which will support following operations in O(1) time complexity? 1) push() which adds an element to the top of stack.… Read More »