Thursday, March 18, 2010

Dotnet interview questions-2


DOTNET


1. How many languages .NET is supporting now?
When .NET was introduced it came with several languages.
VB.NET,
C,
COBOL
and
Perl, etc.
The site DotNetLanguages.Net says 44 languages are supported by .NET

2. How is .NET able to support multiple languages?
                  A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

3. How ASP .NET different from ASP?
             Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

4. What is smart navigation in .NET?
                The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

5. What is view state in .NET?
                       The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control

6. How many languages .NET is supporting now? 
                      When .NET was introduced it came with several languages. VB.NET, C, COBOL and Perl, etc. The site DotNetLanguages.Net says 44 languages are supported.

7. How is .NET able to support multiple languages?
                         A language should comply with the Common Language Runtime standard to become a .NET language. In .NET, code is compiled to Microsoft Intermediate Language (MSIL for short). This is called as Managed Code. This Managed code is run in .NET environment. So after compilation to this IL the language is not a barrier. A code can call or use a function written in another language.

8. How ASP .NET different from ASP?
                Scripting is separated from the HTML, Code is compiled as a DLL, these DLLs can be executed on the server.

9. What is smart navigation?
                The cursor position is maintained when the page gets refreshed due to the server side validation and the page gets refreshed.

10.What is view state? 
                    The web is stateless. But in ASP.NET, the state of a page is maintained in the in the page itself automatically. How? The values are encrypted and saved in hidden controls. this is done automatically by the ASP.NET. This can be switched off / on for a single control

11.How do you validate the controls in an ASP .NET page? 
                    Using special validation controls that are meant for this. We have Range Validator, Email Validator.

12.Can the validation be done in the server side? Or this can be done only in the Client side? 
                                   Client side is done by default. Server side validation is also possible. We can switch off the client side and server side can be done.

13.How to manage pagination in a page?
                            Using pagination option in DataGrid control. We have to set the number of records for a page, then it takes care of pagination by itself.

14.What is ADO .NET and what is difference between ADO and ADO.NET?
                            ADO.NET is stateless mechanism. I can treat the ADO.Net as a separate in-memory database where in I can use relationships between the tables and select insert and updates to the database. I can update the actual database as a batch.


C#

1.What Is about C#?
               C # is also known as c sharp. It is a programming language introduced by Microsoft. C# contains features similar to Java and C++. It is specially designed to work with Microsoft .NET platform.

2.Explain about the rules for naming classes in C#?

                 These are the rules for naming classes in c sharp.

• Must begin with a letter. This letter may be followed by a sequence of letters, digits (0-9), or ‘_’. The first character in a class name cannot be a digit.

• Must not contain any embedded space or symbol like ? - + ! @ # % & * ( { } [ ] , : ; ‘ “ \ and/. However an underscore _ can be used wherever a space is required.

• Must not use a keyword for a class name.

3.What are the rules to be followed while naming variables in C#.
               The following rules are used for naming variables in C#.

* Must begin with a letter or an underscore _ which may be followed by a sequence of letters, digits (0-9), or ‘_’. The first character in a variable name cannot be a digit.

* Must not contain any embedded space or symbol like ? - + ! @ # % & * ( { } [ ] , : ; ‘ “ \ and/. However an underscore _ can be used wherever a space is required.

• Must be unique

• Can have any number of characters

• Keywords cannot be used as variable names.

4.What are the different types of Data?
                There are two different types of data supported by C#. They are
Value types: -They directly contain data. When you declare an int variable, the system allocates memory to store the value.

Reference type: -The reference types do not maintain data but they contain a reference to the variables, which are stored in memory. This means that if the value in the memory location is modified by one of the variables, the other variables automatically reflect the changes value

5.Explain about member functions?
                  A function is a set of statements that perform a specific task in response to a message. The functions of a class are called member functions in Csharp. Member functions are declared inside the class. The function declaration introduces the function in the class and the function definition contains the function code.

6.Explain about comment entry?
              Comments are a part of the program and are used to explain the code. Compilers ignore comment entries. If a comment entry spans more than one line, it has to be enclosed within ‘/*’ and ‘*/’. The symbol ‘//’ treats the rest of code within the same line as a comment.

7.What are operators?

           Applications use operators to process the data entered by a user. Operators like + and – are used to process variables and return a value. An operator is a set of one or more characters that is used for computations or comparisons. Operators can transform one or more data values, called operands into a new data value.

8.Explain about the break statement?
              A break statement is used to exit the switch statement. This prevents the execution of the remaining case structures by ending the execution of the switch case construct. Each break statement terminates the enclosing switch statement and the flow of control. If none of the cases match the default case is invoked.

9.Define encapsulation?
             Encapsulation literally means to enclose in or as if in a capsule. Encapsulation is defined as the process of enclosing one or more items within a physical or logical package. It involves preventing access to nonessential details.

10.Define access specifier with reference to class?
                An access specifier defines the scope of a class member. A class member refers to the variables and functions in a class. A program can have one or more classes. You may want some members of a class to be accessible to other classes. But, you may not want some other members of the class to be accessible outside the class.

0 comments: