Wednesday, March 11, 2009

C#

Different Output Options of the C# Compiler: /out /target:exe /target:library /target:module /target:winexe
Referencing external assemblies using CSC: 
csc /r:System.Windows.Forms.dll TestApp.cs      csc /r:System.Windows.Forms.dll;System.Drawing.dll *.cs
What is Response file when using CSC?
What are different variations of Main method? Discuss significance of return code of Main method?
How to specify command line arguments for Main method?    -arg1 -arg2
Discuss Variable Declaration and Initialization for value types and reference types
How to find out if given char is digit or letter or whitespace ? char.IsDigit(), char.IsLetter(), char.IsWhiteSpace()
String is reference type of value type? Why strings are immuatable?
Difference between System.String and System.Text.StringBuidler?
If a class contains value type members , where these members are stored ...in stack or heap?
What is boxing and unboxing?
.Equal  vs == ?
unchecked keyword?
System.Convert vs .Parse?
Difference between while and dowhile?
Does Switch allows fall through?
Discuss ref, out, params
Discuss passing by value and passing ref for value types and ref types
overload vs override
Different ways of overloading a method?
abstract override vs virtual override
Array -- is a ref type or value type?
If you store integers in Arrays - where they'll be stored?
How to create Multi dimensional , rectangular and jagged arrays?
What is the underlying storage type for enum? How to customize that?
value type vs reference type
structure vs class
Structures can implement interfaces? Can inherit from other struct ? Can have reference type members?
Structures can have default constructor? What is required to have a custom constructor in terms of parameters?
What are nullable types? How to compare if nullable type has value? Is it possible to reassign nullable type to a null?
?? dealing with nullable types
Static members vs instance members
Usage of static constructors
Discuss static classes? Can they inherit other classes?
Discuss Pillars of OOP? Encapuslation, Inheritance and Polymorphism
Encapsulation vs abstraction
Discuss Protected internal
How to define read-only or write-only properties? How to have public get and private set
What are static properties?
Default access modifiers for class, members
How to call a base class constructor? Overloaded constructor in same class?
How to read command line arguments ? Environment.GetCommandLineArgs()
System.Environment properites  -- ExitCode, MachineName, UserName,StackTrace
Formatting numeric data
checked vs unchecked keywords
for loop vs foreach loop
while vs do while loop
string vs strinbuilder
why strings are immutable?
memory size of DateTime and TimeSpan ?
Constant vs read only?
Static read only vs constant?
Advantages of partial types? Can partial type differnt inerfaces on differnt files?
NDoc
sealed
How to prevent derived class overriding a virtual method?
Abstract class vs interface
Discuss Member shadowing
Usage of 'is' and 'as' keywords
If Object.Equals() is overridden then override .GetHashCode() also
System.Exception vs System.ApplicationException vs SystemException
Explain HelpLink, StackTrace, TargetSite, Source of Exception, Data
What Methods / constructors needs to be implemented to write a custom exception?
How to throw and rethrow exceptions?
Discuss Garbage Collector and Object Generations
GC.Collect()  , SuppressFinalize(), WaitForPendingFinalizers()
Finalizable objects vs disposable objects
Can a class override Object.Finalize() ?
Can we override a protected virtual method?
How to provide finalization functionality in a class?
Can we add / modify / remove items for an ArrayList which is exposed as read only property in a class?
can we use is keyword to compare a interface and an object whose class implements that interface?
How to return interface types? Can we return null in such methods?
Discuss explicit interface implementation? Calling such methods, access modifiers for such methods?
Array.GetEnumerator()  --
Discuss Named Iterators and yield
IComparable vs IComparer
discuss IList, ICollection, and IDicitionary
Members of Queue type and Stack type?
Specialized collections objects -> CollectionsUtil, HybridDictionary, ListDictionary, NameValueCollection, StringCollection,

StringDictionary
where T : new()  in generics?
DynamicInvoke method of a delegate
Can delegates points to a method which takes out and ref parameters?
Contravariance and covariance in delegates
Exposing an event vs delegate
System.Predicate<T>  -- a delegate wrapping a method which returns bool
is it possible to create indexer with multiple dimensions? If so how?
Can interfaces define indexers?
Operator overloading? what are sets?
Explicit conversions using 'explicit' keyword
explain unsafe keyword
SizeOf -- can we use it on reference types?
use of preprocessor directives
What are the restrictions imposed on implicitly typed variables? var
Can we have nullable implicit types? (Implicit Typed Data Is Strongly Typed Data)
Automatic properties -- Is it possible to build read only / write only properties using automatic properties?
public string PetName { get; protected set; }   -- is it possible to define like this?
Usage of extension methods  --- versioning on extension methods?
Example of Extending Interface Types via Extension Methods
Discuss partial methods (implicitly private, returns void)  -- can they have out and ref parameters?
usage of partial methods  --- lightweight events
Explain object initializers and Anonymous types - what are limitations?
How to define namespace alias?
private assembly vs public assembly?
What is GAC? How to install an assembly in to GAC?
What is strong name key? How to generate one? Delay signing
Parts of an assembly
Assembly probing
BindingRedirect -- config
can we re-use a key for different versions of same assembly .. or for multiple assemblies?
Discuss publisher policy
codebase element
How to read appsettings programmatically?
How to read a key and value in appsettings in a config file?
Practical usage of reflection?
Early binding vs late binding
System.Activator   --- createInstance
MethodInfo -- how to invoke a method at run time and get the result?
How to start a process / service? process, ProcessStartInfo
Discuss process, appdomain and object context boundary
Context agile and context bound types
How to handle the error which is thrown in a method, when calling this method asnychronously?
What happens to a worker thread execution if unhandled error ocurrs?
thread exception and completed events can be registered and handled
Foreground thread vs background thead
Different System.IO clasess and methods used to create a file, read a file, write a file
FileStream,  MemoryStream and BufferedStream
StreamWriter, Stream, StringWriter, StringReader, TextWriter, TextReader,BinaryWriter , BinaryReader
FileSystemsWatcher
Code Access Security
[Serializable]  -- if a class is decorate with this attribute -- all private, public memebers are serialized?
What formatter will be used in above case?
Binary formmater namespace, xml and soap formatters namespaces?
Are there any common set of members between these 3 formatters? What is the base class for each one of these formatters?
The IFormatter and IRemotingFormatter Interfaces
TypeFidelity among formatters?
Serializtion attribute vs ISerialization
How to customize the process of serialization 
1. ISerialization 2. Attributes [OnSerializing], [OnSerialized], [OnDeserializing], or [OnDeserialized]  from .net 2.0 onwards

ADO.Net  - Connected layer vs disconnected layer
Discuss Data Provider Factory
Storing a connecting string in AppSettings vs ConnectionStrings
DataReader vs DataAdapter
How to read row from DataReader? How to read second / multiple results from data reader?
If there is an error while executing sql statement / stored proc using ExecuteReader method ... when this error is visible in

code? Is it when calling executereader() or Read() method? explain in multiple results situation
Is it required to Open() the sqlconnection for DataReader and DataAdapter?
How to execute a UDF (function)  using SqlCommand?
is it possible to execute queries asnchronously using sqlcommand object?
how to read out param from stored proc in ADO.Net?
How to creat a DataRow for a given table?
DataRowState, DataRowVersion
How to filter data in DataTable? Sort data?
How to establish primary key - foreign key relationship in dataset tables? How to get child records?

No comments:

Post a Comment