Thursday, January 3, 2008
1 Will finally block get executed if the exception had not occurred?
Yes. What is the C# equivalent of C++ catch ( ), which was a catch-all statement for any
possible exception?
2 Why would you use untrusted verificaion?
Web Services might use it, as well as non-Windows applications.
3 Why cannot you specify the accessibility modifier for methods inside the interface?
They all must be public. Therefore, to prevent you from getting the false impression that you
have any freedom of choice, you are not allowed to specify any accessibility, it is public by
default.
4 Why are there five tracing levels in System.Diagnostics.TraceSwitcher?
The tracing dumps can be quite verbose and for some applications that are constantly running
you run the risk of overloading the machine and the hard drive there. Five levels range from None to Verbose, allowing to fine-tune the tracing activities.
5 Which one is trusted and which one is untrusted?
Windows Authentication is trusted because the username and password are checked with the
Active Directory, the SQL Server authentication is untrusted, since SQL Server is the only verifier participating in the transaction.
6 Where is the output of TextWriterTraceListener redirected?
To the Console or a text file depending on the parameter passed to the constructor.
7 When you inherit a protected class-level variable, who is it available to?
Classes in the same namespace.
8 When do you absolutely have to declare a class as abstract (as opposed to free-willed
educated choice or decision based on UML diagram)?
When at least one of the methods in the class is abstract. When the class itself is inherited from
an abstract class, but not all base abstract methods have been over-ridden.
9 What namespaces are necessary to create a localized application?
System.Globalization, System.Resources.
10 What is the wildcard character in SQL?
Let us say you want to query database with LIKE for all employees whose name starts with La.
The wildcard character is %, the proper query with LIKE would involve La%.
11 What is the top .NET class that everything is derived from?
System.Object.
12 What is the role of the DataReader class in ADO.NET connections?
It returns a read-only dataset from the data source when the command is executed.
13 What is the implicit name of the parameter that gets passed into the class set method?
Value, and its datatype depends on whatever variable we are changing.
14 What is the difference between the System.Array.CopyTo() and System.Array.Clone()?
The first one performs a deep copy of the array, the second one is shallow.
15 What is the difference between the Debug class and Trace class?
Documentation looks the same. Use Debug class for debug builds, use Trace class for both
debug and release builds.
16 What is the difference between System.String and System.StringBuilder classes?
System.String is immutable; System.StringBuilder was designed with the purpose of having a
mutable string where a variety of operations can be performed.
17 What is the difference between an interface and abstract class?
In the interface all methods must be abstract; in the abstract class some methods can be
concrete. In the interface no accessibility modifiers are allowed, which is ok in abstract classes.
18 What is the difference between and XML documentation tag?
Single line code example and multiple-line code example.
19 What is the difference between // comments, /* */ comments and /// comments?
Single-line, multi-line and XML documentation comments.
20 What is the data provider name to connect to Access database?
Microsoft.Access.
Labels: interview questions1
0 comments:
Post a Comment