C++ Interview Questions

  1. What is the difference between an ARRAY and a LIST?
  2. What is faster : access the element in an ARRAY or in a LIST?
  3. Define a constructor - what it is and how it might be called (2 methods).
  4. Describe PRIVATE, PROTECTED and PUBLIC – the differences and give examples.
  5. What is a COPY CONSTRUCTOR and when is it called (this is a frequent question !)?
  6. Explain term POLIMORPHISM and give an example using eg. SHAPE object: If I have a base class SHAPE, how would I define DRAW methods for two objects CIRCLE and SQUARE.
  7. What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
  8. What are 2 ways of exporting a function from a DLL?
  9. You have two pairs: new() and delete() and another pair : alloc() and free(). Explain differences between eg. new() and malloc()
  10. What is a callback function. Explain in C and C++ and WIN API environment.
  11. (From WINDOWS API area): what is LPARAM and WPARAM?

1 comment:

  1. Hello Mate,

    I learnt so much in such little time about C++ Interview Questions. Even a toddler could become smart reading of your amazing articles.

    Could someone explain this code step by step:

    A static function is a function whose scope is limited to the current source file. Scope refers to the visibility of a function or variable. If the function or variable is visible outside of the current source file, it is said to have global, or external, scope. If the function or variable is not visible outside of the current source file, it is said to have local, or static, scope.
    #define MAX 10
    int main()
    char array[MAX][MAX], c = 0;
    int d = 1, x = 0, i, j;
    do scanf("%s", array[x]);
    while (array[x++][0] != '0');
    float* pf;
    int xx, *pi = (int*)&array[0][7];
    xx = ((*pi) & 0x41000000);
    pf = (float*)&xx;
    printf("%5.2f\n", *pf);
    for (c-=--x; c++&**array; d+=!(c<0)) d<<=1;
    d -= c;
    for (i = 0; i < x;
    i==1?printf("%c ", array[i][x>>1]):i, ++i)
    for (j = 0; j <= x - i;
    printf("%c", array[i][j++]));
    printf("%x", d);
    return 0;

    By the way do you have any YouTube videos, would love to watch it. I would like to connect you on LinkedIn, great to have experts like you in my connection (In case, if you don’t have any issues).

    Best Regards,