Você está na página 1de 46

1. Steve codes in several .NET languages.

He finds each suited to one type of algorithm or


another. Given the scenario above, within which one of the following does Steve NOT want to
use multiple languages?
a. Within a Windows GUI application
b. Within a .NET console application
c. Within different assemblies in the same application
d. Within a single ASP.NET page
e. Within an XML Web Service
Ans: e
2. Gail wants to compile her VB.NET source code. Given the scenario above, what command
line tool does Gail use?
a. csc.exe
b. vbc.exe
c. vbnet.exe
d. vb.exe
e. cl.exe
Ans: b
3. What kind of pooling offered by COM+ services was lacking in Microsoft Transaction
Server?
a. Object pooling
b. Heap pooling
c. Connection pooling
d. Stack pooling
e. Transaction pooling
Ans: a
4. John is creating a distributed server object that he wants to have execute on the server host and
have distributed clients access through a proxy. Referring to the above scenario, what must John
include in his code?
a. His code must reference the System.Runtime.Remote namespace from the .NET class library.
b. He must make his server object available through port 80 with HTTP protocol.
c. His server class must inherit from MarshalByRefObject.
d. His public server method must be declared static.
e. He should inherit from the base class SoapHeader.
Ans: c
5. Which one of the following is the most granular unit of isolation the Common Language
Runtime (CLR) uses to isolate applications from one another?
a. Method
b. Process
c. AppDomain
d. Class
e. Assembly
Ans: c

6. Which one of the following is the term used to describe the basic unit of deployment and
versioning in the .NET Framework?
a. Managed Module
b. .NET Portable Executable (PE) file
c. AppDomain
d. Assembly
e. Library
Ans: d
7. Which one of the following is NOT a member of a .NET class?
a. fields
b. events
c. methods
d. module
e. properties
Ans: d
8. The Common Language Runtime (CLR) just in time (JIT) compilers compile which item on
an as needed basis?
a. Component
b. Method
c. Assembly
d. Managed Module
e. Class
Ans: b
9. What does the .NET PermView.exe utility do?
a. It persists the view of a Dataset by serializing the view to an XML stream.
b. It sets the permissions on a Dataset view object.
c. It provides an interface to the persistable dynamic assemblies stored on disk.
d. It is used to view the minimal, optional, and refused permission sets requested by an
assembly.
e. It establishes a permanent view of the managed heap.
Ans: d
10. Les wants to select a family of operating systems that are shipped ready to load and run a
.NET Portable Executable file. Given the above scenario, which one of the following Microsoft
operating systems (OSs) should Les select?
a. All Windows OSs in the Win .NET family and above.
b. All Windows OSs in the Win9x, WinNT, and WinXP families and above.
c. All Windows OSs in the WinXP family and above
d. All Windows OSs in the Win2K family and above
e. All Windows OSs in the WinNT, Win2K, and WinXP families and above.
Ans: b
11. What type of application do you use to create a component to be added to an ASP.NET

page?
a. WebForm
b. Web Service
c. Windows Service
d. Windows Application
e. net module
Ans: a
12. Steve wants to use a .NET language that allows native code to be embedded in the .NET PE
file. Given the scenario above, which .NET compiler does Steve select?
a. cl.exe
b. vbc.exe
c. ilasm.exe
d. asm.exe
e. csc.exe
Ans: e
13. Versions can be assigned to which one of the following .NET elements?
a. Class
b. Application
c. Type
d. Method
e. Assembly
Ans: e
14. Which one of the following services provides transactional programming, object pooling, and
role based security?
a. COM/DCOM
b. MTS
c. CLR
d. ADO
e. COM+
Ans: e
15. Which one of the following is NOT true about application domains?
a. Application Domains are normally created by runtime hosts.-true
b. A thread can execute in different application domains of a process, but it is only in one
application domain at any given time.
c. Application Domains exist with processes.
d. Application Domains do not require remoting to communicate since they exist in the same
process.
e. Each application domain in a process shares the same copy of mscorlib.dll by default.
Ans: d
16. Which one of the following compares how garbage collection works in the .NET Framework
between local and distributed objects?

a. They are the same. Since the referenced object exists on the same heap, the garbage collection
mechanism is the same whether the object is local or distributed.
b. They are not the same. Local managed code garbage collection uses a collection mechanism
when the heap does not have room for a newly created reference object. The distributed managed
code garbage collection uses a lease arrangement similar to DHCP leases.
c. They are not the same. Local managed code garbage collection uses a collection mechanism
when the heap does not have room for a newly created reference object. The distributed managed
code garbage collection uses a reference counting mechanism.
d. The method of garbage collection is determined by the programmer at design time by
inheriting from either System.GC.Deterministic or System.GC.NonDeterministic namespace.
e. They are the same. Since the reference object is managed code, the garbage collection is
always deterministic and is invoked by the class destructor or Finalize() method explicitly by the
programmer.
Ans: c
17. From which one of the following locations does the garbage collector remove objects?
a. The global assembly cache
b. The system registry
c. The managed heap
d. The thread stack
e. The download cache
Ans: c
18. Alice wants to write an assembly that can be used by any other developer using any .NET
language. In the scenario above what guidelines should Alice follow?
a. The Common Type System (CTS) requirements for compliance for all classes and members
whether they are private, public, or inherited
b. The Common Language Specification (CLS) requirements for compliance for all classes and
members whether they are private, public, or inherited.
c. The Common Type System (CTS) requirements for compliance for only classes and member
that are exposed externally
d. Alice should write her assembly with a .NET compliant language that will guarantee language
interoperability.
e. The Common Language Specification (CLS) requirements for compliance for only classes and
members that are exposed externally
Ans: e
19. By default, a dynamic assembly is created as which one of the following?
a. .dll
b. .winexe
c. .exe
d. .netmodule
e. console app
Ans: a
20. Which one of the following .NET namespaces is the most similar to the Microsoft

Foundation Classes (MFC)?


a. System.Web.Services
b. System.Windows.Forms
c. System.MFC
d. System.EnterpriseServices
e. System.Web.UI
Ans: b
21. Randy wants to use a type that can be serialized to a stream and stored in metadata so that it
can deserialized at runtime. Given the scenario above, which one of the following does Randy
use?
a, Custom Attribute
b. Assembly
c. Value Type
d. Reference Type
e. Managed Module
Ans: b
22. How does .NET Framework alleviate DLL Hell?
a. The Common Language Runtime (CLR) only allows a single version of a component to be
registered in the Global Assembly Cache (GAC).
b. The Common Language Runtime (CLR) and Assemblies can only use the version of a
component with which they were compiled.
c. The identity and state of all managed code is maintained in the system registry at runtime.
d. The Common Language Runtime (CLR) and Assemblies specify and enforce versioning rules
and allow side-by-side execution of a software component.
e. The Common Language Runtime (CLR) does not allow administrators to change the version
of a component that an Assembly references externally
Ans: d
23. Steve wants to select an OS that has the .NET Common Language Runtime natively
installed. Given the scenario above, which one of the following operating systems does Steve
select?
a. Windows XP
b. Windows 9x
c. Windows .NET
d. Windows 2000
e. Windows NT 4.0
Ans: a

24. Which one of the following statements is true about MSIL binary code?
a. It is only stored in assembly resource files.
b. It is only found in static assemblies.
c. It is compiled to native code by JIT compilers.

d. It is architecture specific.
e. It is source code specific.
Ans: c
25. Public methods whose names differ only by case are examples of which of the following
types?
a. CLS compliant but not CTS compliant
b. CTS and CLS compliant
c. Only CLI compliant
d. Neither CTS nor CLS compliant
e. CTS compliant but not CLS compliant
Ans: d
26. When does the JIT compiler compile a method?
a. When the developer packages the application
b. When the application loads
c. When the application is installed
d. Each time it is called
e. The first time it is called
Ans: e
27. In the Virtual Execution Engine of the Common Language Runtime, which operation occurs
first?
a. JIT
b. Verify
c. Exception management
d. Class Load
e. Garbage collection
Ans: d
28. John wants to install assemblies into the global assembly cache (GAC), remove them from
the GAC, and list the contents of the GAC. Given the above scenario, what .NET SDK utility
should John use?
a. gacutil.exe
b. soapsuds.exe
c. reggac.exe
d. regasm.exe
e. edtgac.exe
Ans: a
29. Which one of the following statements is true regarding how the .NET Framework minimizes
DLL Hell?
a. It registers all assemblies with the Global Assembly Cache (GAC).
b. It enforces that only one component of a given name can run on a machine at a time.
c. It only allows multiple versions of a given component to run on a machine at a time if they all
are private assemblies.

