If digits of my age are reversed you will get my son's age…
If the digits of my present age are reversed then I get current age of my son. If one year ago my age was twice the age of my son. Find my present age.
How much byte-addressable memory you can use with 12 bits address bus
If you have a byte-addressable memory (i.e every byte in the memory has an address) and an address bus of size 12 (i.e 12 wires in the address bus or 12 bits in the Memory Address Register). How much maximum RAM can you support ?
Effect on area of rt angled triangle if base is increased and hight reduced
If the base of a Right angled triangle is increased 4 times and height is reduced to half, what will be the effect on its area ?
Check if a Binary tree is sub-tree of another
Given pointers to the root of two Binary Trees, write code to check if first Binary tree is subtree of second binary tree. The signature (prototype) of the function should be /** returns 1 (true) if Binary Tree a is subtree of Binary tree b , * else returns 0(false) */ int checkSubTree(struct Node* a, […]
Invert traingle made from 6 circles
Given 6 circles which are arranged in the form of a triangle as shown below ° ° ° ° ° ° You are supposed to invert the triangle and want to move minimum circles. At least how many circles do you need to move to invert the above triangle as below ° ° ° ° […]
dynamic_cast in C++
What is dynamic_cast in C++. Where is it used?
infix, prefix & postfix notations (Polish Notations)
What are Infix, Prefix and Postfix notations ?
Computing average of stream of numbers
Given a stream of numbers (keep reading numbers from the keyboard). Write code to print the average at each point. For example: user is entering the numbers, at each point you should print the average of all the numbers entered till now, as shown below numbers Average ———— ————- 10 10 10, […]
Delete alternate node of the linked list
Given a linked list. Write code to delete alternate nodes from the list. For example: If the list given is 2 -> 3 -> 5 -> 1 -> 4 -> 8 The result should be 2 -> 5 -> 4
Recursive function to compute sum of digis in a number
Write a function which should accept an integer and should return the sum of digits in that integer. This function should compute the sum of digits recursively. For example: Input Output ——– ———– 56 11 (5+6) 1234 10 (1+2+3+4)