Tuesday, September 20, 2011

Wipro Questions

WIPRO Interview Questions on 9th January 2011 at Bangalore

Q.1. Consider a string variable stroriginal holding a string value in its memory. Consider the following lines of C code.
strcpy(strdummy,stroriginal);
strreversed = strrev(strdummy);

If stroriginal is a palindrome which of the following statements is true.

a) strcmp(stroriginal,strreversed) is 0
b) strcmp(stroriginal,strrev(strreversed)) is 1
c) strcmp(stroriginal,strreversed) is 1

Answer :- Option a) is the right answer. If the string is a palindrome the strcmp will return 0 while comparing the original and the reversed string.

Q.2. Consider the following lines of C code :

int i,j,summ,lim;
i=0;
j=1;
for(lim = 1; lim <= 10; lim++)
{
summ = j + i;
i = j;
j = sum;
printf("%d",summ);
}

What kind of sequence the above code will generate ?

a) Even Numbers
b) Arithmetic Progression
c) Fibonacci Series

Answer :- The above code would generate option c) Fibonacci Series

Q.3. State True or False. Recursion Type Programming can be used to generate Fibonacci series in C

Answer :- True. Fibonacci series can be generated by recursion programming.

Q.4. Can you say few differences between Unicode character encoding and that of ASCII.

Answer :-Unicode uses 16 bits to encode characters and symbols whereas ASCII uses only 8 bits. Unicode has become a universal standard due to the fact that they can represent far great letters than ASCII. Unicode can be used hassle free to encode several regional languages other than English.

Q.5. With reference to DBMS like Oracle or Sybase, can you tell the differences between shared and exclusive locks ?

Answer :-Multiple transactions use shared locks during database read operations (SELECT Queries) as no data modification is involved. However if a transaction wants to change value of column/columns in single or multiple rows, it acquires an exclusive lock which will not be open to other transactions simultaneously.

Q.6. Can you tell the primary difference between applets and conventional web applications ?

Answer :-Applet is a program that would be downloaded to browser and run on local CPU whereas web applications get executed on server.

Q.7. In the context of memory management schemes, can you tell a primary difference between swapping and paging?

Answer :-Paging refers to writing and reading individual pages (fixed size) of a program to secondary memory (during program execution). Swapping refers to swap an entire program with another in secondary memory during heavy resource utilization.

Q.8. What is RAID ? What is its purpose ?

Answer :- RAID stands for Redundant Array of Independent Disks. It refers to a group of redundant disks (2 or more) which offers fault tolerance towards memory failures.

Q.9.Name the unique address that is stored on ROM on the network adapter card.

Answer :-MAC (Media Access Control) Address is the answer.

Q.10.How to find the maximum number of IPs that can be assigned to a PC.

Answer :-A simple rule to identify the number of NICs or Network Interface Cards. An equal number of IPs can be assigned (provided the OS supports).

Q.11.Tell one good programming requirement that illustrates the fact that C is a strongly typed language ?

Answer :-C involves variable declarations before their usage. This makes it clear that C is strongly typed.

Q.12. Consider a weather report application in C where any change in temperature by +- 2 degrees will be constantly reported to the system and the application should store the times of the day when these changes took place. Which is a better data structure to be used in this scenario - an array or a linked list ?

Answer :-Linked List would handle dynamically growing data very well when compared to arrays. Hence it would be a better choice.

Q.13.Can one use arrays to implement stacks or queues over linked lists ? Is it feasible ?

Answer :-Thought linked lists are commonly used for implementing stacks or queues, with good programming logic, arrays can also be used to implement those. However, as you would expect, linked lists are far more efficient in this scenario.

No comments:

Post a Comment