d. It allows Side-by-Side execution on the same machine, at the same time or even the same
process, of any version of the same shared DLL.
e. It registers all assemblies with the COM+ catalog.
Ans: d
30. The .NET Portable Executable (PE) file differs from the standard Windows PE file in which
one of the following ways?
a. The .NET PE removes the IL code section.
b. The .NET PE removes the metadata section.
c. The .NET PE adds native code section.
d. The .NET PE adds the CLR header and the CLR data sections.
e. The .NET PE does not include the PE/COFF headers
Ans: d
31. Mary wants to create a .NET proxy component for a legacy COM component so that her
.NET components can use it. Given the scenario above, what tool does Mary use?
a. comproxy.exe
b.proxy.exe
c. al.exe
d. tlbimp.exe
e. tlbexp.exe
Ans: d
32. VB.NET
<Assembly:AssemblyCultureAttribute("de")
C#
[assembly:AssemblyCultureAttribute("de")
Given the code sample above, what type of assembly does the code create?
a. Strongly named
b. Static
c. All private assemblies
d. Dynamic
e. Satellite
Ans: e
33. The benefit of ADO.NET being able to communicate across heterogeneous environments is a
result of which one of the following?
a. The data and protocol are designed by the client and server on a case by case basis.
b. The protocol is based on TCP Sockets.
c. The data is delivered Network Data Representation (NDR).
d. The protocol is COM/DCOM based.
e. The data is delivered in XML format.
Ans: e
34. Jill wants to generate a public/private key pair for use in creating a shared assembly.
Given the above scenario, which one of the following .NET SDK utilities does Jill use?

a. resgen.exe
b. certmgr.exe
c. secutil.exe
d. sn.exe
e. gacutil.exe
Ans: d
35. The .NET Framework provides infrastructure and base class libraries for programming many
different types of applications. One type of application it provides for allows remote applications
to easily communicate over HTTP through Port 80 on corporate firewalls, using industry
standard XML. Referring to the scenario above, to which one of the following .NET Framework
technologies is this referring?
a. .NET Web Services
b. .NET Console Applications
c. .NET Windows Services
d. .NET Windows Forms Applications
Ans : a
36. Karin wants to deploy a .NET application in such a manner that its assemblies are NOT made
available to other .NET applications through the Global Assembly Cache (GAC).
a. In the above scenario, which one of the following assembly types does Karin deploy?
b. A dynamic assembly
c. A public assembly
d. A private assembly
e. A global assembly
Ans: d
37. Which one of the following statements is true with regard to releasing memory from objects
that are no longer used or have gone out of scope?
a. The .NET Framework releases the memory used by managed objects through a Just-In-Time
(JIT) compilation process.
b. The memory used by managed objects is released when the reference count reaches -1.
c. The .NET Framework releases the memory used by managed objects through a Garbage
Collection (GC) process.
d. The memory used by managed objects is released when the reference count reaches 0.
Ans: c
38. You are creating a .NET Windows Forms application, and you need to connect to a
Microsoft Access database. Given the scenario above, which one of the following data
namespaces do you use for creating your data access connection?
a. System.Data.OleDb
b. System.Data.OracleClient
c. System.Data.SQLClientCE
d. System.Data.SqlClient
e. System.Data
Ans: a

39. The <authorization> and <authentication> elements for a Web site are stored within which
one of the following Web.Config elements?
a. <system.web>
b. <compilation>
c. <globalization>
d. <appsettings>
e. <trace>
Ans: a
40. Mindy wants to use a .NET language that does NOT compile managed code by default.
Given the scenario above, which one of the following languages does Mindy use?
a. J#
b. C#
c. Visual Basic .NET
d. Visual C++ with managed extensions
e. JScript .NET
Ans: a
41. public class Invoice : InvoiceBase, IData
{
}
Referring to the C# class definition in the sample above, which one of the following statements
is true about this class inheritance hierarchy?
a. The Invoice class implements multiple inheritance by inheriting from the InvoiceBase class
and the IData interface.mc
b. The Invoice class inherits from the InvoiceBase class and implements the IData interface.
c. The Invoice class is a super-class to the InvoiceBase class and IData interface.
d. The InvoiceBase class inherits from the Invoice class and the IData interface inherits from the
InvoiceBase class.
e. The Invoice class is a partial class, along with the InvoiceBase class.
Ans: b
42. Which one of the following statements must be true for the Common Language Runtime to
be able to completely isolate assemblies from each other?
a. All source code must be written in C# or VB.NET.
b. All MSIL code must have been run through an obfuscator.
c. All code must be written in the same .NET language.
d. All code must include XML comments on each public class member.
e. All code must be type-safe.
Ans: e
43. Which one of the following is the most granular unit that the Common Language Runtime
(CLR) uses to isolate applications from one another, preventing code from one application
accessing code in another application for security purposes?
a. Assembly

b. Thread
c. AppDomain
d. Process
e. Global Assembly Cache (GAC)
Ans: c
44. John has created a database connection inside one of his managed code objects. He wants to
ensure that assemblies calling his managed object have the ability to release this unmanaged
resource as soon as possible. Referring to the scenario above, what is the best way for John to
accomplish this while minimizing the amount of time that John's managed code object has the
database connection referenced?
a. Let automatic garbage collection clean up the unmanaged resource.
b. Create a finalize method and let the garbage collector execute it at collection time.
c. Unload the application domain that contains the resource.
d. Create a Dispose method and call it explicitly when he wants to release the resource.
e. Call the System.GC.Collect method.
Ans: d
45. Sample Web.Config
configSections>
<sectionGroup name="system.web">
<section name="myConfig" type="MyConfig.MyConfigSectionHandler,MyConfig" />
</sectionGroup>
</configSections>
Referring to the portion of the sample Web.Config file above, to which one of the following does
the type="MyConfig.MyConfigSectionHandler,MyConfig" line refer?
a. It specifies that the MyConfig.MyConfigSectionHandler class in the MyConfig assembly
should be used to parse this custom section, and as such, it must implement the
IConfigurationSectionHandler interface.
/* here the section type is of the form namespace.classname , assemblyname. Since the class is
resided in a separate assembly. If the handler class appears in the app_code then the type value
takes up the class name*/
b. It specifies that the MyConfig class in the MyConfigSectionHandler assembly should be used
to parse this custom section, and as such, it must implement the IConfigurationSectionHandler
interface.
c. This line specifies that the MyConfig.MyConfigSectionHandler assembly should be used to
parse this custom section, and as such must implement the IConfigurationSectionHandler
interface.
d. It specifies that the MyConfig.MyConfigSectionHandler class in the MyConfig assembly must
be installed in the GAC (Global Assembly Cache).
e. It specifies that this custom section is named MyConfig.MyConfigSectionHandler.
Ans: a

46. The .NET implementation of Delegates uses which one of the following sets of information
as the Delegate signature?
a. Method name only
b. Method input parameters and name only
c. Method input parameters and return type only
d. Method input parameters only
e. Method return type only
Ans: c
47. You are creating a .NET Windows Forms application named MyGreatApp.exe that uses an
application configuration file for startup information. Referring to the scenario above, what must
your application configuration file be named once you have compiled and deployed your
application?
a. MyGreatApp.config
b. MyGreatApp.xml
c. App.xml
d. App.Config
e. MyGreatApp.exe.config
Ans: e
48. Value types always have which one of the following modifiers?
a. Abstract
b. InitOnly
c. Sealed
d. Virtual
e. Static
Ans: c
49. CompareOp localCompareOp = new CompareOp(Currency.RhsIsGreater);
Sorter.Sort(numbers, localCompareOp);
Referring to the sample code above, assume CompareOp is a delegate. Looking specifically at
the second line of code, the delegate is being used to implement which one of the following types
of programming constructs?
a. Multi-cast delegate
b. Asynchronous delegate
c. Local delegate
d. Callback function
e. EventHandler
Ans: e

50. Bill owns a large software company. He is releasing a service pack containing an assembly
that fixes some bugs and is intended to be backward compatible with the previous version of the
assembly. Given the scenario above, what does Bill ship with his new assembly?
a. An XML application configuration file
b. An XML machine configuration file

c. A publisher policy file


d. A new version of the calling assemblies that are compiled with references to the new assembly
e. A readme.txt document
Ans: c
51. The application domain that an ASP.NET application runs under uses which one of the
following trust levels by default?
a. Full
b. High
c. Medium
d. Low
e. Minimal
Ans: a

52. Which one of the following .NET keywords or operators triggers the C# or VB.NET
compiler to generate two methods in the background that are used to manage the underlying
delegate?
a. += operator
b. EventArgs keyword
c. EventHandler keyword
d. Event keyword
e. -= operator
Ans: c
53. Linda has registered a strongly named assembly in the Global Assembly Cache with a higher
version number than one that already has been registered. Given the scenario above, which one
of the following statements is true regarding the side-by-side execution of her assembly?
a. The two assemblies can run at the same time and in the same process.
b. The two assemblies cannot run at the same time, but either one can run at any one time.
c. The two assemblies can run at the same time, but only in different processes.
d. The two assemblies can run at the same time only if they are both registered against the
COM+ catalog.
e. The two assemblies can run at the same time, but they must be in the same process.
Ans: a
54. Which one of the following .NET Framework namespaces do you use to implement the runtime and design-time behavior of controls such as user controls derived from
System.Windows.Forms.UserControl?
a. System.EnterpriseServices
b. System.Web.UI
c. System.Web
d. System.Windows
e. System.ComponentModel
Ans: e

55. You are writing an application that is initially designed to use an Oracle database. You know
that there is a good chance that your company will be changing their corporate standard database
platform to Microsoft SQL Server in the near future. You are concerned that your application
needs to function with a minimum of changes if the database platform ever changes from Oracle
to SQL Server. Given the scenario above, how do you declare your DataReader objects to
minimize the impact of a change to the database platform in the future?
a. 'VB.NET
Dim myReader As IDataReader = myCommand.ExecuteReader()
'C#
IDataReader myReader = myCommand.ExecuteReader();
b. 'VB.NET
Dim myReader As OleDbDataReader = myCommand.ExecuteReader()
'C#
OleDbDataReader myReader = myCommand.ExecuteReader();
c. 'VB.NET
Dim myReader As SQLDataReader = myCommand.ExecuteReader()
'C#
SQLDataReader myReader = myCommand.ExecuteReader();
d. 'VB.NET
Dim myReader As OracleDataReader = myCommand.ExecuteReader()
'C#
OracleDataReader myReader = myCommand.ExecuteReader();
e. 'VB.NET
Dim myReader As OdbcDataReader = myCommand.ExecuteReader()
'C#
OdbcDataReader myReader = myCommand.ExecuteReader();
Ans: b
56. Sally is a managed type library developer. She wants to ensure that her library can be used by
all the .NET languages. Given the scenario above, which one of the following rules does Sally
follow?
a. Just In Time (JIT)
b. Common Type System (CTS)
c. Common Language Runtime (CLR)
d. Extensible Markup Language (XML)
e. Common Language Specification (CLS)
Ans: e
57. You are creating an ASP.NET application. You decide to use RegEx string matching objects
to help protect against Cross Site Scripting attacks. Given the scenario above, this is an example
of which one of the following security areas that should be considered when creating an
ASP.NET application?
a. Securing database connection credentials
b. Code access security
c. Securing state data
d. Securing user input

e. Securing exception handling


Ans: d
58. Linda is connecting and disconnecting ADO.NET connections with each of the many queries
in her application. Linda is using Microsoft SQL Server 2005 as her database server.Given the
scenario above, which one of the following describes the effect of Linda's approach?
a. This has a negative effect on performance and positive effects on scalability because the cost
of building and tearing down connections is too high, and generally making and breaking
connections is more scalable than holding them.
b. This has a positive effect on performance and a negative effect on scalability because the cost
of making and breaking connections is mitigated by ADO.NET connection pooling and generally
making and breaking connections is less scalable than holding them.
c. Since the ADO.NET connection is a managed heap reference object, even though Linda tears
down her connections, the connections are not released until Linda calls Dispose() or until
automatic garbage collection occurs.
d. This has a neutral effect on performance and a positive effect on scalability because the cost of
the ADO.NET connections is mitigated by ADO.NET connection pooling and generally making
and breaking connections is more scalable than holding them.
e. This has a negative effect on performance and scalability because the cost of building and
tearing down connections is too high for a single query, and holding connections is generally
more scalable than releasing them.
Ans: b
59. Which one of the following is NOT a valid ThreadState?
a. Unstarted
b. Background
c. Suspended
d. Terminated
e. Running
Ans: d
60. Which one of the following determines where a type is stored?
a. All types larger than 64 bits are stored on the stack.
b. All types are stored on the stack.
c. The Common Language Runtime (CLR) determines whether a type is stored on the stack or
heap based on space availability.
d. All types are stored on the heap.
e. If the type is a reference type, it is stored on the managed heap. A value type is stored on the
stack.
Ans: e
61. Which one of the following namespaces of the .NET Framework do you use to create
metadata dynamically at runtime?
a. System.AppDomainSetup
b. System.Management
c. System.Reflection.Emit

d. System.Activator
e. System.Runtime
Ans: c
62. Which one of the following explains how .NET Framework alleviates DLL Hell?
a. The Common Language Runtime (CLR) and Assemblies can only use the version of a
component with which they were compiled.
b. The Common Language Runtime (CLR) does not allow administrators to change the version
of a component that an Assembly references externally.
c. The identity and state of all managed code is maintained in the system registry at runtime.
d. The Common Language Runtime (CLR) only allows a single version of a component to be
registered in the Global Assembly Cache (GAC).
e. The Common Language Runtime (CLR) and Assemblies specify and enforce versioning rules
and allow side-by-side execution of a software component.
Ans: e
63. When is a reference type released?
a. When the developer explicitly invokes its Finalize method
b. When the developer explicitly invokes its Dispose method
c. When the reference counter reaches 0
d. When the developer explicitly sets its value to nothing and the garbage collector moves the
object to generation zero
e. When the garbage collector finds that no roots reference it during a collection
Ans: e
64. Joan registers a strongly named assembly in the Global Assembly Cache (GAC). She does
this so that a hash is performed on the assembly file containing the manifest with the public key,
and she verifies it against the hash of the manifest created with the private key at build time.
Given the scenario above, when is this comparison performed?
a. Each time the Common Language Runtime (CLR) loads the assembly
b. Each time a runtime host loads the Common Language Runtime (CLR)
c. When the assembly is registered with the GAC
d. When the sn.exe program is executed
e. When the JIT compiler in the Common Language Runtime (CLR) compiles the assembly
Ans: c
65. Which one of the following public methods of a delegate is new in .NET 2.0?
a. Invoke()
b. BeginInvoke()
c. InvokeMethod()
d. EndInvoke()
e. DynamicInvoke()
Ans: e

66. Brian has a custom business object model. He needs to instantiate a strongly typed collection
of one of his domain objects. In which one of the following namespaces does Brian find classes
suited to the task described in the scenario above?
a. System.Collections.Specialized
b. System.Collections
c. System.Data
d. System.Collections.StrongTyping
e. System.Collections.Generic
Ans: b
67. In order to create a custom role based security mechanism, which one of the following
interfaces do you implement?
a. ISecurityToken
b. IRoleProvider
c. IPrinciple
d. IIdentity
e. IUser
Ans: c
68. Steve wants to create a .NET application that is accessible over HTTP, offers its payload in
XML, and is accessible programmatically. Given the scenario above, what type of application
does Steve create?
a. Windows console application
b. Web Service
c. Windows Service
d. Windows GUI application
e. Distributed COM
Ans: b
69. When enumerating over a Dictionary<T, K>, which one of the following types of objects
does the enumerator return?
a. DictionaryEntry<T, K>
b. IEnumerable<K>
c. KeyValuePair<T, K>
d. LookupEntry<T, K>
e. You cannot enumerate a Dictionary<T, K>.
Ans: c
70. Which one of the following is NOT true concerning exceptions?
a. Throwing an exception is a costly operation.
b. All exceptions have an InnerException property.
c. Exceptions should be used to handle basic program flow.
d. You can obtain a stack trace from an exception.
e. All exceptions ultimately inherit from Exception.
Ans: c

71. Steve wants to view the underlying object type of an integer in the .NET Framework class
library. Given the scenario above, in which one of the following namespaces does Steve look?
a. System
b. System.Runtime
c. System.Data
d. Microsoft.Win32
e. System.Reflection
Ans: a
72. While the DateTime type has a variety of ways of displaying the date as a string, which one
of the following is NOT a valid display option?
a. DateTime.ToDateString()
b. DateTime.ToString("dddd MMMM %d yyyy")
c. DateTime.ToLongDateString()
d. DateTime.ToShortDateString()
e. DateTime.ToString("D")
Ans a
73. Gail wants to compile her Visual Basic .NET source code. Given the scenario above, which
one of the following command-line tools does Gail use?
a. vbnet.exe
b. cl.exe
c. vbc.exe
d. vb.exe
e. csc.exe
Ans: c
74. How do you deterministically release unmanaged resources held by a reference object?
a. Use a destructor.
b. Let the garbage collector release the resources automatically. (non deterministically)
c. Use a Finalize method.
d. Use the Release method
e. Use a Dispose method.
Ans: a
75. The Common Language Runtime (CLR) is very efficient for creating objects on the managed
heap for which one of the following reasons?
a. It uses a pointer to the next object location that is incremented by the size of the last object.
b. It uses linked lists to manage objects.
c. It uses a First-In-First-Out (FIFO) stack of typed pointers to manage heap objects.
d. It uses a round robin queue that has three generations.
e. It uses directed graphs to manage objects consisting of only reachable objects.
Ans: e

76. Linda has registered a strongly named assembly in the Global Assembly Cache with a higher
version number than one that already has been registered. Given the scenario above, which one
of the following statements is true regarding the side-by-side execution of Linda's assembly?
a. The two assemblies can run at the same time, but only in different processes.
b. The two assemblies can run at the same time only if they are both registered against the
COM+ catalog.
c. The two assemblies cannot run at the same time, but either one can run at any one time.
d. The two assemblies can run at the same time, but they must be in the same process.
e. The two assemblies can run at the same time, but they must be in the same application domain.
Ans: d
77. The .NET Framework provides infrastructure and base class libraries for programming many
different types of applications. One type of application it provides for allows remote applications
to easily communicate over HTTP through Port 80 on corporate firewalls, using industry
standard XML. Referring to the scenario above, to which one of the following .NET Framework
technologies is this referring?
a. .NET Remoting
b. .NET Windows Forms Applications
c. .NET Web Services
d. .NET Console Applications
e. .NET Windows Services
Ans: c
78. You are trying to deploy your .NET web application to a production server. You know that
the .NET Framework is installed, but the Web site does not seem to have a reference to the .NET
Framework ISAPI .dll for .aspx pages in the configuration section of the Web site. Given the
scenario above, which one of the following .NET Framework tools do you use to register the
Web site with the .NET Framework and make the appropriate metabase entries?
a. GacUtil.exe
b. Aspnet_regiis.exe
c. NGen.exe
d. Xsd.exe
e. InstallUtil.exe
Ans: b
79. Judy wants to read a very large XML document. In order to access the data, she wants to use
a fast, noncached, forward-only stream. Given the above scenario, which class from the
System.Xml namespace does Judy use?
a. XmlText
b. XmlElement
c. XmlTextWriter
d. XmlTextReader
e. XmlDocument
Ans: d

80. .NET Framework configuration files are physically stored in which one of the following
formats?
a. A digitally signed XML file
b. A .INI file
c. An XML file
d. An encrypted .INI file
e. A Binary file
Ans: c
81. Your programming requirements dictate the use of a hash algorithm and you decide to use
the MD5 hash algorithm. Referring to the scenario above, the abstract MD5 hash class is a
member of which one of the following namespaces?
a. System.Security.Cryptography
b. System.Xml
c. System.Text.Encoding
d. System.Security.Policy
e. System.Security.SecurityElement
Ans: a
82. From which one of the following locations does the garbage collector remove objects?
a. The download cache
b. The system registry
c. The global assembly cache
d. The managed heap
e. The thread stack
Ans: d
83. Which one of the following types is a value type?
a. Pointer
b. Delegate
c. Object
d. Array
e. Int32
Ans: e
84. Carl has been given the task of creating a Windows desktop application with the .NET
Framework. Given the scenario above, which one of the following namespaces does Carl use
most frequently while developing this application?
a. System.Net
b. System.Web.UI
c. System.Web.Services
d. System.Windows.Forms
e. Microsoft.Win32
Ans: d
85. Versions can be assigned to which one of the following .NET elements?

a. Attribute
b. Method
c. Assembly
d. Class
e. Type
Ans: c
86. You are creating a .NET Windows Forms application, and you need to connect to a
Microsoft Access database. Given the scenario above, which one of the following data
namespaces do you use for creating your data access connection?
a. System.Data
b. System.Data.SQLClientCE
c. System.Data.OracleClient
d. System.Data.SqlClient
e. System.Data.OleDb
Ans: e
87. The .NET framework fully supports inheritance, polymorphism, and constructors. Referring
to the statement above, the .NET framework fully supports which one of the following
programming paradigms?
a. Native machine code compilation
b. Unmanaged memory
c. Single language support
d. Variant data types
e. Object oriented programming
Ans: e
88.All .NET Framework managed code runs within which one of the following?
a. VBC.exe (VB.NET Compiler)
b. Just-In-Time Compilation (JIT)
c. Internet Explorer acting as a .NET managed code host
d. CSC.exe (C# Compiler)
e. Common Language Run-time (CLR)
Ans: e
89. Steve wants to create a .NET application that is accessible over HTTP, offers its payload in
XML, and is accessible programmatically. Given the scenario above, which one of the following
application types is best suited for the business logic tier residing on the application server?
a. Windows console application
b. Windows Service
c. Windows GUI application
d. Web Service
e. Distributed COM
Ans: d

90. Which one of the following .NET Framework languages is new and provides constructs and
syntax similar to Java and C++, in addition to some unique new constructs?
a. C#
b. VB.NET
c. Fortran .NET
d. MSIL
e. COBOL .NET
Ans: a
91. Which one of the following features of the .NET Framework plays the most integral role in
allowing language interoperability?
a. Managed memory
b. Support for implementation inheritance
c. Garbage Collection (GC)
d. Just-In-Time compilation (JIT)
e. Common Type System (CTS)
Ans: e
92. By default, a dynamic assembly is created as which one of the following?
a. .com
b. .bat
c. .dll
d. .exe
e. .netmodule
Ans: c
93. Which one of the following terms do you use to describe the fundamental unit of deployment
and versioning in the .NET Framework?
a. .NET Portable Executable (PE) file
b. AppDomain
c. .DLL
d. Assembly
e. Managed Module
Ans: d
94. .NET events actually use which one of the following underlying .NET technologies to wire
the event to the event handler?
a. Pointers
b. Remoting
c. Reflection
d. Exceptions
e. Delegates
Ans: e
95. What is the default value for a System.Int32 variable?
a. NULL

b. NOTHING
c. System.Object
d. 0
e. -1
Ans: d
96. ADO.NET is able to communicate across heterogeneous environments. The benefit of the
above referenced statement is a result of which one of the following?
a. The data and protocol are designed by the client and server on a case-by-case basis.
b. The data is delivered as a Network Data Representation (NDR).
c. The protocol is based on TCP sockets.
d. The data is serialized in XML format.
e. The protocol is COM/DCOM based.
Ans: d
97. Which one of the following .NET technologies is best used to communicate or pass objects
between application domains?
a. ByVal objects
b. .NET C++ code using managed extensions only
c. .NET Remoting
d. .NET Arrays
e. COM objects
Ans: c
98. Randy wants to be able to assign an instance of a derived type to a variable of its parent type.
He wants the derived types to have different functionality in identically named methods. Given
the above scenario, of which one of the following object oriented concepts implemented in the
.NET framework is this an example?
a. Encapsulation
b. Hierarchical
c. Polymorphism
d. Object-Oriented
e. Inheritance
Ans: c
99. Which one of the following tools is used to view the metadata information contained in a
.NET assembly?
a. ilasm.exe
b. ildasm.exe
c. al.exe
d. vbc.exe
e. csc.exe
Ans: b

100. You are working on a routine that requires a very large number of string concatenations.
You are concerned about the performance of the routine. Given the scenario above, which one of
the following .NET Framework members do you use when programming your routine?
a. The language specific concatenation operator: & for VB.NET and + for C#
b. System.String.Format()
c. System.Text.Encoding
d. System.Text.StringBuilder
e. System.String.Concat()
Ans: d
101. Which one of the following is a benefit of a reference type?
a. It does not require garbage collection.
b. It does not make copies of itself when passed as a parameter.
c. It takes less machine cycles to manage than a value type.
d. It is usually smaller than a value type.
e. It is never null.
Ans: b
102. You are creating an assembly containing financial calculations that you intend to share
across several projects. During deployment, you want your assembly to be installed in the Global
Assembly Cache (GAC). Given the scenario above, which one of the following statements is
true?
a. Your assembly must be culture-neutral.
b. Your assembly must be verifiably type-safe.
c. Your assembly must be strongly named.
d. Your assembly must have an explicit version number with no asterisks(*) in any component of
the version number.
e. Your assembly must be given an eight-character name.
Ans: c
103. Which one of the following statements is true about reference types?
a. They are stored on the stack.
b. They always pass a copy of themselves in a method.
c. They cannot be used as output parameters in a method.
d. They can never be null.
e. They are allocated on the managed heap.
Ans: e
104. Which one of the following .NET Framework base namespaces do you use to interact with
the GDI+ subsystem of the Microsoft Windows XP operating system?
a. System.XML
b. System.Drawing
c. System.IO
d. System.Data
e. System.Text
Ans: b

105. Which one of the following is true about boxing?


a. It applies to the packaging of assemblies.
b. It applies to wrapping a COM object in a Runtime Callable Wrapper (RCW).
c. It applies to converting a reference type to a value type.
d. It applies to converting a value type to a reference type.
e. It applies to encapsulating fields as properties in methods.
Ans: d
106. Which one of the following ADO.NET command class methods executes a query and
returns the first column of the first row in the resultset returned by the query?
a. .ExecuteMessage()
b. .ExecuteScalar()
c. .ExecuteReader()
d. .ExecuteAssembly()
e. .ExecuteNonQuery()
Ans: b
107. An assembly version number consists of how many parts?
a. 1
b. 2
c. 3
d. 4
e. 5
Ans: d
108. Which one of the following is NOT a .NET reference type?
a. Class
b. Array
c. Structure
d. Delegate
e. Interface
Ans: c
109. The memory allocated to a reference type is always released in which one of the following
ways?
a. It is released when the developer explicitly invokes its Dispose method.
b. It is destroyed when the reference counter reaches 0.
c. It is released when the garbage collector finds that no roots reference it during a collection.
d. It is released when the developer explicitly invokes its Finalize method.
e. It is released when the developer explicitly sets its value to nothing.
Ans: c
110. Which one of the following file types contains debugging and project state information for
your application and must be present in the /bin folder before you can attach a debugger to the
process?

a. .pdb
b. .xml
c. .src
d. .dll
e. .exe
Ans: a
111. Which one of the following .NET types is like a class, can contain constructors, constants,
fields, methods, properties, indexers, and operators, but does NOT support inheritance and is
actually a value type, not a reference type?
a. Array
b. Object
c. Structure
d. Delegate
e. Interface
Ans: c
112. A string is which kind of object?
a. Global
b. Attribute
c. Reference
d. Delegate
e. Value
Ans: c
113. Which one of the following statements about the .NET Framework is true?
a. When installing the .NET Framework, any prior version of the .NET Framework found is
automatically upgraded to the installation version, guaranteeing backwards compatibility.
b. When installing the .NET Framework, Windows 95 computers require an account with
Administrator privileges to successfully complete the Framework installation.
c. When installing the .NET Framework, the X-COPY deployment feature of .NET provides you
with the ability to copy/paste the C:\WINDOWS\Microsoft.NET\Framework\ folder from one
computer to the next for installation.
d. When installing the .NET Framework, previously installed versions is left intact; the .NET
Framework provides for multiple versions to be installed on the same computer.
e. When installing the .NET Framework, only Microsoft Windows Server products allow
multiple versions to be installed concurrently.
Ans: d
114. Which one of the following types is a reference type?
a. enum
b. struct
c. int
d. float
e. Array
Ans: e

115. Randy wants to use a type that provides call-back capabilities for events. Given the scenario
above, which one of the following types does Randy use to provide the call-back?
a. Context
b. Pointer
c. Transaction
d. Delegate
e. Attribute
Ans: d
116. Which one of the following gives the developer the most control over immediately releasing
resources?
a. The Finalize method
b. The class loader
c. The Just-In-Time (JIT) compiler
d. The garbage collector
e. The Dispose method
Ans: e
117. Which one of the following .NET Class members provides functionality similar to a
Property but provides a parameter for accessing specific member instances?
a. Events
b. Accessors
c. Operators
d. Structures
e. Indexers
Ans: e
118.. Referring to the .NET 1.1 Configuration Tool in the image above, which one of the
following types of security do you configure using this tool?
a. Role Based Security
b. Programmatic Security
c. Declarative Security
d. Code Access Security
e. User Input Security
Ans: d
119. Which one of the following .NET framework members or methodologies do you use to
extend your assemblies' meta-data with custom application information?
a. Compile with the /reference option
b. System.Reflection.Assembly namespace members
c. Attributes
d. Use the MSIL Disassembler (Ildasm.exe) tool
e. XML comments
Ans: c

120. When using a multicast delegate, which one of the following statements is true?
a. The .BeginInvoke() method must be used to explicitly call the contained method.
b. A delegate cannot be used to wrap multiple method targets.
c. The delegate must be declared as public.
d. The delegate signature must return a void.
e. The delegate must be declared as private.
Ans: d
121. Which one of the following statements is true with respect to the Common Language
Runtime (CLR)?
a. The C# and VB.NET compilers compile source code to native code.
b. All .NET languages that use the CLR produce only CLS (Common Language Specification)
compliant code.
c. Code compiled in one .NET language can interact with code compiled in a different .NET
language.
d. The Common Language Run-time compiles source code to MSIL code.
e. The CLR does NOT implement a Common Type System.
Ans: c
122. You are working on a procedure that needs access to some Integer data. You decide to
declare some variables to work with this Integer data. Referring to the scenario above, why do
you declare your variables as a simple type (Int32) rather than the Object super-type?
a. Use of the Object type allows the compiler to optimize the MSIL it produces.
b. Use of the Object type is less efficient than a native type because it is always late bound.
c. Use of the Object type is equal in efficiency to the use of a native type, but may use more
memory.
d. Use of the Object type forces all data to be stored on the Stack.
e. The Object type does support the .Equals() method for equality comparisons.
Ans: b
123. The PEVerify tool is used to determine which one of the following?
a. If the specified MSIL code is type-safe
b. If the specified MSIL code is verifiably type-safe
c. If the specified C# code only is verifiably type-safe
d. If the specified native code is verifiably type-safe
e. If the specified source code is type-safe
Ans: b
124. You need to create an application that can be rendered to a variety of devices using different
user interface technologies, including HTML, compact HTML (cHTML), and WML. Given the
scenario above, which one of the following .NET application types was specifically created to
best handle this?
a. .NET Smart Device Application
b. .NET Windows Application
c. .NET Console Application
d. ASP.NET Mobile Web Application

e. ASP.NET Web Application


Ans: d
125. Which one of the following statements is true regarding Microsoft Visual C++ and the
.NET Framework?
a. Microsoft Visual C++ cannot generate .NET managed code.
b. Microsoft Visual C++ code can only be used to generate MFC applications.
c. Microsoft Visual C++ can only generate native code.
d. Microsoft Visual C++ cannot generate .NET type-safe managed code.
e. Microsoft Visual C++ cannot generate .NET verifiably type-safe managed code.
Ans: e
126. Microsoft highly recommends that you use the .NET Framework Configuration tool
(Mscorcfg.msc) or the Policy tool (Caspol.exe) when making configuration changes to which
one of the following configuration file types?
a. Security Configuration Files
b. Application Configuration Files
c. Web.config Configuration Files
d. Machine.config Configuration Files
e. Custom Configuration Files
Ans: a
127. You need to expose a .NET assembly to some legacy COM based applications. In doing so,
you know you need to use the RegAsm.exe utility. Referring to the scenario above, which one of
the following functions does the RegAsm.exe .NET Framework utility serve in allowing .NET
code to be accessed by COM clients?
a. The RegAsm.exe tool reads the metadata within an assembly and adds the necessary entries to
the registry.
b. .NET assemblies cannot be called from COM components.
c. The RegAsm.exe tool reads the metadata within an assembly and scans the computer,
registering the .NET assembly with all installed COM objects.
d. The RegAsm.exe tool reads the metadata within an assembly and creates the Runtime Callable
Wrapper (RCW) at that time.
e. The RegAsm.exe tool reads the metadata within an assembly and creates the COM Callable
Wrapper (CCW) at that time.
Ans: a
128. You are creating a .NET Windows Forms application named MyGreatApp.exe that uses an
application configuration file for startup information. Referring to the scenario above, what must
your application configuration file be named once you have compiled and deployed your
application?
a. MyGreatApp.xml
b. App.xml
c. App.Config
d. MyGreatApp.config
e. MyGreatApp.exe.config

Ans: e
129. An ADO.NET Transaction is created on which one of the following ADO.NET objects?
a. DataAdapter
b. Dataset
c. DataReader
d. Command
e. Connection
Ans: e
130. By implementing Code Access Security in their code, the developer can achieve which one
of the following objectives?
a. Ensure that the client machine administrator cannot specify the rights an assembly may have.
b. Ensure that only users with the proper roles can access the assembly.
c. Enable the assembly to receive whatever rights it may require on any target client.
d. Enable code to demand that its callers have specific permissions.
e. Ensure that if an assembly has the rights to compile, it has all the necessary rights to run on
any client.
Ans: d
131. In order for a type to be used and inherited by another component written in a different
.NET language, to which one of the following standards must it adhere?
a. COM+
b. COM/DCOM
c. GAC (Global Assembly Cache)
d. CLS (Common Language Specification)
e. CTS (Common Type System)
Ans: d
132. Which one of the following statements is NOT true with respect to type-safety?
a. Type-safe code accesses types only in well-defined, allowable ways, thereby preventing
overrun security breaches.
b. Type-safe code accesses only the memory locations it is authorized to access.
c. Type-safe components can execute safely in the same process even if they are trusted at
different levels.
d. Type-safe code provides assurances that security restrictions on code can be reliably enforced.
e. Type-safe code can directly read values from another object's private fields or code areas.
Ans: e
133. When referencing a COM object to be consumed in your .NET Windows Forms
application, when is the reference to the COM object released?
a. When the form using the referenced COM object has its visible property set to FALSE
b. When the variable referencing the run-time callable wrapper (RCW) goes out of scope
c. When the variable referencing the run-time callable wrapper (RCW) is garbage collected and
destroyed
d. When the variable referencing the COM callable wrapper (CCW) goes out of scope

e. When the IIS default application pool timeout expires


Ans: c
134. Which one of the following statements is true with regard to .NET attributes?
a. When defining the AttributeUsage attribute for a custom attribute, multiple AttributeTargets
can be specified.
b. Attributes can be applied to class members only, but not to classes themselves or assemblies.
c. Attributes can only be applied to assemblies, since attributes are stored as metadata in the
assembly.
d. Only one Attribute can be applied to a programming element.
e. Custom attributes of a type can be retrieved directly using the Attribute.GetType() method.
Ans: a
135. Sally is a managed type library developer. She wants to ensure that her library can be used
by all the .NET languages. Given the scenario above, which one of the following rules does Sally
follow?
a. Extensible Markup Language (XML)
b. Common Language Specification (CLS)
c. Just In Time (JIT)
d. Common Language Runtime (CLR)
e. Common Type System (CTS)
Ans: e
136. For which one of the following .NET application types must you install the compiled
executable and attach a debugger manually before being able to debug the application and place
breakpoints in code?
a. .NET Windows Application
b. ASP.NET Web Application
c. ASP.NET Mobile Web Application
d. .NET Console Application
e. .NET Windows Service Application
Ans: e
137. Joe adds security features to his code by adding attributes; he does not have to write any
other specific security code. Given the scenario above, which one of the following types of
security is Joe using?
a. Windows Security
b. Role-Based Security Permissions
c. Imperative Security
d. Declarative Security
e. Identity Permissions
Ans: d

138. Monique wants to create a class that has a public method that identifies the instance type of
the instantiated class. Referring to the above scenario, what does Monique do when coding?
a. She has her class explicitly inherit from System.Object.
b. She references the System.Reflection namespace and adds an attribute specifying ObjectType.
c. She overrides the GetType() method with code to return the type of the class she is coding.
d. She does nothing; a GetType() method is implicitly inherited by all classes from
System.Object.
e. She references the System.Reflection namespace in her code.
Ans: d
139. Which one of the following statements is true about garbage collection?
a. It is invoked every time a constructor is called.
c. It is invoked when generation 0 does not have room for the newly created object.
d. It is invoked every 40 seconds until the process is destroyed.
e. It is invoked when the Dispose method is explicitly called.
Ans: c
140. More than one application domain can run within which one of the following objects?
a. A process
b. A thread
c. A policy
d. An assembly
e. A remote application domain
Ans: a
141. Declarative security does which one of the following?
a. It sets the permissions on any reference types that are declared.
b. It is implemented by code and does not use attributes.
c. It configures the machine's system security policy.
d. It uses attributes to place security information into the metadata of your code.
e. It sets the permissions on any value types that are declared.
Ans: d
142. You are taking on a maintenance role for an existing .NET project. When you first start to
inspect the source code, you notice a Interop.FinancialCalcs.dll file located in the /bin/debug/
folder of the .NET project. Referring to the scenario above, which one of the following
statements is true about the .NET project?

a. The existence of the Interop.FinancialCalcs.dll file indicates that this project is using .NET
Remoting.
b. The existence of the Interop.FinancialCalcs.dll file indicates that this project has been
compiled for interoperability across all hardware platforms.
c. The existence of the Interop.FinancialCalcs.dll file indicates that a legacy COM object, named
FinancialCalcs.dll, is used in the project.
d. The existence of the Interop.FinancialCalcs.dll file indicates that a .NET assembly, named
FinancialCalcs.dll, is used in the project.
e. The existence of the Interop.FinancialCalcs.dll file indicates that a C++ library, named
FinancialCalcs.dll, is referenced in the project.
Ans: d
143. You have several legacy applications using older COM technology that need to interact
with a new business rule library that you have created as a .NET assembly .dll, but you do not
want all the public classes exposed to COM clients. You know that this can be done using .NET
COM Interop functionality. Referring to the scenario above, which one of the following
attributes do you use at the class level to hide specific .NET classes from COM based
application?
a. ClassInterfaceAttribute>
b. <GuidAttribute>
c. <ComEventInterfaceAttribute>
d. <ComImportAttribute>
e. <ComVisibleAttribute>
Ans: e
144. Phil wants to select a .NET language that has source code XML documentation creation
features built into the compiler. Given the scenario above, which one of the following .NET
framework 1.1 language compilers does Phil select?
a. ilasm.exe
b. csc.exe
c. asm.exe
d. vbc.exe
e. cl.exe
Ans: b
145. Maggie is using Windows security in conjunction with IIS in her ASP.NET Web
application in order to control who is allowed to access her intranet site. In the scenario above,
which one of the following functions does the Windows security with IIS provide?
a. Authorization
b. Certificate services

c. Validation
d. Authentication
e. Impersonation
Ans: d
146. CarObject obj = new CarObject();
obj.TireSize = 123;
IFormatter formatter = new BinaryFormatter();
Stream stream = new FileStream("TestFile.bin", FileMode.Create, FileAccess.Write,
FileShare.None);
formatter.Serialize(stream, obj);
stream.Close();
Referring to the C# code in the sample above, you receive a SerializationException. Which one
of the following choices describes the cause of this exception?
a. You did not mark the CarObject class with the Serializable attribute.
b. Tiresize is a Private property and you can only serialize Public properties.
c. You cannot use a binary formatter to serialize application class instances.
d. You cannot serialize application class instances, only system class instances.
e. You must supply the desired .XSD schema when using a binary formatter.
Ans: a
147. Which one of the following .NET types is a Value type?
a. Array
b. Date Time
c. Class
d. Delegate
e. String
Ans: b
148. Which one of the following statements is true about value types?
a. They are stored on the managed heap.
b. They cannot be sealed.
c. They can never be assigned a null value.
d. They are initialized to null.
e. They are passed by reference in a method.
Ans: e
149. The .NET Framework significantly reduces the chance of buffer overrun security
vulnerabilities through its use of which one of the following design philosophies?
a. Assembly Versioning

b. A Common Type System


c. Compilation to MSIL (Intermediate Language)
d. Managed Memory
e. JIT (Just In Time) Compilation
Ans: d
150. You are creating an ASP.NET Web application. You want each request to impersonate a
specific domain account for which you have set up SQL Server database permissions. Given the
scenario above, which one of the following Web.Config elements is used to set up the
impersonation credentials for each request to your Web site?
a. <authentication>
b. <authorization>
c. <identity>
d. <appsettings>
e. <processmodel>
Ans: c
151. Attributes are processed in which one of the following ways?
a. The class loader interprets the attribute into MSIL at load time.
b. The Assembly Linker (al.exe) generates native code from attributes in MSIL.
c. The source code compiler processes the attribute into metadata.
d. The CLR processes the attributes at install time.
e. The JIT compiler interprets the attribute into MSIL at runtime.
Ans: e
152. Steve wants to view the methods available when providing COM+ services for his .NET
objects. Given the scenario above, which one of the following namespaces does Steve view?
a. System.Messaging
b. System.Runtime
c. System.Net
d. System.EnterpriseServices
e. System.Management
Ans: d
153. Which one of the following objects is a high-level abstraction of the Connection and
Command objects in ADO.NET?
a. DataView
b. DataReader
c. DataSet
d. DataTable

e. DataAdapter
Ans: e
154. Joe wants to apply the Common Type System (CTS) visibility rule for a method so that it is
callable only from derived types and the type to which it belongs. Given the above scenario,
which one of the following is the correct modifier?
a. Abstract
b. Public
c. Private
d. Assembly (referred to as "internal" in many languages)
e. Family (referred to as "protected" in many languages)
Ans: e

1.

The CLR completely --- assemblies from each other by ____________


Ans: When code is type safe.

2. What is CAS ( Code Access Security )


Ans: CAS Defines permissions sets - things that can be done by a set of code and
membership conditions
3. If you want to define a class that has a public method that identifies the instance type of
the instantiated class. What will you do?
Ans: Add a reference system.Reflection namespace in your code and add an attribute called
as objectType.
4. What is Namespace?
Ans: A namespace is a Logical grouping of the names-identifiers -used within an application.
5. You can have two files with the same name in GAC. State true or false
Ans: true
6. How would you provide callback capability for events?
Ans: delegates
7. What is Managed code?
Ans: Code that has its execution managed by the .NET framework Common Language
Runtime.
8. What is Public/shared assembly?
Ans: shared Assemblies are the assembly that are accessible globally/shared across the
machine to all applications.

9. What is the best term used to describe the Fundamental unit of deployment and versioning
in .NET framework?
Ans: Assembly
10. Which of the following .NET type is like a class, that can contain constructors, fields
methods, indexers and properties, but does not support inheritance and also is a value type
?
Ans: struct
11. The memory allocated to reference is always released in which of the following ways?
Ans: when the reference counter reaches 0
12. How do you add and remove assembly from GAC?
Ans:

gacutil.exe/l.myassembly.dll,
gacutil.exe/u.myassembly.dll

13. .NET web services allow remote applications to easily communicate over http port 80 using
XML. State true or false?
Ans: true
14. What is CTS in .NET?
Ans: It defines the Rules concerning datatype. (The common type system defines how types
are declared, used, and managed in the common language runtime)
15. How can you create a Strong name for a .NET assembly?
Ans: with the help of sn.exe
16. What is Reflection?
Ans: Enables an application to discover info about classes in order to access the class
members, create new types at run time.
17. What are the Data types supported by CTS?
Ans: both value and reference type
18. Not a .NET compatible language?
Ans: Java
19. In .NET Event programming delegates are used for declaring and implementing which one of
the following event programming structures?
Ans: EventHandler
20. What is Private assembly?
Ans: Assembly that is Applicable to particular applications where they are kept.
21. What is the Diff b/w namespace and assembly?
Ans:

A. namespace: is a collection of name, wherein each name is unique.


B. Assembly contains MSIL code.

23. Which one of the following is a reference type?


Ans: object, array (string, delegates, class)
24. ILDASM stands for?

Ans: Intermediate Language DisASsembler


25. What is delegates?
Ans: a delegate can be defined as a type safe function pointer
26. Common language specification (cls) ________
Ans: defines standard rules for defining .net compliant languages.
27. What is Garbage Collection (GC)?
Ans: GC is the process whereby the common language runtime (CLR) reclaims memory that is no
longer in use. Ie, no longer referenced by an active object.
28. From which of the following locations does the GC remove the objects?
Ans: from the managed heap
29. what is delay signing?
Ans: delay signing allows you to place a shared assembly in GAC by signing the assembly with just
the public key
30. The data view can provide different views of which of the following objects?
Ans: Datatable

1. How many parts does version no. of an assembly contain. ans 4


2. What is G.A.C. Global Assembly Cache
3. Who is responsible for running G.C. ans CLR
4. Full Form Of: CLR. Common Language runtime
5. Full Form Of: CTS. Common type system
6. Full Form Of: ILDASM. Intermediate Language disassembler
7. Difference between value type and reference type.
8. Basic building block of deployment. ans assembly
9. removing object from heap memory. ans Garbage collection.

10. What type of files stored in bin folder. ans .dll


11. question's from Boxing and Unboxing. Conversion of value to reference type boxing; conversion of
reference to value type - unboxing
12. Path of shared or public assembly. ans GAC
13. Definition of shared assembly?
14. GC can be forced to run? Ans: True
15. Strings are which type of object ? Ans: reference
16. Learn about gacutil.exe, ildasm.exe
17. How can you view metadata information? Ans: Ildasm.exe
18. What is manifest? / What for manifest is used? Ans: Contains information about assembly
19. What is correct about assemblies in .net[checkbox]
1. Assemblies are logical piece of code
2. One Assembly can contain many files
3. dont remember
4. dont remember
20. What is wrong about .net framework? [checkbox]
21. What is satellite assembly. [options were very funny.. ]
1. Satellite is moon.
2. Used in Satellite manufacturing process.
3. Last option i dont rem .. must be the correct option (:D)
22.shared assembly is stored in---->"GAC"
a.GAC
b.Home directory
c.database
d.c:\drive

23.what are different type of "JIT"--------->PRE-JIT,ECNO-JIT,NORMAL-JIT


a.PRE-JIT,POST-JIT,NORMAL-JIT
b.PRE-JIT,CLR-JIT,NORMAL-JIT
c.MSIL-JIT,Ecno-JIT,NORMAL-JIT
d.PRE-JIT,ECNO-JIT,NORMAL-JIT

24.Reflector--->is a cross browser,decompiler and static analyzer for software created in .net frame
work.

Verify the answers once!

2) What is .Net Framework ?


The .NET framework is a programming framework from Microsoft. Developers can use .Net
Framework to develop applications,install and run the application on Windows operating
systems.

3) What is MS-IL (Microsoft Intermediate Language) ?


