C# Interview Questions.docx

上传人:b****4 文档编号:12221035 上传时间:2023-04-17 格式:DOCX 页数:14 大小:22.79KB
下载 相关 举报
C# Interview Questions.docx_第1页
第1页 / 共14页
C# Interview Questions.docx_第2页
第2页 / 共14页
C# Interview Questions.docx_第3页
第3页 / 共14页
C# Interview Questions.docx_第4页
第4页 / 共14页
C# Interview Questions.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

C# Interview Questions.docx

《C# Interview Questions.docx》由会员分享,可在线阅读,更多相关《C# Interview Questions.docx(14页珍藏版)》请在冰豆网上搜索。

C# Interview Questions.docx

C#InterviewQuestions

IT公司面试手册提供最全的软件测试类面试题

.net面试题:

C#面试题:

ASP.NET面试题:

更多面试题请访问:

C#InterviewQuestions

Basequestions.

1.ExplainthedifferencesbetweenServer-sideandClient-sidecode?

ANS:

Serversidecodewillexecuteatserverendallthebusinesslogicwillexecuteatserverendwhereasclientsidecodewillexecuteatclientsideatbrowserend.

2.Whattypeofcode(serverorclient)isfoundinaCode-Behindclass?

ANS:

Serverside.

3.Shouldvalidation(didtheuserenterarealdate)occurserver-sideorclient-side?

Why?

ANS:

clientside.thereisnoneedtogotovalidateuserinput.Ifitrelatestodatabasevalidationweneedtovalidateatserverside.

4.Whatdoesthe"EnableViewState"propertydo?

WhywouldIwantitonoroff?

ANS:

ITkeepsthedataofthecontrolduringpostbacks.

ifweturnoffthevaluesshouldnotpopulateduringserverroundtrip.

5.WhatisthedifferencebetweenServer.TransferandResponse.Redirect?

WhywouldIchooseoneovertheother?

ANS:

Server.Trnasferwillpreventroundtrip.itwillredirectpageswhichorinthesamedirectory.NOwaytopassthequerystrings.Thruhttpcontextwecanabletogetthepreviouspagecontrolvalues.

Response.Redirect:

Thereisaroundtriptoprocesstherequest.Wecanredirecttoanypageexternal/internalotherthanaspx.Wecanpassthequerystringthruwhichwecanmanagesessions.

6.Canyougiveanexampleofwhenitwouldbeappropriatetouseawebserviceasopposedtoanon-serviced.NETcomponent

ANS:

WebservicesarebestsuiteforHetrogeniousenvironment.

RemotingisbestsuiteforHomogeniousenvironment.ThesystemsthatunderCLR.

7.Let'ssayIhaveanexistingapplicationwrittenusingVisualStudio6(VB6,InterDev6)andthisapplicationutilizesWindows2000COM+transactionservices.Howwouldyouapproachmigratingthisapplicationto.NET

WeneedtohaveWrappertocommunicateCOMcomponentsin.net.andvisversa

CCW:

ComCallablewrapper.

RCW:

RUNtimecallablewrapper.

8.CanyouexplainthedifferencebetweenanADO.NETDatasetandanADORecordset?

\

ANS:

DIsconnectedarchitechure.Maintainacerelationschemas.MUtilpletablegrouping.

Connectedone.

9.CanyougiveanexampleofwhatmightbebestsuitedtoplaceintheApplication_StartandSession_Startsubroutines?

ANS:

APplication_startneedforglobalvariablewhichareavailableovertheapplication.

Sesssion_Start:

logindependent(userdependent)

10.IfI'mdevelopinganapplicationthatmustaccomodatemultiplesecuritylevelsthoughsecureloginandmyASP.NETwebappplicationisspannedacrossthreeweb-servers(usinground-robbinloadbalancing)whatwouldbethebestapproachtomaintainlogin-instatefortheusers?

ANS:

DatabaseSupport.

orThrustateservice.

11.WhatareASP.NETWebForms?

HowisthistechnologydifferentthanwhatisavailablethoughASP(1.0-3.0)?

ANS:

ASP.Interprepter..usethescriptengine.

ASP.NetCompiled.

12.HowdoesVB.NET/C#achievepolymorphism?

ANS:

Functionoverloading.

Operatoroverloading.

13.Canyouexplainwhatinheritanceisandanexampleofwhenyoumightuseit?

ANS:

Heredity.

Usetheexistingfunctionalityalongwithitsownproperities.

14.HowwouldyouimplementinheritanceusingVB.NET/C#?

ANS:

DerivedClass:

Basecalss

VB.NEt:

DerivedClassInheritsBaseclass

15.Whatsanassembly

ANS:

ABasicunitofexecutablecode>

Whichcontains:

Manifest-Metadata

versioning,Calture,IL,Reference

16.Describethedifferencebetweeninlineandcodebehind-whichisbestinalooselycoupledsolutionTightlycoupled-INLINE

ANS:

inlinefunctionbindatcompiletimecanwriteinaspxpagewithin<%%>.

17.Explainwhatadiffgramis,andagooduseforone

ANS:

isanxmlgrammer.Ittalksaboutstateofnodeinxmlfile.

18.WherewouldyouuseaniHTTPModule,andwhatarethelimitationsofanyapproachyoumighttakeinimplementingone

ANS:

PreprocessingbeforegoingtoIIS.

19.Whatarethedisadvantagesofviewstate/whatarethebenefits

ANS:

ITcanbehacked.pagesizeisheavy.

20.HowwouldyougetASP.NETrunninginApachewebservers-whywouldyouevendothis?

ANS:

----InstallMod_AspDotNet

AddattheendofC:

\ProgramFiles\ApacheGroup\Apache2\conf\httpd.confthefollowinglines

21.WhatsMSIL,andwhyshouldmydevelopersneedanappreciationofitifatall?

ANS:

MicrosoftIntermediatelanguage.whichistheoutputforallthe.netsupportedlanguagesaftercompilationwillproduce.

Appreciationforcrosslanguagesupport.

22.InwhatorderdotheeventsofanASPXpageexecute.Asadeveloperisitimportanttounderstandtheseevents?

ANS:

INIT,PageLoad,Prerender,UNload.

23.WhichmethoddoyouinvokeontheDataAdaptercontroltoloadyourgenerateddatasetwithdata?

Fill()

24.CanyoueditdataintheRepeatercontrol?

NO

25.Whichtemplatemustyouprovide,inordertodisplaydatainaRepeatercontrol?

ITemtemplate

26.HowcanyouprovideanalternatingcolorschemeinaRepeatercontrol?

AlternateItemTemplate

27.Whatpropertymustyouset,andwhatmethodmustyoucallinyourcode,inordertobindthedatafromsomedatasourcetotheRepeatercontrol?

Datasource,

DataBind

28.WhatbaseclassdoallWebFormsinheritfrom?

System.Web.UI.Page

29.Whatmethoddoyouusetoexplicitlykillauserssession?

abondon()

30.Howdoyouturnoffcookiesforonepageinyoursite?

disablecookies.

31.Whichtwopropertiesareoneveryvalidationcontrol?

controltovalidate,errormessage

32.Whattagsdoyouneedtoaddwithintheasp:

datagridtagstobindcolumnsmanually?

autogeneratedcolumnsissettofalse

33.Howdoyoucreateapermanentcookie?

Cooke=newcookie().

cooke.adddate.

34.WhattagdoyouusetoaddahyperlinkcolumntotheDataGrid?

hyperlinkcolumn

35.Whichmethoddoyouusetoredirecttheusertoanotherpagewithoutperformingaroundtriptotheclient?

Server.Transfer

36.WhatisthetransportprotocolyouusetocallaWebserviceSOAP

http

37.TrueorFalse:

AWebservicecanonlybewrittenin.NET

false

38.WhatdoesWSDLstandfor?

webservicediscriptionlanguage.itisusedtogenerateforproxy(serverobject)

39.WhatpropertydoyouhavetosettotellthegridwhichpagetogotowhenusingthePagerobject?

PageIndex.

40.WhereontheInternetwouldyoulookforWebservices?

UDDI

41.Whattagsdoyouneedtoaddwithintheasp:

datagridtagstobindcolumnsmanually.

Autogeneratecolumns

42.WhichpropertyonaComboBoxdoyousetwithacolumnname,priortosettingtheDataSource,todisplaydatainthecombobox?

datatext

datavalue

43.Howisapropertydesignatedasread-only?

get

44.Whichcontrolwouldyouuseifyouneededtomakesurethevaluesintwodifferentcontrolsmatched?

comparefiledvalidator

45.TrueorFalse:

TotestaWebserviceyoumustcreateawindowsapplicationorWebapplicationtoconsumethisservice?

no

46.Howmanyclassescanasingle.NETDLLcontain?

asmanyasuwant..

 

47.Whatisserialization,howitworksin.NET?

TheprimarypurposeofXMLserializationinthe.NETFrameworkistoenabletheconversionofXMLdocumentsandstreamstocommonlanguageruntimeobjectsandviceversa.SerializationofXMLtocommonlanguageruntimeobjectsenablesonetoconvertXMLdocumentsintoaformwheretheyareeasiertoprocessusingconventionalprogramminglanguages.Ontheotherhand,serializationofobjectstoXMLfacilitatespersistingortransportingthestateofsuchobjectsinanopen,standardscompliantandplatformagnosticmanner.

48.HowmanyarraytypesdoesC#provide?

Juggedarray,tablearray,…

GeneralQuestions

1.DoesC#supportmultiple-inheritance?

No. 

2.Whoisaprotectedclass-levelvariableavailableto?

Itisavailabletoanysub-class(aclassinheritingthisclass).

3.Areprivateclass-levelvariablesinherited?

Yes,buttheyarenotaccessible. Althoughtheyarenotvisibleoraccessibleviatheclassinterface,theyareinherited.  

4.Describetheaccessibilitymodifier“protectedinternal”.

Itisavailabletoclassesthatarewithinthesameassemblyandderivedfromthespecified baseclass.  

5.What’sthetop.NETclassthateverythingisderivedfrom?

System.Object.  

6.Whatdoesthetermimmutablemean?

Thedatavaluemaynotbechanged. Note:

Thevariablevaluemaybechanged,buttheoriginalimmutabledatavaluewasdiscardedandanewdatavaluewascreatedinmemory.  

7.What’sthedifferencebetweenSystem.StringandSystem.Text.StringBuilderclasses?

System.Stringisimmutable. System.StringBuilderwasdesignedwiththepurposeofhavingamutablestringwhereavarietyofoperationscanbeperformed.  

8.What’stheadvantageofusingSystem.Text.StringBuilderoverSystem.String?

StringBuilderismoreefficientincaseswherethereisalargeamountofstringmanipulation. Stringsareimmutable,soeachtimeastringischanged, anewinstanceinmemoryiscreated. 

9.CanyoustoremultipledatatypesinSystem.Array?

No.  

10.What’sthedifferencebetweentheSystem.Array.CopyTo()andSystem.Array.Clone()?

TheClone()methodreturnsanewarray(ashallowcopy)objectcontainingalltheelementsintheoriginalarray. TheCopyTo()methodcopiestheelementsintoanotherexistingarray. Bothperformashallowcopy. Ashallowcopymeansthecontents(eacharrayeleme

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 工程科技 > 能源化工

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1