A retired man has $800000 invested at 8% annual rate. He would like to be able to take a certain amount of money once a year during 24 years until all the money is gone.
Use any language to write a program to calculate the amount of money he will be getting annually.
Answers & follow ups
Use recursion to write a function of factorial.
Answers & follow ups
For bit manipulation C has some operators. Write a function rotate(m,n) that returns the value of integer m rotated to the
right by n positions.
Answers & follow ups
Write a function to reverse the words in the sentence, for example
"This is a string " becomes "string a is This". The memory
is limited. You can't use another string for replacement .
Answers & follow ups
You have a linked list. How can you tell that there is no cycling in it?
Answers & follow ups
How would you write a program to search a file on a hard drive ?
Answers & follow ups
For C++ developers a popular question is "What is virtual destructor and when do you need to use it?"
Answers & follow ups
Reverse linked list.
Answers & follow ups
There is a sequence of random integers, for example 36, 7, -2, 0 ...
Within this sequence you need to find a subsequence with the biggest sum of the numbers?
Answers & follow ups
What do you think can be wrong with this function?
What are the uses of the keyword static in embedded C?
Answers & follow ups
What will be the result of the following code?
void foo(void)
{
unsigned int a=6;
int b=-20;
(a+b >6) ? puts(">6") : puts("<=6");
}
Answers & follow ups
What operation will take longer time:
- to add two bytes
- to add two floats
- to add byte and float ?
Answers & follow ups
A function returning free disk space used to work for years. Problems started after the hard drive was upgraded.
The structure of the program is as following:
int free_space (hard drive)
{
...
}
What would be your approach?
Answers & follow ups
Write a progam to print a binary tree such that the root is printed in the middle of its left and right sub-trees.