When a program is complied in .Net , the source code will be converted into an intermediate
language called Microsoft Intermediate Language (MS-IL) . This is done by Just-In time
Compiler (JIT). .Net framework is built in such a way that , Code is Just-In time complied,
that is it get complied when it is called rather compiling entire code at the start up. A portion
of the code will get complied only once and it will exists till the application exit. This will have
a significant improvement in performance since entire section of the code wont get
executed in most cases.

4) What is Common Language Runtime (CLR) ?

Common Language Runtime or CLR is the run-time execution environment of .Net


Framework. Converting MS-IL into platform or OS specific code is done by CLR. Currently
.Net programs will run only in windows.

5) What is Common Type System (CTS) ?


.Net uses Common Type System (CTS) for Language Interoperability. CTS defines the
predefined data types that are available in IL, so that all languages that target the .NET
framework will produce compiled code that is ultimately based on these types. So that a
data type defined in a VB.net will be understood by C#. For example, VB.Net uses Integer
to define data type Integer. C# uses int to define data type Integer. When VB.Net code is
complied , it will convert Integer to Int32 and since C# refers Int to Int32 VB.Net code will be
understood by C#.

6) What is Common Language Specification (CLS) ?


Common Language Specification (CLS) is also used for Language Interoperability in
tandem with CTS to ensure Language Interoperability. CLS defines a set of minimum
standards that all compilers targeting .NET must support. For example VB.Net is not case
sensitive. So attribute EmployeeName and employeename is considered same. But C#
is case sensitive. So for language interoperability , C# doesn't allow two variable which
differs only in Case.

