Twitter Feed Popout byInfofru

Interview Questions Series 1

Q1) Describe the difference between a Thread and a Process?Ans) Process is a collection of multiple threads ans is a unit of allocation. whereas thread is a unit of execution which allow an application to run multiple task, multiple threads in a process share the same virtual memory.Q2)What is a Windows Service and how does its lifecycle differ from a “standard” EXE?Ans) Windows services are the long running Process and have no user interface and control by Service Control Manager. Windows Services can start when the os starts and all the logs of windows service maintain in Widnows Event Log. Q3)What is the difference between an EXE and a DLL?Ans) An Exe can run independently where as DLL need an executeable file(EXE) to perform any function. DLL is in Process file where as EXE is out Process file. Q4)What is strong-typing versus weak-typing? Which is preferred? Why?Ans) Strong type check the variable and data type as soon as possible usually at compile time where as Weak type reverse the situation means as late as possible at runtime. furthermore,the preference is depends upon what are you up to. If you are writing script then use weak typing and if you are writing application in which speed is really matters then I sugges you should do strong type.Q5)What are PDBs? Where must they be located for debugging to work?Ans)PDB is Program database file which contain the state information.It contains the debug information of assembly.Q6)What is FullTrust? Do GAC’ed assemblies have FullTrust?Ans) Fulltrust assemblies means your code is allowed to do any thing, All .net Permission granted. Yes GAC Have full trust permission because it reside on local hd but we can change that using CASPOL.Q7)Why is catch(Exception) almost always a bad idea?Ans) Well , being a programmer if a LOC expected to throw error then why dont we catch directly that specific exception for example instead of catch(Exception ex){it catches all the exception and perform accrodingly} we can catch(NullException ex) {It catches only NullException type} Good Idea.Q8) What is the difference between Debug.Write and Trace.Write? When should each be used?Ans) Debug.write only works in Debug mode whereas Trace.write works in both Debug and release mode.Q9) What is Reference Type and value Type?Ans) String is Reference Type.Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short,strut, uint, ulong, ushortValue types are stored in the StackReference type - class, delegate, interface, object, stringReference types are stored in the Heap