I hope it's just logic. I have made a few functional relational databases and worked with SQL Query language a bit in my PHP days (last month hehe). Anybody have any suggestions on what I should be focusing on or what will be on the "programming test"?
I just had an interview for a similar position. I interviewed with two different engineers who worked in two different vastly different areas. Anyways, I was asked things like:
Implement a binary search for a given set of sorted numbers
Show how a binary search tree would be represented for a string of letters
How would you design a chess game using OOP principles
What is the benefits of having classes in a given situation
Debug a method (mine dealt with string replacement)
Write a unit test
Find null pointer exceptions
Explain the difference between managed and unmanaged languages
Some database questions (I told them I knew nothing about them so they just moved on)
Insert a node into a linked list
Also pointers. I know pass by references, but pointers are a bit shady as well as the arrow operator (->) never used it, which I think is connected in some way with my first question and heap (memory based) objects.
Well, what you just showed are both variables on the stack. The first creates an object of type Calculator, while the second is just a pointer of type Calculator.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
Calculator myCalc; //Stack object
Calculator *ptrCalc; //Stack pointer
ptrCalc = new Calculator; //ptrCalc now points to an object on the heap, but ptrCalc still resides on the stack.
delete ptrCalc; //Frees the memory pointed to by ptrCalc. ptrCalc is still alive and well though
ptrCalc = new Calculator; //Same as above, you can reuse a pointer.
ptrCalc->someMethod(); //-> is equivalent to (*ptrCalc).someMethod()
//Can also do
pointer = &calc; //Everything here is on the stack
Also you will generally want to use the heap for large objects or arrays. The stack space your program gets from the OS is allocated at startup and cannot become any larger (you generally get a few MB's I think). If you try to use more stack memory than you have available you get an error called a stack overflow. The heap doesn't have such size limitations though, you can keep allocating more memory until you exhaust all of the available physical memory on the computer.
The first statement creates an object of type className in C++. The third statement give you an error in C++.
However in C# the first statement create a reference to an object of type className that will be equal to null. The third statement creates an object in the managed heap in C# and assigns its reference to classVariable.