7) What is Garbage Collector ?


Garbage Collector is used in .Net Framework for memory management. While running an
application, application request for memory for its internal use. Framework allocates
memory from the heap. Once the process is completed , allocated need to be reclaimed for
future use. The process of reclaiming unused memory is taken care by Garbage Collector.

8) How to invoke garbage collector programmatically ?


To call garbage collector programmatically, use code GC.Collect();

9) What is a Managed Code ?


Managed code is code that can be executed and managed by .NET Framework Common
Language Runtime. All code based on Intermediate language executes as managed code.

10) What is an Assembly ?


Assemblies are self-describing logical unit, consisting of one or more files targeted at .Net.
An assembly can be stored across single file such as a single DLL or EXE that includes
meta data, or it can be stored in multiple files, for example, resource files, meta data, DLL's,
and an EXE. Assemblies support versioning.

11) What is Assembly Manifest ?


Part of assembly which contains assembly meta data that describes the assembly itself is
known as manifest. Assembly manifest contain Assembly Name ,Version Number,Culture,
Strong name, List of files inside the assembly and Reference information

12) What are different types of Assembly ?


The two types of Assemblies are Shared and Private.

13) What is Private Assembly ?

Private Assemblies are intended to be used by the program for which its made for. This is
because application will only load private assemblies that are located in the same folder or
in a sub folder that the main executable is loaded.

