मंगलवार, 13 सितंबर 2011

InterView Questions

Q  : What methods java providing for Thread communications ?

Ans:

Java provides three methods that threads can use to communicate with each other: wait, notify, and notify All. These methods are defined for all Objects (not just Threads). The idea is that a method called by a thread may need to wait for some condition to be satisfied by another thread; in that case, it can call the wait method, which causes its thread to wait until another thread calls notify or notify All.



Q :What's the difference between TCP &UDP ?

Ans:
 
TCP is a Transmission Control Protocol.
UDP is a User Datagram Protocol.
There are four major differences between UDP and TCP:
1. TCP can establishes a Connection and UDP cannot.
2. TCP provides a stream of unlimited length, UDP sends
small packets.
3.TCP gurantees that as long as you have a connection data
sent will arrive at the destination, UDP provides not
guarantee delivery.
4.UDP is faster for sending small amounts of data since no
connection setup is required, the data can be sent in less
time then it takes for TCP to establish a connection.


Developer's Interview Questions


Q  :Why do we need function prototypes?

Ans:

With the help of a function prototype, the compiler can automatically perform type checking on the definition of the function,which saves you time in debugging the program.


Q  : What is Reflection in .NET?

Ans:

It extends the benefits of metadata by allowing developers to inspect and use it at runtime. For example, dynamically determine all the classes contained in a given assembly and invoke their methods. Reflection provides objects that encapsulate assemblies, modules, and types. You can use reflection to dynamically create an instance of a type, bind the type to an existing object, or get the type from an existing object. You can then invoke the type's methods or access its fields and properties. Namespace: System.Reflection



Q  : What are Attributes in .NET?

Ans:
Attributes are declarative tags in code that insert additional metadata into an assembly. There exist two types of attributes in the .NET Framework: Predefined attributes such as Assembly Version, which already exist and are accessed through the Runtime Classes; and custom attributes, which you write yourself by extending the System.




Q  : Why do you need the #endif directive?

Ans:

The #endif directive is used with an #if, #ifdef, or #ifndef directives because statements under the control of a conditional preprocessor directive are not enclosed in braces ({ and }). Therefore, #endif must be used to mark the end of the block of statements.

कोई टिप्पणी नहीं:

एक टिप्पणी भेजें

fly