gvp
BAN USER
Comments (2)
Reputation 10
Page:
1
Comment hidden because of low score. Click to expand.
Comment hidden because of low score. Click to expand.
1
of 1 vote
Just adding to the BAC consensus with my explanation.
If the interviewer asked why does it have to be this way?
My answer would be:
1) The parent class B must be constructed first to enable access to inherited elements during C's initialization => B;
2) The member variable *instance* A ("instance" means A is not an uninitialized reference*) of the class C must be called before the classes constructor or they can't be operated on in the constructer => A
3) The constructer C has the pre requisites required and can be invoked => C
* As some have pointed out *if* A was a pointer its constructer would not be called until A is explicitly created. But a pointer to A is not equivalent to an "instance of A" which the question references.
Page:
1
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
This is the approach I am taking: Listen to the great algorithm classes provided by Berkley and MIT and Stanford. On YouTube and itunes.
- gvp March 04, 2013My favorite is "ShewChuck" a geeks geek!
Search for ShewChuck 61 and the data struct you want.
Example:
shewchuk 61b priority queue
I need to do this because in my CS classes 25+ years ago we didn't do dynamic programming and Map Reduce. And there was no Internet! Wow!
Just to whine and commiserate: I feel your pain. I produce j2me and Android apps e-commerce burned on phones and used to buy ringtones and wallpapers and apps. My apps are used by millions and I hear about it if they break because that means someone has paid for something they didn't get! Been programing for 25 years.
The few times I need to sort its been n <100 items and of course "I just Google it". That didn't work as an answer for Google. So I am going back to the drawing board (literally!) ;)
* Now someone tell me what to do about trick questions?