Monday, August 4, 2008

Faq C C++ Interview Questions

  1. What is the most efficient way to reverse a linklist?
  2. How to sort & search a single linklist?
  3. Which is more convenient - single or double-linked linklist? Discuss the trade-offs? What about XOR-linked linklist?
  4. How does indexing work?
  5. char s[10];
    s="Hello";
    printf(s);

    What will be the output? Is there any error with this code?
  6. What is the difference between
    char s[]="Hello";
    char *s="Hello";

    Please give a clear idea on this?
  7. Why do we pass a reference for copy constructors? If it does shallow copy for pass by value (user defined object), how will it do the deep copy?
  8. What is the difference between shallow copy & deep copy?
  9. What is the difference between strcpy and memcpy? What rule should we follow when choosing between these two?
  10. If we declare two variable and two applications are using the same variable, then what will its value be, will it be the same?