miércoles, 29 de marzo de 2017

Types of Questions #2

Java Question 1

How does the same Java code run on multiple operating systems?

JVM or Java virtual machine. And how that Java programs run inside of this JVM. It is also important to mention here that when you compile Java code, you're actually compiling the code to bytecode. Since that bytecode is interpreted by the JVM. And the JVM has implementations from many different operating systems. That code can be run anywhere the JVM can run.

Java Question 2

What does the final keyword do?

The simple answer is that final makes a class unable to be subclass. It makes a method unable to be overwritten, and a variable, assignable only once. The better answer is one that further clarifies. That final variable values are not known at compile time, and that this differs from constant. It is also a good idea to talk about how final does not mean a variable is completely immutable. That if a final modifier is put in front of the reference type, the object the variable refers to cannot change, but the properties of that object itself can.

Java Question 3

What is the difference between an interface and an abstract class?


The biggest difference is that an abstract base class can have instance methods, which allows you to have a default behavior, while an interface can declare constants in interface methods, but it can provide an implementation for those methods. It is also good to talk about how an abstract class being a regular class, can have private and protected members as well. There are many different answers to this question. But one really good reason to point out is that, if you need a default implementation, and an abstract class makes it easy to define one, this is definitely a question you should be prepared to answer though. 

martes, 28 de marzo de 2017

Types of Questions #1


C# Question 1
What are all classes in C# derived from?
 The simple answer to this question is object.

C# Question 2
What is a delegate?
The simple answer is that a delegate in C# is a special type that defines a method signature. And an instance of a delegate type can be assigned to any method with a compatible signature, and the assigned method can be called through the delegate instance.

C# Question 3
Describe how generics work in C#.
Generics allow you to write a class or method that does not specify the exact type for one or more its parameters, until the class or method is used. Generics are implemented in C# in such a way that the genericness is preserved all the way to the bytecode that is generated.
 

https://pluralsight.com/library/courses/developer-job-interviews/transcript