Microsoft Paper on 5th september 2008

Posted on :01-02-2016

Q1. Find the output of the following program segment

#include
char *c[]={ENTNG, NST, AMAZI, FIBRE};
char** cp[]={c+3, c+2, c+1, c};
char ***cpp= cp;
void main() {
printf(%s, **++cpp);
printf(%s, *–*++cpp+3);
printf(%s ,*cpp[-2]+3);
printf(%s,cpp[-1][-1]+1);
         }

Q2. Write a function delete(struct node** Head) to delete the linked list node by node by de allocating them from the memory and at the end assign the head pointer to NULL.

void deleteListTest(struct node* headRef) {
struct node* myList=Listonetwothree();
delete(headRef);
}
//write your code here

Q3. Write a function Compute(int x) such that it prints the values of x, 2x, 4x, 8x . till the value doesnot exceed 20000. After reaching 20000, it again comes back from 8x, 4x, 2x, x and stops there.

Note

(1) You cant use any local variables in the function
(2) You cant use any loops (for or while or do..while) or any GOTO statement.

Q4. List all data structures you would use for a memory management module.

Q5. Share 2 high complexity and 2 low complexity test cases for a coke vending (ATM) machine.
Q6. Explain 3 high priority test cases for the performance of MSN search engine.

ANS:

Two of the trickiest questions and the easiest ones:

(1) AMAZING BEST


(3)void Compute  (int x) {
cout
Compute(x*2);
}
cout<}