14) What is Shared Assembly ?


Shared Assemblies contain Common Libraries which are intended to be used by multiple
applications. While making shared assemblies, Name Collisions and Overwriting existing
Assemblies need to be taken care. Name Collisions can be taken care by strong name. And
global assembly cache can be used to avoid assembly overwriting.

15) How to view a Assembly information ?


By using Ildasm.exe which is an MSIL Disassembler one can view attributes, references to
other modules and assemblies

16) Where is the assembly version information stored ?


In the Manifest
17) What is NameSpace ?
Namespace is a logical grouping of related classes and types. Every class should have a
NameSpace.

18) What is the Difference between NameSpace and Assembly ?


Namespace:
22. Form the logical boundary for a Group of classes.

23. It is a Collection of names wherein each name is Unique.


24. Namespace must be specified in Project-Properties.
Assembly:

Assemblies are Self-Describing

It is an Output Unit. It is a unit of Deployment & a unit of versioning. Assemblies contain


MSIL code.

19) What is Global Assembly Cache (GAC) ?


While using shared assemblies, to avoid Assembly being overwritten by a different version
of the same assembly , shared assemblies are placed in a special directory subtree in the
file system, known as the global assembly cache (GAC). Placing shared assemblies can be
done by special .Net Utilities Only.

20) What is concept of strong names ?


