Other C++ Code Interview Questions 

Question 
Asked @ 
Answers 

write a program that can locate elements in array. 

1 
Write a function oriented to convert the input dollar(s)
into its equivalent peso. Assume that one dollar is
equivalent to 51.60 

1 
Counting in Lojban, an artificial language developed over
the last fourty years, is easier than in most languages
The numbers from zero to nine are:
0 no
1 pa
2 re
3 ci
4 vo
5 mk
6 xa
7 ze
8 bi
9 so
Larger numbers are created by gluing the digit togather.
For Examle 123 is pareci
Write a program that reads in a lojban string(representing
a no less than or equal to 1,000,000) and output it in
numbers.


4 
PROBLEM #8 The cashier at the counter of a Super Store, Mr.
Khazaanchi has the following
bundles of rupee cash notes with him:
Rs. 1, 2, 5, 10, 50, 100, 500, 1000
A customer comes at his counter with various items that he
has shopped. Mr. Khazaanchi totals
the item prices and tells the customer his total amount
payable. The customer gives Mr. Khazanchi
some amount of cash. Find the total number of rupee notes of
each denomination (i.e. 1, 2, 5, 10,
50, 100, 500, 1000) Mr. Khazaanchi will have to give to the
withdrawer ensuring that the total
number of rupee notes are minimum. 

1 
MinMax
Write an algorithm that finds both the smallest and largest
numbers in a list of n numbers and calculate its complexity
T(n).

QatarUniversity 
1 
what is virtual constroctor ? give an exam for it?(parimal
dhimmar) 

2 
1.program to add any two objects using operator overloading
2.program to add any two objects using constructors
3.program to add any two objects using binary operator
4.program to add any two objects using unary operator 
IBM 
2 
how to find out the maximum number out of the three inputs. 
HP 
6 
Deriving time complexity of Binary tree and AVL tree, step
by step. 
NetApp 
4 
Given 1 to n random number, find top 10 maximum numbers and
explain the time complexity of the algorithm. 
NetApp 
1 
A research student is given a singlylinked list. Each node
of the list has a color, which is either “Black”
or “White”. He must find if there are more black nodes than
white nodes, or vice versa. His advisor
gives him 5,000Rs to buy a computer to do the work. He goes
to the computer store and finds a
slightly defective computer which costs a mere 3,000Rs. This
computer has the small problem of not
being able to do arithmetic. This means that he cannot use a
counter to count the nodes in the list to
determine the majority color. The computer is otherwise
fully functional. He has the evil idea that he
could buy the defective computer and somehow use it to do
his work, so that he can use the rest of
the money on enjoyment. Show how he can accomplish this
amazing task. Write code for an algorithm
called ‘findMajorityColor’ which takes a singlylinked list,
L, with n nodes and returns the majority color
among nodes of L. This algorithm should have the same
asymptotic running time as counting the
nodes (O(n)). Note: No arithmetic is allowed. 

1 
How reader and writer problem was implemented and come up
with effective solution for reader and writer problem in
case we have n readers and 1 writer.

NetApp 
5 

For more C++ Code Interview Questions Click Here 