- When is machine code generated for java classes? (google Just In Time [JIT] compiler)
- If I compile java code on one OS, can I move the class files to another machine and run them there? (yes)
- Are primitives passed by reference or value to methods? (value)
- What does Microsoft's OLE stand for? What is ActiveX? (Object Linking and Embedding, and google ActiveX)
- Is Java a managed or unmanaged language? Are memory leaks possible? If so, how would you make one? (managed, yes, and too complicated to explain briefly)
I also received a logic question at the end which I found interesting. I'll repeat it here:
There are three jars which you cannot see into. One of them contains black marbles, one contains white marbles, and one is mixed black and white (proportion unknown). There are already labels on the jars with "Black", "White" and "Mixed". However, every label is incorrect.
How many marbles do you need to draw out of which jars in order to figure out what should be the correct labeling?
Spoiler (Copy and paste):
The correct answer is 1, and it's out of the mixed jar. The key to the problem is that every jar is labeled incorrectly. If the marble that comes from the "mixed" jar is white, then that jar is actually ALL white. It can't be mixed because all the labels are definitely wrong. Via process of elimination you can figure out the other ones without drawing more ("black" must be mixed and "white" must be black).

Oooh, I liked that logic question. Gotta try that one on my friends/family.
ReplyDeleteHi
ReplyDeleteI read this post two times.
I like it so much, please try to keep posting.
Let me introduce other material that may be good for our community.
Source: Citigroup interview questions
Best regards
Henry