While using shared assemblies, in order to avoid name collisions strong names are used.
Strong Names are based on private key cryptography , ie private assemblies are simply
given the same name as their main file name.

21) How to add and remove a assembly from GAC?


To install assembly in Cache use Gacutil. Goto "Visual Studio Command Prompt" and type
"gacutil -i <assembly_name>", where (assembly_name) is the DLL name of the project.
To uninstall assembly, type gacutil u <assembly name> in Visual Studio Command
Prompt.

22) What is Reflection?


Reflection is used to dynamically load a class , create object and invoke methods at
runtime. It can also be used to read its own metadata to find assemblies, modules and type
information at runtime.

23) What is Delay signing ?


To create a strong named assembly and want this assembly to be used by someone else,
we partially build this assembly by provide a Public Key. We write this Public Key in the
AssemblyInfo.vb OR .cs file. We also add an attribute by the named
<Assembly:AssemblyDelaySignAttribute(true)> to the assembly info file. This makes it
sure that when we build the assembly, It would be containing the information only about the
public key before we deliver it to our client. This is a partial strong named assembly that we
have created, and hence it is called Delayed Assembly.

24) What are different type of JIT ?


Different Types of JIT are
1) Pre-JIT - Complies complete source code into native code at the time of deployment
2) Econo-JIT - Complies methods that are called at runtime.
3) Normal-JIT - Complies methods that are called at runtime and get stored in cache. Next
time when the same method is called, it will be taken from cache.

