2

I was asked this question in an interview today. What should have been my response?

My response was along the lines of "Uh....hmm....I don't know... I think it would be the runtime."

I know that the CLR provides a lot of Cross Cutting services (GC, CAS etc.), but I wasn't really sure about this.

0

2 Answers 2

1

Hmm... that's a strange question. I would respond by saying -

When the JIT compiler encounters the MSIL instructions for allocating a new object (newobj), it compiles the appropriate native instructions that tell the Runtime to allocate space for the object on the managed heap. Then it calls the object's constructor to initialize the data.

2
  • thats kinda what I said at first to which, he said "That would be the answer to when it creates" :) anyways didn't really know what his intention was. May 29, 2013 at 17:28
  • 1
    That's weird... it sounds like you're interviewer is trying to show off some esoteric, but unimportant knowledge... Maybe he wanted you to tell him the actual name of the method in the Runtime??? May 29, 2013 at 17:30
1

I think that, when a object is instantiated, this is made by JIT. I found this arcticle about instance of great objects, I hope that helps: http://msdn.microsoft.com/en-us/magazine/cc163791.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.