Interview Tips Interview Tips, Interview Questions and Answers

30Apr/100

Explain the concepts and capabilities of Assembly in .NET.

An assembly is a collection of files (dll’s, exe’s), group of resources that help in creating a logical unit of functionality. It forms the basic building block for deployment, reusability and security issues.

  • It provides a CLR environment.
  • It helps in maintaining security as it grants grant or denial of permissions.
  • When an application starts only assemblies the application initially calls must be present.
  • Assemblies can be either static or dynamic.
  • Assemblies help in resolving versioning issues.
28Apr/101

Do References Really Matter? Helpful hints!

1. Include references only when requested by an employer.

2. Carefully consider whom to provide after discussion with the prospective employer. The time to check references is before an offer is made, but after the candidate is either the final candidate or among the final few for the job.

3. Seek references from people who actually know you and your work. Ask for permission to list them as a reference.

4. Ask directly if they can provide you with a positive reference for the position(s) you are seeking.  If they hesitate, move on!

5. Prepare your references about who will be calling them and what to focus on when talking about you. Always ask them to call you after they have been called.

6. Prepare your references to speak consistently about your skills, but not identically.  Suggest a different highlight for each person. Have 100 percent confidence in what they will say and how they speak about you, or cross them off the list.

7. Provide accurate contact information about your references, and ask your references how they prefer to be contacted (e-mail, phone, etc.).

8. Let your references know what happens to you and the position(s) you applied for. Thank your references.

9. Prepare a LinkedIn site to demonstrate your skills and interests.

10. Participate in professional blogs to create a history of professional involvement in your field that is independent of your work history.

21Apr/100

.NET interview: What is the difference between the SoapFormatter and the XmlSerializer

SoapFormatter

SOAP formatter will actually take the field values of an object and store all of that information in the stream passed.

SoapFormatter is better to serialize arbitrary data

XmlSerializer

XML Serialization would just serialize the public properties of an object.

The XML Serializer is used typically for serializing simple types across web services

xmlserializer is better, more flexible and faster

20Apr/100

.NET interview: Questions on serialization

How do you encapsulate the binary serialization?

public static void SerializeBinary( object o, string file_name)
{
using (FileStream fs = new FileStream(file_name, FileMode.Create)) {
BinaryFormatter fmt = new BinaryFormatter ();
fmt.Serialize(fs, o);
}
}

How do you implement a custom serialization?

CUSTOM SERIALIZATION implementation
public class A: ISerializable
{
private int a;
protected A(SerializationInfo si, StreamingContext sc)
{
this.a = serializationInfo.GetInt32("a");
}
public void ISerializable.GetObjectData(SerializationInfo si, StreamingContext sc)
{
si.AddValue("a", this.a);
}
}

19Apr/100

.NET interview: What are the main advantages of binary serialization

An object is stored in a file, a database or even in the memory. However, data to be transferred over a network needs to be in a linear form for which serialization and deserialization are used.

Advantage of serialization is the ability of an object to be serialized into a persistent or a non-persistent storage media and then reconstructing the same object later by de-serializing the object.

Also Binary Serialization is faster, supports complex objects too with read only properties and even circular references.

18Apr/100

.NET interview: Serialization in .NET

Explain about Serialization in .NET. Explain binary serialization and XML serialization

System.Runtime.Serialization namespace provides Serialization in .NET.
The IFormatter interface in the namespace contains Serialize and De-serialize methods that save and load data of a stream.
So we need stream as a container for the serialized object(s) and a formatter that serializes these objects onto the stream to implement serialization in .net.

Binary serialization is a mechanism that creates exact binary copy of the object onto the storage media by writing the data to the output stream such that it can be used to re-construct the object automatically.

XML serialization results in strongly typed classes with public properties and fields that are converted to a serial format for storage or transport. This XML stream conforms to a specific XML Schema definition language (XSD) document.

Explain why Serialization.

An object is stored in a file, a database or even in the memory. However, data to be transferred over a network needs to be in a linear form for which serialization and deserialization are used.

Advantage of serialization is the ability of an object to be serialized into a persistent or a non-persistent storage media and then reconstructing the same object later by de-serializing the object.

Remoting and Web Services depend heavily on Serialization and De-serialization.

Explain the components that comprise the binary serialization architecture.

To binary serialize an object we need a FileStream object,
Constructor: FileStream(file_name, FileMode.Create);

And

BinaryFormatter
Constructor: binaryFormatter.Serialize(fileStreamObject, object1);

What is Formatters? Explain the binary formatter and the SOAP formatter.

A formatter determines the serialization format for objects.

.NET framework provides Binary formatter and SOAP formatter which inherit from the IFormatter interface

The Binary Formatter

It provides binary encoding for compact serialization for storage or socket-based network streams.
It is not appropriate for data to be passed through a firewall.

The SOAP Formatter

It provides formatting that can be used to enable objects to be serialized using the SOAP protocol.
The class is used for serialization through firewalls or diverse systems.

17Apr/100

.NET interview: The concepts and capabilities of Assembly in .NET.

An assembly is a collection of files (dll’s, exe’s), group of resources that help in creating a logical unit of functionality. It forms the basic building block for deployment, reusability and security issues.

  • It provides a CLR environment.
  • It helps in maintaining security as it grants grant or denial of permissions.
  • When an application starts only assemblies the application initially calls must be present.
  • Assemblies can be either static or dynamic.
  • Assemblies help in resolving versioning issues.
16Apr/100

.NET interview: What is a CLR (Common Language Runtime)?

Often there is a need for different languages to communicate with each other at run time. For e.g. A class may be written in one language and its derived class may be written in a different language. Common Language Runtime is a run time environment for .NET. These different languages are integrated and can communicate easily because language compilers and tools that target the runtime use a common type system defined by the runtime.

Features or Functionalities offered by CLR:-

  • Garbage collection for managing life of objects.
  • Enables Cross language inheritance as explained in example above.
  • Syntax and keywords similar to C and C++