25) What are Value types and Reference types ?


There are two types of data types in .Net, Value types and Reference types.Value types are
stored in stack part of the memory. Reference type are stored in managed heap. Let have a
look at the example for better understanding.

26) What is concept of Boxing and Unboxing ?


Converting a value type to reference type is called Boxing. Converting a reference type to
value type is called Unboxing

27) Whats difference between System exceptions and Application exceptions?


System exceptions are common exceptions thrown by the CLR of .Net Framework.
Application exceptions can be user defined exceptions thrown by the application.

28) What is CODE Access security?


CODE Access security is a security model that lets us grant or deny execution permissions
to an assembly according to its "properties," called evidence, such as its strong name or
publisher

29) What is a satellite assembly?


A satellite assembly are used when multilingual (UI) application are created. Satellite
assembly is a compiled library that contains localized resources which provides us with the
capability of designing and deploying solutions to multiple cultures, rather than hard coding
texts, bitmaps etc

30) How to prevent my .NET DLL to be decompiled ?


We can prevent .NET DLL to be decompiled up to an extent by Obfuscate Source code,
asymmetric encryption and encrypted w32 wrapper application.
31) What is Native Image Generator (Ngen.exe) ?
Ngen.exe creates compiled processor-specific machine code called native images, which
are files and installs them into the native image cache on the local computer. The runtime
will use native images from the cache rather than using the JIT compiler to compile the
original assembly.

32) What is Code Document Object Model (CodeDom) ?


Code Document Object Model are code generators which are used to minimize repetitive
coding tasks, and to minimize the number of human-generated source code lines.

.Net Code Access Security


The .NET Security Model provides code access permissions and code identity
permissions. Code Access Security is the part of the .NET security model
that determines whether or not the code is allowed to run, and what
resources it can use when it is running. Code Access Security policy uses
evidence to help grant the right permissions to the right assembly.
An administrator can configure Code Access Security policy to restrict the
resource types that code can access and the other privileged operations it
can perform. Code Access Security allows code to be trusted to varying
degrees depending on where the code originates and on other aspects of the
code's identity. Code Access Security can also help minimize the damage
that can result from security vulnerabilities in your code.

Você também pode gostar