.NET interview: What is the difference between a Thread and Process?
A process is a collection of virtual memory space, code, data, and system resources. A thread is code that is to be serially executed within a process. A processor executes threads, not processes, so each application has at least one process, and a process always has at least one thread of execution, known as the primary thread. A process can have multiple threads in addition to the primary thread. Prior to the introduction of multiple threads of execution, applications were all designed to run on a single thread of execution.
When a thread begins to execute, it continues until it is killed or until it is interrupted by a thread with higher priority (by a user action or the kernel’s thread scheduler). Each thread can run separate sections of code, or multiple threads can execute the same section of code. Threads executing the same block of code maintain separate stacks. Each thread in a process shares that process’s global variables and resources.
C# interview questions and answers
1. What’s the advantage of using System.Text.StringBuilder over System.String?
StringBuilder is more efficient in cases where a large amount of manipulation is done in the text. Strings are immutable, so it is increasingly being operated, a new instance is created.
2. Can you store multiple data types in System.Array?
No.
3. What’s the difference between the System.Array.CopyTo() and System.Array.Clone()?
The first three performs a deep copy of the array, the second three is shallow.
4. How can you sort the elements of the array in descending order?
By calling Sort() and then Reverse() methods.
5. What’s the C# equivalent of C++ catch (…), which was a catch-all statement for any possible exception?
A catch block that catches the exception of type Process.Exception. You can also omit the parameter information type in this case and write catch {}.
6. Why is it a bad idea to throw your own exceptions?
Well, if that point is known that an error has occurred, why not write the code of law to resolve this error, instead of passing a new Exception object to the catch block? Start your own exclusions means that some design flaws in the project.
7. What’s a delegate?
A delegate object encapsulates a reference to a system. In C++ they were referred to as function pointers.
8. How’s the DLL Hell problem solved in .NET?
Assembly versions allows the application to specify not only the library it needs to function (which was available under Win32), but also the version of the Assembly.
9. What are the ways to deploy an assembly?
An MSI installer, a CAB archive, and XCOPY command.
10. What’s a satellite assembly?
When writing a multilingual application in multi-cultural. NET, and need to deliver the core application separately from the localized modules, the localized assemblies that change the core application are called satellite assemblies.
11. What’s the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
12. How do you generate documentation from the C# file commented properly with a command-line compiler?
Compile it with a /doc switch.
13. What’s the difference between <c> and <code> XML documentation tag?
Single line code example and multiple-line code example.
ASP.NET Features and Advantages
ASP.NET is a compiled, .NET-based environment; you can code the applications in any .NET compatible language, including Visual Basic .NET, C#, and JScript .NET. Additionally, the entire .NET Framework is available to any ASP.NET application.
ASP.NET has been designed with scalability in mind, with features specifically tailored to improve performance in clustered and multiprocessor environments. With built in Windows authentication and per-application configuration, you can be assured that your applications are secure.
You can use Web Forms or XML Web services when creating an ASP.NET application, or combine both depending on your need. Both of them allows you to use authentication schemes, cache frequently used data, or customize application's configuration.
ASP.Net allows programmers to develop web applications that interface with a database. The advantage of ASP.Net is that it is object-oriented and has many programming tools that allow for faster development and more functionality.
There are 2 aspects of ASP.Net make it fast, compiled code and caching.
Prior to DOT Net Framework, the code was interpreted into machine language when your website visitor views your page. Now, with ASP.Net the code is compiled into machine language before your visitor ever comes to your site.
Caching is the storage of information that will be reused in a memory location for faster access in the future. ASP.Net allows programmers to set up pages or areas of pages that are commonly reused to be cached for a set period of time to improve the performance of web applications. I have used caching in many of my applications with few records, static and frequently used data.
ASP.Net automatically recovers from memory leaks and errors to make sure that your website is always available to your visitors. Programmers can actually write their code in any of the supported .Net languages like VB.Net, C#, and JScript.Net. In the Learning series, we will be using C# since it’s the widely used language across many companies.
An ASP.NET Framework application is deployed to a server simply by copying the necessary files to the server. No server restart is required, even to deploy or replace running compiled code.
Security is one of the major advantage, you can use built in Windows authentication and also you can set the security configuration by application.
Thank You Letter for Job Interview
Your Name
Your Address
Your City, State, Zip Code
Your Phone Number
Your Email
Date
Name
Title
Organization
Address
City, State, Zip Code
Dear Mr./Ms. Last Name:
It was very enjoyable to speak with you about the assistant account executive position at the Smith Agency. The job, as you presented it, seems to be a very good match for my skills and interests. The creative approach to account management that you described confirmed my desire to work with you.
In addition to my enthusiasm, I will bring to the position strong writing skills, assertiveness and the ability to encourage others to work cooperatively with the department. My artistic background will help me to work with artists on staff and provide me with an understanding of the visual aspects of our work.
I understand your need for administrative support. My detail orientation and organizational skills will help to free you to deal with larger issues. I neglected to mention during my interview that I had worked for two summers as a temporary office worker. This experience helped me to develop my secretarial and clerical skills.
I appreciate the time you took to interview me. I am very interested in working for you and look forward to hearing from you about this position.
Sincerely,
Your Signature
Your Typed Name