Some technical questions

.. that often require going-back-to-basics and some random links to basic questions for interviews etc. most of the answers and questions collected from internet

1. How to identify when should I use Interface and when should I use abstract class

These are what I consider to be the main points:

If you use an interface, all objects that implement it will have to provide their own implementations of your interface specification.

If you use an abstract class, then you can provide a base implementation so the derived classes do not need to have their own implementation. Alternatively you can mark properties/methods as virtual so that deriving classes can optionally provide their own implentation or mark them as abstract so they must provide their own implementation. An abstract class with only abstract methods and properties behaves much the same as an interface.

An object can implement many interfaces directly but only one abstract class (no multiple inheritance in C#).

Structs can only implement interfaces and not abstract classes.

2. risc vs cisc vs arm vs dsp vs ..

3. how to send data through wi-fi?

4. what is mfc

The Microsoft Foundation Class (MFC) is a graphical toolkit for the windows operating system. It is a more or less object oriented wrapper of the win32 API, which causes the API to be sometimes C, sometimes C++, and usually an awful mix.

5. How to print the stack trace when your program crashes

Check answers here http://stackoverflow.com/questions/77005/how-to-generate-a-stacktrace-when-my-gcc-c-app-crashes

In general, you need to use something like this

void print_trace(void)
{
void *array[200];
size_t size;
char **strings;
size_t i;

size = backtrace(array, 200);
printf(”obtained %zd stack frames\n”, size);

strings = backtrace_symbols(array, size);

for (i = 0; i < size; i++)
{
printf(”%s\n”, strings[i]);
}

free(strings);
}

for linux/mac. for windows, use dbghelp library. You can import the library at runtime in your code and need not depend on winsdk. See the idea here http://readlist.com/lists/cygwin.com/cygwin/3/15618.html

(Stack traces in own program in cygwin)