Sunteți pe pagina 1din 10

Questions (.

NET, SQL, C#, VB)


Care e diferenta intre debug build si release build?
- Diferenta dintre build-ul de debug si cel de release consta in:
Build-ul de debug contine simboluri ce ajuta la debugging
Build-ul de release nu contine informatii in plus ce ajuta la debugging
Care e diferenta intre override si shadowing?
- Override este suprascrierea unei implementari (abstracte sau virtuale) din clasa parinte.
- Shadowing este redefinirea unei implementari deja existenta in clasa parinte.
Care este diferenta dintre Abstract si Virtual?
- Abstract reprezinta o metoda conceptuala ce contine doar definiri de metode, fara
implementari predefinite.
- Virtual reprezinta o metoda conceptuala ce contine definiri de metode si implementari
predefinite.
- Diferenta consta in faptul ca pentru Virtual trebuie si o implementare predefinita.
Ce este un scope?
- Reprezinta contextul de lucru in care este vizibila o variabila.
Cate procese pot asculta pe un port TCP?
- Un singur proces.
Ce este CIL, CLR, CLI, CLS, CTS?
- CIL Common Intermediate Language este un limbaj intermediar in care sunt compilate toate
limbajele .NET
- CLR Common Language Runtime este componenta responsabila de executia codului
- CLI Common Language Infrastucture este o infrastructura care contine VES si CIL
- CLS Common Language Specification este o specificatie care contine regulile ce trebuie
implementate de orice limbaj din .NET
- CTS Common Type System este inclus in CLS si contine primitivele suportate de .NET
Care e diferenta intre public, private, protected, internal si sealed?
- Public vizibil de catre oricine, de oriunde
- Private vizibil doar in cadrul unei clase
- Protected vizibila in cadrul clasei si de catre derivate
- Internal vizibila doar in namespace
- Sealed nu poate fi derivata (pt clase si metode)
Ce este un strong named assembly?
- Este un assembly care contine nume, versiune, cultura, o cheie publica unica si o semnatura
digitala.
Ce este un pdb?
- PDB vine de la Program Debug Database si contine date folosite la debugging.
Ce este left , right, full outer join?
- Left Join se iau toate valorile din tabela stanga, cu sau fara corespondenta din partea dreapta
- Right Join se iau toate valorile din tabela dreapta, cu sau fara corespondenta din partea
stanga
- Full Outer Join se iau toate valorile cu sau fara corespondenta din ambele tabele
Ce e un cluster in SQL?
- Un cluster SQL reprezinta mai multe server SQL interconectate folosite pentru a face load-
balancing.
- Un fail-over cluster este folosit pentru redundanta.
Ce e un cursor in SQL?
- Un cursor este un obiect care iti permite sa iterezi prin rezultatul unui Query.
Care e diferenta dintre UNION si UNION ALL?
- Union este o operatiune ce permite concatenarea a doua interogari, ignorand duplicatele.
Este necesar sa fie acelasi numar de campuri in ambele tabele si cu tipuri de date similare.
- Union All are in plus faptul ca nu ignora duplicatele
Ce e incorrect in aceasta instructiune: asembly.load("test.dll")?
- Trebuie folosit numele intreg al assembly-ului.
- Trebuie scris Assembly.Load
Care diferenta intre OOP si SOA?
- OOP paradigma de programare
- SOA design pattern
Ce este SOAP?
- System Object Access Protocol este un protocol formalizat folosit in servicii web.
Care sunt avantaje/ dezavantaje servicii web folosind XML fata de SOAP?
- Avantaje
XML mai putine informatii si este mai rapid
- Dezavantaje
XML lipsa unor reguli de prelucrare a informatiilor primite
Ce este JIT?
- Just In Time compiler traduce din limbaj in cod masina la intalnirea unei metode necompilate.
Ce este boxing/unboxing?
- Boxing Reprezinta traducerea unei variabile de tip valoare in una de tip referinta
- Unboxing - Reprezinta traducerea unei variabile de tip referinta in una de tip valoare
Ce inseamna Iclonable?
- Este o interfata care defineste metoda .Clone ce permite copierea dupa valoare si nu dupa
referinta.
Ce este o clasa?
- Class este o reprezentare digitala a unui obiect din lumea reala
Ce e o interfata?
- Interface o interfata reprezinta o clasa ce contine doar definitii de metode, implicit abstracte
si publice
- Nu poate fi instantata
Ce e abstract?
- Abstract o clasa ce trebuie implementata
Ce este Global Assembly Cache?
- Este o colectie centralizata de librarii .NET.
Cum e pastrat ViewState si ce este acesta?
- ViewState este un contruct care pastreaza starea obiectelor ASP.NET la nivel de client.-server.
- Este pastrat intr-o variabila ascuns din codul HTML.
Cum e pastrat SessionState si ce este acesta?
- SessionState reprezinta starea sesiunii de browsing a unui client.
- Este pastrat in memoria interna a serverului.
Ce contine HTTP Headers?
- Contine informatii despre comunicarea dintre un host si un client, precum:
Marimea pachetului
Encodarea si compresia
Informatiile sunt de tip key-value
Informatii despre mediul serverului/clientului
Ce este un Cookie si la ce este folosit?
- Un cookie reprezinta informatii specifice clientului si are o dimensiune max de 4KB.
Care e diferenta dintre:
- CREATE TABLE #tablename Creaza un tabel temporar
- CREATE TABLE ##tablename Creaza un tabel ascuns (?)
- CREATE TABLE @ tablename - Definirea unui variabile in cadrul unui context SQL
- CREATE TABLE @@ tablename (?)
Care este diferenta dintre un Thread si un Process?
- Un Process poate contine mai multe Thread-uri.
Ce este un serviciu Windows si prin ce difera durata lui de viata fata de un EXE obisnuit?
- Un servici Windows nu are o interfata grafica si ruleaza in background.
Care este memoria maxima care poate fi alocata pentru un proces in Windows? Este diferita de
memorie maxima virtuala alocata sistemului? Cum ar putea influenta acest lucru design-ul unui
sistem?
- Pe un OS pe 32 de bits, memoria maxima ce poate fi alocata este de 3.5GB
- Cantitatea de memorie difera in functie de sistem si de cata memorie virtuala are alocata
Care este diferenta dintre un EXE si un DLL?
- EXE este executabil de sine-statator
- DLL este o librarie la care se conecteaza dinamic
Ce este strong-typing? Dar weak-typing? Ce le diferentiaza? Ce se prefera si de ce?
- Strong-typing Strong-typing inseamna ca atunci cand se compileaza codul, regulile de tip de
date sunt fortate corespunzator cu tipurile de date asignate.
- Weak-typing Invers.
Ce este un PID? Cu ce ajuta la depanarea unui sistem?
- Process ID este un ID unic asignat unui proces.
Ce este Reflection? La ce ajuta?
- reflection is the ability of a computer program to examine (see type introspection) and modify the
structure and behavior (specifically the values, meta-data, properties and functions) of an object
at runtime.
Care este diferenta dintre sercivii XML web ce foloses ASMX si .NET Remoting care foloseste SOAP?
- Cu .NET Remoting se pot contrui aplicatii web pe cloud.
Conceptually, what is the difference between early-binding and late-binding? :)
Early binding means compiler get information of type calling/path execution during compilation of code and in
late binding compiler doesnt get that information but this information determined at runtime/execution time.
Is using Assembly.Load a static reference or dynamic reference? :)
Its dynamic load (Reflection)
When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate? ;)
Difference is only about binding. LoadFrom is flexible and if it doesnt get assembly where it was pointing then it
can be redirect to another path on the other hand LoadFile points/depends upon strictly to reference/path of the
assembly defined, dont redirect in case of failure.
What is an Asssembly Qualified Name? Is it a filename? How is it different? :)
Assembly qualified name contains assembly name, version, token key whereas filename is simple file name
physically on file system. Assembly names store as Meta data as is very important by means of defining scope.
How is a strongly-named assembly different from one that isnt strongly-named? :)
Strongly named assembly have strong names due to public token key so can be stored in GAC (shared
environment) and can be referred by multiple programs whereas non-strongly name cant be stored in GAC.
Can DateTimes be null? :)
Before .net 2.0 it was not possible as datetime/integer are struct/value types which cant be null but due to
nullable types now its possible.
What is the JIT? What is NGEN? What are limitations and benefits of each? J;)
I remember, once I was being interviewed at very big name (company), interviewer asked me about .net IL
compilation I start telling and talked about JIT as well after listening me he said hmmm JIT exist in Java
technologies not .net technologies, I said no I read about it and it does but he kept negating me so I got quite and
said Ok. Anyhow JIT stands for Just in time compiler it compiles code into native code to execute by processor in
three different techniques. It compiles code just before code required to be run which makes execution little slow
(depends) so to avoid that we use NGEN which converts IL into native code like JIT but during deployment. It
comes with large image which also includes that codes compiled version which is not being calling frequently.
How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-
deterministic finalization? ;)
Object life time divides into three different generations, 1 short term and 2 long terms so manage accordingly.
Non deterministic finalization means GC calls finalize method of object not right after object goes out of scope
rather when GC got idle time to prioritize it.
What is the difference between Finalize() and Dispose()? :)
Finalize called by GC and Dispose called by programmer to free up resources.
How is the using() pattern useful? What is IDisposable? How does it support deterministic finalization? :)
Using statement is quite handy and makes code quite efficient as right after end of using statement object
created/declared in that statement disposed automatically means dispose method get called in deterministic way
to free up memory. IDisposible is interface which classes implements to dispose unmanaged resources in
deterministic manner.
What does this useful command line do? tasklist /m "mscor*" ;)
It will list down all the processes that have loaded modules which start from mscor hosting by the .net
environment.
What is the difference between in-proc and out-of-proc? :)
As name implies in proc means loading in the same process memory domain of invoker/host, it is fast technique
but less reliable than out proc in case of any fault/exception occurs. Out proc is opposite to in proc definition and
as loading out of the host process so is not depending and could be safe in host process failure for some reason.
What technology enables out-of-proc communication in .NET? ;)
.net remoting through marshalling
When youre running a component within ASP.NET, what process is it running within on Windows XP?
Windows 2000? Windows 2003? J
Aspnet_wp.exe in case of winxp and win2k but w3pw.exe in case of win2k3.
Senior Developers/Architects
Whats wrong with a line like this? DateTime.Parse(myString); :)
There is nothing wrong necessarily but could be wrong means no error no exception but some logical error like
unexpected result could be produce due to lack of locale/culture info.
What are PDBs? Where must they be located for debugging to work? :)
PDB stands for Program database store debugging symbols and meta information for debugging. Normally they
are located at bin or debug folder.
What is cyclomatic complexity and why is it important? :(
???????????? Please post reply with references if you know through commenting..
Write a standard lock() plus double check to create a critical section around a variable access. :);)
Object objLock; bool isLocked = true; if (isLocked) {lock(objLock){if (isLocked) {//bingooooo}}}}
What is FullTrust? Do GACed assemblies have FullTrust? :)
FullTrust means newly happily marriage :D and in .net it means Assembly have full access of system resources
(which is quite dangerous and in shared hosting domain only medium trust level is allowed). YES GACed
assemblies have fulltrust.
What benefit does your code receive if you decorate it with attributes demanding specific Security
permissions? :)
It let user know what your code/program required to do so and either its allowed to do operation or not so it
becomes user friendly by means of security permissions.
What does this do? gacutil /l | find /i "Corillian" :)
I knew about gacutil only not about any other parameters but I think I can guess so I think gacutil /l means list
of assemblies in GAC (as gacutil used to install/uninstall assemblies in gac and I did that operation ONLY) find /I
Corrilian seems to look for Corillian named assemblies and not sure about /I but I think in other commands it
means ignore case hope it means same here too ;)
What does this do? sn -t foo.dll :)
SN stands for strong name and used to generate strong names of assemblies but not sure about t param here
but my searching told me its for Token Key.
What ports must be open for DCOM over a firewall? What is the purpose of Port 135? :(
DCOM is distributed COM technology which used to remote procedure call and it used port 135 by default. 135
is port of Remote procedure call Service and as DCOM is OO based RPC mechanism so no wonder about it ;) by
the way good question can kill any 1J
Contrast OOP and SOA. What are tenets of each? :)
OOP tenets are Polymorphism, inheritance, abstraction. And SOA tenets would be (not much sure) as it based
on services so discovering/access, interoperatibility, security, distributeable
How does the XmlSerializer work? What ACL permissions does a process using it require? :(
XmlSerializer used read/write interfaces to deserialize/serialize respectively xml based data so its understood
that it uses reflection.
Why is catch(Exception) almost always a bad idea? :)
Catch(exception) is always a time consuming and somehow it means programmer knows/expecting there
would/can be some exception so better approach is to use checks as much as programmer can rather catch
exception but ofcourse its unavoidable.
What is the difference between Debug.Write and Trace.Write? When should each be used? :)
As names implies .write means printing something and debug would be used whilst debugging and Trace is
useable at release mode and according to my knowledge during release mode if debug statement is used it would
be ignored gracefully so chill.
What is the difference between a Debug and Release build? Is there a significant speed difference? Why
or why not? :)
Debug build contains debug symbols in (pdb) files and debugging related meta information which release build
doesnt thats why more compact and efficient.
Does JITting occur per-assembly or per-method? How does this affect the working set? :)
JITing occue per method as NGEN make image of whole assembly at once. JITing degrade efficiency if method is
very highly coupled means dependent upon other methods (call/invoke other methods which were not JIT)
Contrast the use of an abstract base class against an interface? :)
Aaaaah typical interview question but thanks there is something typical scott asked :D. abstract class can have
implementation of methods at different access levels whereas interface can have only declarations of methods and
must be public, abstract class is inheritable. I think interesting and bit difficult contract would be between PURE
abstract class and interface. Sounds good?
What is the difference between a.Equals(b) and a == b? :)
Equals checks type as well as it compares on heap to objects whereas == doesnt, it just check value on stack.
In the context of a comparison, what is object identity versus object equivalence? ;)
Identity means two references on stack point to same address of heap whereas object equivalence means
objects has same value.
How would one do a deep copy in .NET? :)
Normally I hate typical interview questions as this but in this (scott) case I am more than happy to hear. Anyhow
Implement ICloneable simple.
What is boxing? :)
To convert value type into reference type is called boxing.
Is string a value type or a reference type? :)
Its not even again typical interview question but also for heaven sake scott its not suppose to be known by
some senior/architect level of .net guru. Anyhow string is reference type due to its any length of size.
What is the significance of the "PropertySpecified" pattern used by the XmlSerializer? What problem
does it attempt to solve? :(
???????????? Please post reply with references if you know through commenting..
Why are out parameters a bad idea in .NET? Are they? :)
Ofcourse they are not encouraging as out keyword is somehow violating the rule of returning single value which
keep function easy to readable and debuggable as we know only there is single point to return value and
somehow caller can send any vulnerable value which always should be validate. Anyhow there are many solutions
like using array (if return values are of same type or ENUM if feasible or Collection or Class with multiple
properties)
Can attributes be placed on specific parameters to a method? Why is this useful? ;)
Yes I have seen that being using in case of .net remoting but didnt use/need much sooo.
C# Component Developers
Juxtapose the use of override with new. What is shadowing? ;)
Overriding means giving implementation of virtual/abstract/overrideable method in derived class and if we use
new it means it cant be access through by any other class ref/object. Shadowing is somehow opposite to
overriding as it lets redefine method implementation with signature as well.
Explain the use of virtual, sealed, override, and abstract. :)
Through Virtual keyword, we enforce programmer of derive class to override this function. Sealed make sure
that class wont be able to inherit (you may say Such mother who cant birth a baby :D) and through abstract class,
we are able to define methods as abstract to make them must overrideable by child classes and dont let anyone
to instantiate it.
Explain the importance and use of each component of this string: Foo.Bar, Version=2.0.205.0,
Culture=neutral, PublicKeyToken=593777ae2d274679d :)
Foo.Bar Assembly name, Version defines its version in following pattern (Major, Miner, Build) to track version
number of that assembly, Culture specifies culture for locale settings and publickeytoken makes it unique so could
be kept and accessed in shared environment.
Explain the differences between public, protected, private and internal. :)
Public is shareable so anyone can access no matter out of the class/assembly/assembly. Through Protected you
can only access within class or from child classes and through internal you can access within the assembly only.
What benefit do you get from using a Primary Interop Assembly (PIA)? :(
???????????? Please post reply with references if you know through commenting..
By what mechanism does NUnit know what methods to test? :)
Using attributes
What is the difference between: catch(Exception e){throw e;} and catch(Exception e){throw;} :)
Throw also return stack trace which throw e doesnt
What is the difference between typeof(foo) and myFoo.GetType()? ;)
First 1 takes type name and return result at compile time whereas 2
nd
1 takes object and return type at runtime
using reflection ofcourse.
Explain whats happening in the first constructor: public class c{ public c(string a) : this() {;}; public c() {;} }
How is this construct useful? :)
First one calls the base contructor.
What is this? Can this be used within a static method? :)
this keyword points to current object and as static methods cant be invoked through object sooo
ASP.NET (UI) Developers
Describe how a browser-based Form POST becomes a Server-Side event like Button1_OnClick. :)
I am not certain but I think when we need to submit some information or manipulate data at server side we use
POST method which transmit client side information to server side in Request object and send the information to
server and server perform task according to information given by client so in this case Button1_OnClick is
transferred to server and its handler called the relevant method.
What is a PostBack? :)
Postback is way to send client side information to server after loading it.
What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState? :)
ViewState stores information so it could be accessible after postback and information could be persisted after
any number of postbacks but only within the scope of page. It encoded into Base64 format. It can be encrypted.
Controls uses viewstate to store control state and data to be preserved after postback.
What is the <machinekey> element and what two ASP.NET technologies is it used for? :)
machinekey defines unique key which could be use by session and cache so if site is cluster based or single sign
on based then its very useful.
What three Session State providers are available in ASP.NET 1.1? What are the pros and cons of each? :)
In-proc, out-proc, sqlserver
What is Web Gardening? How would using it affect a design? :)
If server has multiple processors and requests traffic is dividing accordingly that is called web gardening. If
server is using external resources (like sql server, web services, logging) then it could be very useful.
Given one ASP.NET application, how many application objects does it have on a single proc box? A dual?
A dual with Web Gardening enabled? How would this affect a design? :)
HTTPApplication object with single key based would be only 1 per worker process so in case of single processor
box ONLY 1, in case of dual processor box without webgardening there would be only 1 single worker process so
again single object but in case of web gardening two worker process means 2 objects. So need to have machine
key otherwise :D
Are threads reused in ASP.NET between reqeusts? Does every HttpRequest get its own thread? Should
you use Thread Local storage with ASP.NET? :)
ASP.NET is MTA based so multiple threads are possible but I remember once I tried to call methods through
callback based async delegates which makes it run on separate thread so when I tried that I lost httpcontext L in
that thread. So each thread gets its own thread and usage is depends upon need.
Is the [ThreadStatic] attribute useful in ASP.NET? Are there side effects? Good or bad? ;)
I never used it but I think I got my just above mentioned problems solution that we can share httpContext
through this attribute in multiple threads ;)
Give an example of how using an HttpHandler could simplify an existing design that serves Check Images
from an .aspx page. :)
We can simply make httphandler for such specific requirements as .aspx are nto specialized for images based
web page which we could make and make things efficient and manipulate response according to our need. If page
is based upon images only and needs to show loads of images thumbnail and such features we can make specific
httpHandler for such pages to customize response and have more command on request.
What kinds of events can an HttpModule subscribe to? What influence can they have on an
implementation? What can be done without recompiling the ASP.NET Application? :)
HTTPModule subscribe to Request life cycle kinds of events like beginRequest,EndRequest,Session, They are
useful to manipulate Request and generate Response according to state and lifecycle. They are separate DLL which
are referred by asp.net application and if we change HTTPModule and recompile it we dont need to recompile our
whole application. So they are plugged like plugins ;)
Describe ways to present an arbitrary endpoint (URL) and route requests to that endpoint to ASP.NET. ;)
I am sure either I interpreted this question in right way but here is the answer according to my understanding
about this question. URL could be define in couple of ways relative path and absolute path and request could be
route in multiple ways using Redirect, Transfer, URL Rewrite
Explain how cookies work. Give an example of Cookie abuse. :)
Cookie stored at client side and readable by any user if its not encrypted, if you stored some important
information about client data at server any other site could read cookies and get that information.
Explain the importance of HttpRequest.ValidateInput()? :)
It checks integrity of data in Request object (Form, Querystring, Cookies), you can prevented by XSS types of
attacks and validate request data to see so there is no malicious input ;)
What kind of data is passed via HTTP Headers? :)
HTTP Header contains information about browser and some of page like browser name, version, page size,
mime type, cookies
Juxtapose the HTTP verbs GET and POST. What is HEAD? :);)
Get is used when we dont need to do manipulation at server side and have nothing really secret information to
send in querystring as it send information through querystring which is limited so input cant be very long like
article :D but its pretty fast as compare to POST as post sends information in hidden fields and preferred in case of
manipulation at server side. Using Head we just send page header information not the actual contents/body.
Name and describe at least a half dozen HTTP Status Codes and what they express to the requesting
client. :)
Very famous I just remember like 404 error page (page not found) 200 for OK, 500 Server not found
How does if-not-modified-since work? How can it be programmatically implemented with ASP.NET?
Explain <@OutputCache%> and the usage of VaryByParam, VaryByHeader. :)
No idea about the if-not-modified thingy but can tell about OutputCache which is directive used for caching
contents and tells server that Header information could be change by VaryByHeader Param and Parameter could
be change in query string using VaryByParam so it get different versions for different header (like browsers) and
parameters respectively.
How does VaryByCustom work? :)
Can output different pages from cache on the basis of change of state of any control or value or object within
that page
How would one implement ASP.NET HTML output caching, caching outgoing versions of pages
generated via all values of q= except where q=5 (as in http://localhost/page.aspx?q=5)? :)
<@OutputCache VaryByParam=q %>

S-ar putea să vă placă și