study_questions
Differences
This shows you the differences between two versions of the page.
study_questions [2009/08/10 23:25] – stephen | study_questions [2017/01/01 20:05] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== Exam 70-528 Study Questions ====== | ====== Exam 70-528 Study Questions ====== | ||
+ | |||
+ | ===== Chapter 1: Framework Fundamentals ===== | ||
+ | |||
+ | ==== Extension ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C1XQ1: What is the primary purpose of a delegate? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: To facilitate event handling. | ||
+ | |||
+ | ==== Lesson 3: Constructing Classes | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C1L3Q1: To raise an event, what three elements must be provided? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - A class that provides event data. | ||
+ | - An event delegate. | ||
+ | - A class that raises the event. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C1L3Q2: What object type should an event pass if it has no custom data? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C1L3Q3: If an event needs to pass custom data, what class should be derived from and what is the naming convention? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C1L3Q4: What is the naming convention for a delegate for an event? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C1L3Q5: What two things should be done to allow a class to raise an event? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - A public event needs to be declared. | ||
+ | - A protected // | ||
===== Chapter 2: Input/ | ===== Chapter 2: Input/ | ||
+ | |||
+ | ==== Lesson 1: Navigating the File System ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C2L1Q1: How do you enumerate the drives in a system? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Call the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C2L1Q2: How do you enumerate the files in a particular directory? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Create a new // | ||
+ | - Call the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C2L1Q3: How would you determine the size of a particular file in the file system? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Create a new // | ||
+ | - Examine the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C2L1Q4: How do you copy a file? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Create a new // | ||
+ | - Call the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C2L1Q5: What are the high level steps required to monitor a directory for changes? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Create a // | ||
+ | - Set the //Path// property. | ||
+ | - Register for the event that you are interested in. | ||
+ | - Set the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C2L1Q6: How do you create a // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Create a new // | ||
==== Lesson 3: Compressing Streams ==== | ==== Lesson 3: Compressing Streams ==== | ||
Line 51: | Line 176: | ||
Answer: Start = ^ (carat), end = $ | Answer: Start = ^ (carat), end = $ | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C3L1Q2: In a regular expression, what is a lazy quantifier and how is one specified? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A lazy quantifier will match as little of the searched string as possible. A lazy quantifier is specified by adding a '?' | ||
===== Chapter 4: Collections and Generics ===== | ===== Chapter 4: Collections and Generics ===== | ||
Line 88: | Line 221: | ||
Answer: // | Answer: // | ||
- | ===== Chapter 4: Collections | + | |
+ | |||
+ | ==== Lesson 3: Working with Dictionaries | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C4L3Q1: When iterating over a // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The order of the hash values. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C4L3Q2: What are the five non-generic, | ||
+ | |||
+ | /* --== Question Answer separator | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * // | ||
+ | * // | ||
+ | * // | ||
+ | * // | ||
+ | * // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C4L3Q3: What type of object does a non-generic dictionary collection contain? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091012 */ | ||
+ | |||
+ | ** C4L3Q4: Which list is a dictionary? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
==== Lesson 4: Using Specialized Collections ==== | ==== Lesson 4: Using Specialized Collections ==== | ||
Line 134: | Line 309: | ||
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
- | ** C4L4Q6: What are the five specialised collections? | + | ** C4L4Q6: What are the five specialised collections |
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
- | Answer: // | + | Answer: |
+ | |||
+ | - // | ||
+ | - //BitVector32//, no generic equivalent. | ||
+ | - // | ||
+ | - // | ||
+ | - // | ||
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
Line 200: | Line 381: | ||
Answer: // | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C4L5Q3: What are the three non-specialised, | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * // | ||
+ | * //Queue//, equivalent to // | ||
+ | * //Stack//, equivalent to // | ||
+ | |||
+ | ==== Extension ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C4XQ1: What does the compiler do when an iterator is implemented? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Automatically generates the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C4XQ2: How do you implement an iterator? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Implement the // | ||
+ | - Create a method called // | ||
+ | - Use the '' | ||
+ | - If required, use the '' | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C4XQ3: What are two ways that the default iterator functionality can be extended? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Named iterators can be created which allows a class to have multiple iteration techniques. | ||
+ | - Parameterised iterators can be created which allows clients control over some or all of the iteration behaviour. | ||
===== Chapter 5: Serialization ===== | ===== Chapter 5: Serialization ===== | ||
Line 530: | Line 757: | ||
===== Chapter 7: Threading ===== | ===== Chapter 7: Threading ===== | ||
+ | |||
+ | ==== Extension ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7XQ1: What is the difference between the way the CLR deals with unhandled exceptions in the .NET Framework 1.1 verses 2.0? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: In 1.0, a backstop is provided for unhandled exceptions that occur on the following types of thread: | ||
+ | |||
+ | * A thread from the thread pool. | ||
+ | * A thread created with the // | ||
+ | * A finaliser thread. | ||
+ | |||
+ | In 2.0, these exceptions are left to proceed naturally. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7XQ2: The .NET Framework 2.0 provides a backstop for what three types of unhandled exceptions? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * A // | ||
+ | * An // | ||
+ | * An internal exception thrown by the CLR or host process. | ||
==== Lesson 1: Creating Threads ==== | ==== Lesson 1: Creating Threads ==== | ||
Line 615: | Line 870: | ||
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
- | Answer: Call the // | + | Answer: Call the // |
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
Line 624: | Line 879: | ||
Answer: It is faster. | Answer: It is faster. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q11: What should the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Debugging only and not thread synchronisation. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q12: Which thread state can a thread not return to once it has left it? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q13: Which thread state can a thread not leave once it has entered it? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: //Stopped// | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q14: Which thread state is a newly created thread in? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q15: What happens to a thread' | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: At first, nothing. Then, when the thread __responds__ to the call and actually starts running, it changes to // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q16: What happens to a thread' | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q17: What happens to a thread' | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: At first the thread' | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q18: What can trigger a thread to change its state to // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * The thread responds to a // | ||
+ | * Another thread calls // | ||
+ | * TODO: there may be a third. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C7L1Q19: How can a thread enter the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * The thread calls // | ||
+ | * The thread calls // | ||
+ | * The thread calls // | ||
==== Lesson 2: Sharing Data ==== | ==== Lesson 2: Sharing Data ==== | ||
Line 862: | Line 1197: | ||
Follow up question: What should you also do if you override any optional method? | Follow up question: What should you also do if you override any optional method? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
Answer: The methods //OnStart// and //OnStop// should be overridden. The methods // | Answer: The methods //OnStart// and //OnStop// should be overridden. The methods // | ||
Follow up answer: If //OnPause// and/or // | Follow up answer: If //OnPause// and/or // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
** C8L3Q3: What four things does the // | ** C8L3Q3: What four things does the // | ||
Line 911: | Line 1250: | ||
Answer: InstallUtil.exe. | Answer: InstallUtil.exe. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090922 */ | ||
+ | |||
+ | ** C8L3Q8: What are three methods for starting a Windows service? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Server Explorer. | ||
+ | * Services Control Manager. | ||
+ | * Programmatically using the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090922 */ | ||
+ | |||
+ | ** C8L3Q9: What exception will a // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090922 */ | ||
+ | |||
+ | ** C8L3Q10: What class is used to interact with Windows services? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091012 */ | ||
+ | |||
+ | ** C8L3Q11: What should a service name be and how is it set? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A service name should be unique and is set by modifying the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091012 */ | ||
+ | |||
+ | ** C8L3Q12: What must a service' | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Return. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091012 */ | ||
+ | |||
+ | ** C8L3Q13: What are three ways to stop or start a service? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Use Computer Management' | ||
+ | * Use the //Net// command from a command line. | ||
+ | * Programmatically, | ||
===== Chapter 9: Installing and Configuring Applications ===== | ===== Chapter 9: Installing and Configuring Applications ===== | ||
Line 1025: | Line 1432: | ||
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
- | Answer: Add the //RunInstallerAttribate// to the custom class and set the // | + | Answer: Add the //RunInstallerAttribute// to the custom class and set the // |
==== Lesson 3: Using the .NET Framework 2.0 Configuration Tool ==== | ==== Lesson 3: Using the .NET Framework 2.0 Configuration Tool ==== | ||
Line 1056: | Line 1463: | ||
Answer: Application, | Answer: Application, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090923 */ | ||
+ | |||
+ | ** C10L1Q3: What should never be done with any event log object? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It should never be passed to less trusted code. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090923 */ | ||
+ | |||
+ | ** C10L1Q4: What is required to create an event source and why? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Administrative privileges is required because all logs, including security, must be searched to determine whether the event source is unique. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090924 */ | ||
+ | |||
+ | ** C10L1Q5: Which versions of Windows do not support event logs? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Windows 98 and Windows Me. | ||
==== Lesson 2: Debugging and Tracing ==== | ==== Lesson 2: Debugging and Tracing ==== | ||
Line 1065: | Line 1502: | ||
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
- | Answer: Call the //Debugger.Log// method. | + | Answer: Call the //Debugger.Break// method. |
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
Line 1094: | Line 1531: | ||
** C10L2Q5: What does the // | ** C10L2Q5: What does the // | ||
+ | |||
+ | Follow up question: How is it different from the // | ||
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
- | Answer: It prevents | + | Answer: It causes |
+ | |||
+ | Follow up answer: The // | ||
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
- | ** C10L2Q6: How do you prevent the debugger from breaking inside a class, method or property, even if there is a breakpoint? ** | + | ** C10L2Q6: What does the // |
+ | |||
+ | Follow up question: How is it different from the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It causes the debugger to step through the code for the class, method or property it decorates, but the debugger will still break at any breakpoints in the code. | ||
+ | |||
+ | Follow up answer: The // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C10L2Q7: How do you prevent the debugger from breaking inside a class, method or property, even if there is a breakpoint? ** | ||
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
Line 1109: | Line 1562: | ||
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
- | ** C10L2Q7: How do you cause the debugger | + | ** C10L2Q8: How do you prevent |
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
- | Answer: Add a // | + | Answer: Add a // |
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
- | ** C10L2Q8: What does the //DebuggerStepThrough// attribute do and how is it different to the //DebuggerHidden// attribute? ** | + | ** C10L2Q9: How do you add a //DebuggerHidden// or //DebuggerStepThrough// attribute |
/* --== Question Answer separator ==-- */ | /* --== Question Answer separator ==-- */ | ||
- | Answer: | + | Answer: |
==== Lesson 3: Monitoring Performance ==== | ==== Lesson 3: Monitoring Performance ==== | ||
Line 1225: | Line 1678: | ||
Answer: // | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q8: What industry standard does the WMI use to represent systems, processes, networks, devices and enterprise components? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Common Information Model | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q9: The WMI architecture consists of what three tiers? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Client software components. | ||
+ | * The object manager. | ||
+ | * Provider software components. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q10: What three things can applications use the WMI for? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Enumerating or retrieving a collection of instance property data. | ||
+ | * Querying for selected instance data. | ||
+ | * Subscribing to events. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q11: What can the WMI instrumentation be used for? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Applications can create their own class and instances with properties and methods that store data about themselves to WMI. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q12: What class or classes are used when gathering WMI class information? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q13: What class or classes are used when querying for data with WMI? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q14: What class or classes are used when querying for data asynchronously with WMI? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q15: What class or classes are used when executing methods with WMI? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q16: What class or classes are used when executing methods asynchronously with WMI? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q17: What class or classes are used when receiving events from WMI? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q18: What class or classes are used when receiving events asynchronously from WMI? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q19: What class or classes are used when connecting to a remote computer with WMI? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q20: What class or classes are used when creating data providers with WMI instrumentation? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q21: What class or classes are used when creating event providers with WMI instrumentation? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090921 */ | ||
+ | |||
+ | ** C10L4Q22: What class or classes are used when registering a provider with WMI instrumentation? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090922 */ | ||
+ | |||
+ | ** C10L4Q23: What does the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It represents a management query that returns instances or classes. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090922 */ | ||
+ | |||
+ | ** C10L4Q24: What does the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It retrieved a collection of management objects based on a specifies query. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090922 */ | ||
+ | |||
+ | ** C10L4Q25: What does the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It represents different collections of management objects retrieved through WMI. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090922 */ | ||
+ | |||
+ | ** C10L4Q26: Objects contained in a // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
===== Chapter 11: Application Security ===== | ===== Chapter 11: Application Security ===== | ||
Line 1253: | Line 1904: | ||
Answer: Host evidence and assembly evidence. | Answer: Host evidence and assembly evidence. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L1Q4: What are the three CAS policy levels and which one would you most commonly use? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Enterprise, machine and user. Machine policy is the most commonly used. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L1Q5: What must an assembly have before its trust can be increased? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A strong name. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L1Q6: As a developer, the permission set assigned to the My_Computer_Zone should be changed from what to what? ** | ||
+ | |||
+ | Follow up question: Why should it be changed? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: From "Full Trust" to " | ||
+ | |||
+ | Follow up answer: Full Trust completely skips all CAS statements in code. The Everything permission set has similar permissions, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L1Q7: What is the command line utility for maintaining CAS settings? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Caspol.exe - **C**ode **A**ccess **S**ecurity **POL**icy tool. | ||
+ | |||
==== Lesson 2: Using Declarative Security to Protect Assemblies ==== | ==== Lesson 2: Using Declarative Security to Protect Assemblies ==== | ||
Line 1287: | Line 1975: | ||
Answer: ' | Answer: ' | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L2Q5: What are the three // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L2Q6: CAS declarations are only significant in what type of assemblies? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Partially trusted assemblies. | ||
+ | |||
+ | ==== Lesson 3: Using Declarative and Imperative Security to Protect Methods ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q1: How many declarative CAS security actions are available for assemblies and how many are available for methods? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Three for assemblies, six for methods. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q2: What are the three declarative CAS security actions for assemblies? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q3: What are the six declarative CAS security actions for methods? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: //Assert//, //Demand//, //Deny//, // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q4: What is the difference between the //Demand// CAS security action and the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: //Demand// checks the security of __all__ the callers, // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q5: Which class is used to specify what to check for in a declarative permission statement and which is used in an imperative permission statement? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Declarative permission statements use // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q6: How should a method __check__ if it has a particular CAS permission? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Call the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q7: Which two security actions __reduce__ CAS permissions for a method and what is the difference between the two? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: //Deny// and // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q8: Which two security actions __reduce__ CAS permissions for an assembly and what is the difference between the two? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q9: What are the three security actions that are applicable to assembles and what are their equivalent security actions that are applicable to classes and methods? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * // | ||
+ | * // | ||
+ | * // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** < | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | < | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C11L3Q11: As the security action //Assert// can only be used once in a method, how can multiple CAS permissions be asserted? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Add the permissions to a // | ||
===== Chapter 12: User and Data Security ===== | ===== Chapter 12: User and Data Security ===== | ||
Line 1574: | Line 2372: | ||
===== Chapter 13: Interoperation ===== | ===== Chapter 13: Interoperation ===== | ||
+ | |||
+ | ==== Extension ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090915 */ | ||
+ | |||
+ | ** C13XQ1: What are the eight integer based COM data types and their .NET equivalent types? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * bool -> //Int32// | ||
+ | * byte -> //Byte// | ||
+ | * char -> //SByte// | ||
+ | * small -> //SByte// | ||
+ | * short -> //Int16// | ||
+ | * long -> //Int32// | ||
+ | * int -> //Int32// | ||
+ | * Hyper -> //Int64// | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090915 */ | ||
+ | |||
+ | ** C13XQ2: What are the four non-integer numeric COM data types and their .NET equivalent types? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * float -> //Single// | ||
+ | * double -> //Double// | ||
+ | * DECIMAL -> //Decimal// | ||
+ | * CURRENCY -> //Decimal// | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090915 */ | ||
+ | |||
+ | ** C13XQ3: What are the three other important COM data types and their .NET equivalent types? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * void * -> //IntPtr// | ||
+ | * HRESULT -> //Int16// or //IntPtr// | ||
+ | * VARIANT -> //Object// | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090915 */ | ||
+ | |||
+ | ** C13XQ4: What are the five COM data types that are equivalent to //String//? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: BSTR, LPSTR, LPWSTR, char *, wchar_t * | ||
==== Lesson 1: Using COM Objects ==== | ==== Lesson 1: Using COM Objects ==== | ||
Line 1624: | Line 2482: | ||
Answer: Static members, parameterised constructors, | Answer: Static members, parameterised constructors, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q7: When generating metadata from a type library, what is the resulting assembly called? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: An interop assembly. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q8: What are the four options for generating an interop assembly containing type metadata? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Visual Studio. | ||
+ | * Type Library Importer (Tlbimp.exe). | ||
+ | * The // | ||
+ | * Custom wrappers. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q9: What can the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It can convert an in-memory type library to metadata. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q10: What are the four high level steps to expose a COM component to the .NET Framework? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Import a type library as an assembly. | ||
+ | - Create COM types in managed code. | ||
+ | - Compile an interop project. | ||
+ | - Deploy an interop application. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q11: How are COM types that are defined in an assembly used differently from other managed types? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: They aren't used differently (tricky). | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q12: How is compiling an interop project different from compiling a managed project? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It isn't different (tricky). | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q13: What three things does an interop application contain? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * A .NET client assembly. | ||
+ | * One or more interop assemblies. | ||
+ | * One or more registered COM components. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q14: Where should private assemblies be installed? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The same directory as the application. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q15: What must a shared assembly have and where is it installed? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It must have a strong name and be installed in the Global Assembly Cache (GAC). | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L1Q16: What is a primary interop assembly? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A unique, vendor-supplied, | ||
+ | |||
+ | ==== Lesson 2: Exposing .NET Components to COM ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q1: When .NET components are consumed by COM, what handles the marshalling between .NET and COM? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The COM Callable Wrapper (CCW). | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q2: How do you hide a public .NET class from COM? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Give it a // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q3: What are the four options for generating a type library for COM? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Type Library Exporter (Tlbexp.exe) | ||
+ | * Using the // | ||
+ | * Assembly Registration Tool (Regasm.exe) | ||
+ | * .NET Services Installation Tool (Regsvcs.exe) | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q4: What are the five guidelines for qualifying .NET types for interoperation? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Classes should implement interfaces explicitly. | ||
+ | * Managed types must be public. | ||
+ | * Methods, properties, fields and events must be public. | ||
+ | * Types must have a public default constructor to be activated from COM. | ||
+ | * Types can not be abstract. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q5: What public parts of a class are not exposed to COM clients? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Parameterised constructors, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q6: What does the Assembly Registration tool do and what .NET class provides the equivalent functionality? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The Assembly Registration tool generates a type library and then registers it so that COM clients can use the .NET class transparently, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q7: What is the difference between the Type Library Exporter and the Assembly Registration tool? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The Type Library Exporter generates a type library but does not register it. The Assembly Registration tool does both. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q8: How do you use the Type Library Exporter to generate a subset of the types defined in an assembly? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: You can't - the entire assembly is converted at once (tricky). | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q9: How can an interop assembly be activated from any COM client? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: After registering it, install it in the Global Assembly Cache (GAC). | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q10: When using the Assembly Registration tool, what does the ''/ | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It causes the Assembly Registration tool to generate a type library in addition to registering the types. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L2Q11: When should the ''/ | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: If the assembly was produced by the Type Library Importer. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090914 */ | ||
+ | |||
+ | ** C13L2Q12: What are the three actions that the .NET Services Installation tool performs? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Loads and registers an assembly. | ||
+ | * Generates, registers and installs a type library into a specified COM+ 1.0 application. | ||
+ | * Configures services that you have added programmatically to your class. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090914 */ | ||
+ | |||
+ | ** C13L2Q13: What must an assembly have before it can be used by the .NET Services Installation tool? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A strong name. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090914 */ | ||
+ | |||
+ | ** C13L2Q14: What two security considerations does the .NET Services Installation tool have? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * It can not register components with methods protected by a demand or link demand for the // | ||
+ | * You must have administrative privileges on the local computer to use the .NET Services Installation tool. | ||
==== Lesson 3: Using Unmanaged Code ==== | ==== Lesson 3: Using Unmanaged Code ==== | ||
Line 1652: | Line 2742: | ||
Answer: Add a // | Answer: Add a // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L3Q4: What attribute is used to specify a library when creating a P/Invoke? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L3Q5: What attribute is used to determine what order members of a structure are stored in memory? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C13L3Q6: What are the three methods for determining what order members of a structure are stored in memory and how are they specified? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Auto, sequential and explicit. An instance of // | ||
+ | |||
+ | ===== Chapter 14: Reflection ===== | ||
+ | |||
+ | ==== Lesson 1: Understanding Reflection ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L1Q1: What are the four parts of an assembly? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Assembly metadata (or manifest), type metadata, code and resources. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L1Q2: What is the relationship between assemblies, modules and types? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: An assembly can contain one or more modules (although typically just one). A module can contain one or more types. An assembly can not directly contain a type (or types must be contained in a module). | ||
+ | |||
+ | ==== Lesson 2: Assembly Attributes ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L2Q1: How do you get a reference to the current assembly? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Call the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L2Q2: Using reflection, how can you get a collection of all the attributes that a class has? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Call the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L2Q3: What happens when the revision part of the version number in the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It will be replaced with a random number by the compiler. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L2Q4: What happens when the build part of the version number in the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: It will be replaced with an automatically incrementing number by the compiler. | ||
+ | |||
+ | ==== Lesson 3: Reflecting Types ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L3Q1: How do you create a //Type// object based on a particular object? ** | ||
+ | |||
+ | Follow up question: How do you create a //Type// object based on a particular class? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Call the object' | ||
+ | |||
+ | Follow up answer: Use the //typeof// keyword. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L3Q2: If a //string// has been cast into a variable of type //object//, what will calling the method //GetType// on the variable return? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A //Type// object that represents the __string__ class. | ||
+ | |||
+ | ==== Lesson 5: Creating Code at Runtime ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C14L5Q1: Which class is used to create a dynamic assembly? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
===== Chapter 15: Mail ===== | ===== Chapter 15: Mail ===== | ||
Line 1712: | Line 2912: | ||
Answer: Set // | Answer: Set // | ||
+ | |||
+ | ===== Chapter 16: Globalization ===== | ||
+ | |||
+ | ==== Lesson 1: Using Culture Information ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C16L1Q1: What are the three culture categories? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Invariant, neutral and specific. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** C16L1Q2: How can a string comparison be made that is specific to a culture and can use the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - Create or get a reference to an // | ||
+ | - Get a reference to the // | ||
+ | - Call the //Compare// method on the // | ||
+ | |||
+ | ====== Web Exam 70-528 Study Questions ====== | ||
+ | |||
+ | ===== Chapter 1: Introducing the ASP.NET 2.0 Web Site ===== | ||
+ | |||
+ | ==== Lesson 1: Understanding The Players ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC1L1Q1: What are the four main HTTP methods? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Get, post, put and delete. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC1L1Q2: What are the five common MIME types? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Text, image, audio, video and application. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC1L1Q3: What is the difference between where form data is stored in a GET request and a POST request? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: In a GET request, the form data is put in the query string. In a POST request, the data is put in the message body. | ||
+ | |||
+ | ==== Lesson 2: Creating a Web Site ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC1L2Q1: What are the three sections of an in-line ASPX file? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Page directives, code, layout. | ||
+ | |||
+ | ==== Lesson 3: Working with Web Configuration Files ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC1L3Q1: What are the five levels, in order, of the ASP.NET configuration hierarchy? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Global machine, root default web, web site, web application, | ||
+ | |||
+ | ==== Lesson 4: Using ASP.NET Trace ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC1L4Q1: What is the virtual page that displays trace information? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Trace.axd. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC1L4Q2: What are the two methods of configuring the trace facility? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Using the Website Administration Tool and editing the web.config file. | ||
+ | |||
+ | ===== Chapter 2: Adding and Configuring Server Controls ===== | ||
+ | |||
+ | ==== Lesson 1: Using a Server Control ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** WebC2L1Q1: How should the source of bloat in the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: By using the trace facility. | ||
+ | |||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20117012 */ | ||
+ | |||
+ | ** WebC2L1Q2: What must an HTML server control be located inside to operate correctly? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A form element that has the // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20117012 */ | ||
+ | |||
+ | ** WebC2L1Q3: What are the three methods of setting the properties of an HTML control? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Source view, design view and programmatically in code. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20117012 */ | ||
+ | |||
+ | ** WebC2L1Q4: In which event on what object should dynamically created controls be created? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The Init event on the page object. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20117012 */ | ||
+ | |||
+ | ** WebC2L1Q5: What order are events from a web page raised on the server side? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The event that caused the postback is processed last. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20117012 */ | ||
+ | |||
+ | ** WebC2L1Q6: What property on a control should be set to minimize the size of the // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20117012 */ | ||
+ | |||
+ | ** WebC2L1Q7: What are the five main page events, in the order they occur? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | ==== Lesson 2: Exploring Common Web Server Controls ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20117012 */ | ||
+ | |||
+ | ** WebC2L2Q1: What are two differences between the //Literal// control and the //TextBox// control? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * The //Literal// control does not support styles, themes, and skins. | ||
+ | * The //Literal// control does not inherit from // | ||
+ | |||
+ | ===== Chapter 3: Exploring Specialized Server Controls ===== | ||
+ | |||
+ | ==== Lesson 1: Exploring Specialized Web Server Controls ==== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110823 */ | ||
+ | |||
+ | ** WebC3L1Q1: What are the three modes of the //Literal// control? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110823 */ | ||
+ | |||
+ | ** WebC3L1Q2: What is the advantage of using the //Table//, // | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The ability to add rows and cells programmatically. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110824 */ | ||
+ | |||
+ | ** WebC3L1Q3: What web control should be used if clicking on an image is required? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: // | ||
====== IT Questions ====== | ====== IT Questions ====== | ||
Line 1742: | Line 3172: | ||
Answer: 2603 (Hex). | Answer: 2603 (Hex). | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** ITQ4: What are Robert Martin' | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | - You are not allowed to write a line of production code until you have written a failing unit test. | ||
+ | - You are not allowed to write more of the unit test than is sufficient to fail. | ||
+ | - You are not allowed to write more production code than is sufficient to pass the test. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** ITQ5: What is Conway' | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: " | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** ITQ6: What is the difference between //Cast// and //Convert// in T-SQL? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: //Cast// is ANSI compliant. //Convert// is specific to SQL Server and allows some formatting options. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091017 */ | ||
+ | |||
+ | ** ITQ7: What type of URL should destructive or data modifying operations be put behind and why? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: They should be put behind HTTP-POST requests because web-crawlers and search engines are not supposed to follow them. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20110708 */ | ||
+ | |||
+ | ** ITQ8: What should be looked for in a code review? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Correctness (only). | ||
====== Fractal Questions ====== | ====== Fractal Questions ====== | ||
Line 1778: | Line 3256: | ||
Answer: "What can **I** do about it?" | Answer: "What can **I** do about it?" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** LifeQ3: What is the effect / affect usage mnemonic? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: VANE - **V**erb **A**ffect **N**oun **E**ffect | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090915 */ | ||
+ | |||
+ | ** LifeQ4: If you are afraid of being embarrassed or laughed at, what will your art always be? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Embarrassing and laughable. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** LifeQ5: What two things should every person with a job be doing? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * The very best they can at their job. | ||
+ | * Looking for a better job. | ||
====== The Pragmatic Programmer ====== | ====== The Pragmatic Programmer ====== | ||
Line 1843: | Line 3352: | ||
Answer: Great software today. | Answer: Great software today. | ||
- | ===== Chapter 2 ===== | + | ===== Chapter 2: A Pragmatic Approach |
/* --== Answer Question separator ==-- */ | /* --== Answer Question separator ==-- */ | ||
Line 1957: | Line 3466: | ||
Answer: Determine how many people __need__ to be involved in discussing each change that is requested. The less people, the more orthogonal and better off the team is. | Answer: Determine how many people __need__ to be involved in discussing each change that is requested. The less people, the more orthogonal and better off the team is. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
** PragC2Q13: How can low orthogonality affect a team? ** | ** PragC2Q13: How can low orthogonality affect a team? ** | ||
Line 1963: | Line 3474: | ||
Answer: Confusion over responsibilities leading to bickering. | Answer: Confusion over responsibilities leading to bickering. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q14: What are three techniques to maintain orthogonality? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Keep code decoupled. | ||
+ | * Avoid global data. | ||
+ | * Avoid similar functions. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q15: How is orthogonality related to unit testing? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * If the unit test does not require much set up, the unit has a good amount of orthogonality. | ||
+ | * If the unit test has to bring in a big chunk of the system to set up the test, the unit has little orthogonality. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q16: What is code that glows in the dark? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Tracer code. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q17: What are the four aspects of code that tracer code should share with production code and what is the one aspect that it should not? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | Shared: error checking, structuring, | ||
+ | |||
+ | Not shared: Full functionality. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q18: What are the five advantages of tracer code? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Users get to see something early. | ||
+ | * Develops a build structure to work in. | ||
+ | * Creates an integration platform. | ||
+ | * Creates something to demonstrate. | ||
+ | * Creates a better feel for progress. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q19: What is the difference between tracer code and prototyping? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Prototyping generates disposable code. Tracer code is lean but complete and forms part of the skeleton of the final system. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q20: What are seven types of things that are good to prototype? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Risky, untried, critical, unproven, experimental, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q21: What are six parts of a system that are good to prototype? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * The architecture. | ||
+ | * New functionality in an existing system. | ||
+ | * The structure or contents of external data. | ||
+ | * Third-party tools or components. | ||
+ | * Performance issues. | ||
+ | * The user interface. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC2Q22: What are four aspects of coding that can, when appropriate, | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Correctness, | ||
+ | |||
+ | ===== Chapter 3: The Basic Tools ===== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC3Q1: What are the three benefits of plain text? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Insurance against obsolescence | ||
+ | * Leverage | ||
+ | * Easier testing | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** PragC3Q2: What are three situations that make tracing statements invaluable? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Concurrent processes | ||
+ | * Real-time systems | ||
+ | * Event-based applications | ||
+ | |||
+ | ===== Chapter 5: Bend or Break ===== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090929 */ | ||
+ | |||
+ | ** PragC5Q1: What is the Law of Demeter? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Any method of an object should call only methods belonging to: | ||
+ | |||
+ | * itself, | ||
+ | * any parameters that were passed into the method, | ||
+ | * any object it created, or | ||
+ | * any directly held component objects. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090929 */ | ||
+ | |||
+ | ** PragC5Q2: What is the response set of a class? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The number of functions directly invoked by methods of the class. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC5Q3: What us Levy's Eight Law? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | "No amount of genius can overcome a preoccupation with detail." | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC5Q4: What type of diagram can be used to determine temporal coupling? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A UML activity diagram. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC5Q5: What should be analysed to improve concurrency? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Workflow. | ||
+ | |||
+ | ===== Chapter 6: While You Are Coding ===== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC6Q1: What are three examples of programming by coincidence? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Accidents of implementation. | ||
+ | * Accidents of context. | ||
+ | * Implicit assumptions. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC6Q2: What should you do if something __seems__ to work? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Make sure it isn't just a coincidence. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC6Q3: What is the problem with the building metaphor of software development? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Buildings are not normally refactored. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC6Q4: What are four reasons for refactoring? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Duplication (violation of the DRY principle). | ||
+ | * Non-orthogonal design. | ||
+ | * Outdated knowledge. | ||
+ | * Performance. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** PragC6Q5: What are Martin Fowler' | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Don't refactor and add functionality at the same time. | ||
+ | * Make sure there are good tests beforehand. | ||
+ | * Take short, deliberate steps. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091012 */ | ||
+ | |||
+ | ** PragC6Q6: What four capabilities should a test harness include? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * A standard way to specify setup and clean up. | ||
+ | * A method for selecting individual tests or all available tests. | ||
+ | * A means of analysing output for expected (or unexpected) results. | ||
+ | * A standardised form of failure reporting. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091012 */ | ||
+ | |||
+ | ** PragC6Q7: What should be done at the end of any debugging session? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Formalise any ad hoc tests into unit tests. | ||
+ | |||
+ | ====== Professional ASP.NET MVC 1.0 ====== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100620 */ | ||
+ | |||
+ | ** MvcC1Q1: What are the six top-level directories, | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Controllers, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100620 */ | ||
+ | |||
+ | ** MvcC1Q2: Where does ASP.NET MVC store its routing rules? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: In the Global.asax file. | ||
====== Article 1: Design Principles and Design Patterns, Robert C. Martin ====== | ====== Article 1: Design Principles and Design Patterns, Robert C. Martin ====== | ||
Line 1994: | Line 3798: | ||
Answer: Dependency firewalls. | Answer: Dependency firewalls. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** Art1P4Q3: What is the Open Closed Principle and who came up with it? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //"A module should be open for extension, but closed for modification."// | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** Art1P5Q1: What is the key to the OCP? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Abstraction. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** Art1P8Q1: What is the Liskov Substitution Principle and who came up with it? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** Art1P8Q2: What is the canonical example of the subtleties of the LSP? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The Circle / Ellipse dilemma. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** Art1P12Q1: Violations of the LSP are also what? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Violations of the OCP. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | ** Art1P12Q2: What is the Dependency Inversion Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P12Q3: Which principle states the goal of object orientated architecture and which states the primary mechanism? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The goal is stated by the Open Closed Principle and the primary mechanism is stated by the Dependency Inversion Principle. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P14Q1: Where is the most common places that designs depend on concrete classes? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: When instances are created. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P14Q2: What is the Interface Segregation Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P16Q1: What means of organising a design has larger granularity than classes? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Packages. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P16Q2: What are the three principles of package architecture? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * The Release Reuse Equivalency Principle | ||
+ | * The Common Closure Principle | ||
+ | * The Common Reuse Principle | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P17Q1: What is the Release Reuse Equivalency Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //"The granule of reuse is the granule of release."// | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P17Q2: What is the Common Closure Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P17Q3: What is the Common Reuse Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P18Q1: Which package architecture principle or principles tends to advantage reusers and which tends to advantage maintainers? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Reusers are advantaged by the Release Reuse Equivalency Principle and the Common Reuse Principle. Maintainers are advantaged by the Common Closure Principle. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P18Q2: Which package architecture principle or principles tends to make packages large which tends to make them small? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The Common Closure Principle tends to make large packages and the Common Reuse Principle tends to make small packages. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P18Q3: Which package architecture principle or principles would architects tend to use in the early life of a system and which would they tend to use when the system has matured? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: In early life, the Common Closure Principle tends to be used. When the system has matured the Release Reuse Equivalency Principle and the Common Reuse Principle tend to be used. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P18Q4: What are the three principles of package coupling? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * The Acyclic Dependencies Principle | ||
+ | * The Stable Dependencies Principle | ||
+ | * The Stable Abstraction Principle | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P18Q5: What is the Acyclic Dependencies Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //"The dependencies between packages must not form cycles."// | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P21Q1: What are two methods for breaking a cycle in a package dependency structure? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Add a new package. | ||
+ | * Add a new interface that has all the methods that one package is dependant on and is implemented by the other package. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** Art1P21Q2: What design pattern should be used when a client type class directly depends on a server type class? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: An Abstract Server. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** Art1P21Q3: What is the Abstract Server design pattern and what is its advantage? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: An Abstract Server is an abstract interface between a client and a server. Its advantage is that the abstract interface becomes a "hinge point" that design can flex around. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P22Q1: Which package would an interface very often go in? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The package that uses it, rather than the package that implements it. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P22Q2: What is the Stable Dependencies Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P23Q1: What is a package that has three other packages depending on it said to be? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Responsible to those three other packages. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P23Q2: What is a package that depends on nothing said to be? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: An independent package. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P23Q3: What is a package that has no other packages depending on it said to be? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: An irresponsible package. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P23Q4: What is a package that has three other packages depending on it said to be? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A dependant package. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P23Q5: What is a package that is independent and responsible to other packages said to be? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: A stable package. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P23Q6: What is an irresponsible, | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: An instable package. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090917 */ | ||
+ | |||
+ | ** Art1P24Q1: What is the Stable Abstraction Principle? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | //" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P24Q2: What is afferent coupling? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The number of classes outside the package that depend on classes inside the package. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P24Q3: What is efferent coupling? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The number of classes outside the package that classes inside the package depend on. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P24Q4: What is the formula for determining the instability of a package? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Instability equals efferent coupling divided by afferent coupling plus efferent coupling. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P26Q1: What is the formula for determining the abstractness of a package? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Abstractness equals the number of abstract classes in the package divided by the total number of classes. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P26Q2: What type of packages occupy the zone of uselessness? | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Instable, abstract packages. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P26Q3: What type of packages occupy the zone of pain? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Stable, concrete packages. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20090925 */ | ||
+ | |||
+ | ** Art1P26Q4: What is the formula for determining the distance a package is from the main sequence? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The absolute value of the abstractness plus instability minus one. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** Art1P29Q1: What design pattern should be used when inserting an abstract interface is not feasible? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Adapter. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20091007 */ | ||
+ | |||
+ | ** Art1P29Q2: What is the Adapter design pattern? ** | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The Adapter is an object that implements the abstract interface to delegate to the server. Every method of the adapter simply translates and then delegates. | ||
+ | |||
+ | ====== 59 Seconds - Think a little, change a lot, Professor Richard Wiseman ====== | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecHappinessQ1: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Low self-esteem. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecHappinessQ2: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: By buying experiences, | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecHappinessQ3: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Smile, sit up and act happy. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecPersuasionQ1: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Likeability is more important than academic achievements and work experience. | ||
+ | * Reveal weaknesses early and strengths late. Retain something strong for the end. | ||
+ | * Don't overreact to mistakes - the interviewer probably didn't notice. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecPersuasionQ2: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: When criticising someone else, observers will attribute the negative traits to the speaker. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecPersuasionQ3: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Getting someone to do you a favour will increase the chance of them liking you. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecPersuasionQ4: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: The occasional mistake can make you more likeable. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecPersuasionQ5: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Pick out a friendly face in the crowd. Clearly tell them what is happening and what they need to do. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecMotivationQ1: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Work on the activity for "just a few minutes" | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecMotivationQ2: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: | ||
+ | |||
+ | * Have a plan. | ||
+ | * Tell friends a family. | ||
+ | * Doublethink. Focus on the benefits //and// potential setbacks. | ||
+ | * Reward each step of the way. | ||
+ | |||
+ | /* --== Answer Question separator ==-- */ | ||
+ | |||
+ | /* Added 20100106 */ | ||
+ | |||
+ | ** 59SecMotivationQ3: | ||
+ | |||
+ | /* --== Question Answer separator ==-- */ | ||
+ | |||
+ | Answer: Doublethink. Imagine both the potential benefits from achieving the goal //and// the potential setbacks that may occur along the way. | ||
{{tag> | {{tag> |
study_questions.1249946727.txt.gz · Last modified: 2017/01/01 19:53 (external edit)