1.

What is Serialization in C#?

Answer»

When we want to store any object to a memory, a database, or a file, it needs a special process known as Serialization. 

Serialization is the process of converting an object into a different form to store it on to a file, database, or memory. The purpose of Serialization is to transfer the object and its state across the network and recreate it successfully when needed.

The reverse of Serialization is known as Deserialization.

There are many types of serialization in C#, such as:



  • Binary serialization: To save the state of the object in binary format.  This is done using classes defined in the System.Runtime.Serialization namespace.


  • Soap Serialization: To save the state of the object in binary format, with the use of network-related communication.


  • XML Serialization: To save the state of the object in XML format. This is done using classes defined in the System.Xml.Serialization namespace.


  • JSON Serialization: To save the state of the object in JSON format.  This is done using classes defined in the System.Text.Json namespace.

There are some third-party serialization formats as well that are supported in C#, such as MessagePack (msgpack).

Conclusion:

If you are planning to go for an interview in C# with 5+ years of experience, then you will need to be ready for some aggressive, in-depth, and out-of-the-box questions. However, with proper knowledge, brush up on your experience and expertise, and proper preparation, you can easily crack any interview. 

Useful Resources:


  • OOPs Interview Questions

  • .NET Interview Questions

  • ASP.NET Interview Questions

  • MVC Interview Questions




Discussion

No Comment Found