Practice Questions

Question 1

One of the other developers on the team asked you about team coding standards. Assuming you conformed to the Microsoft standards, which of the following statements would apply? (Choose all that apply.)

  • A. If the user specifies a file that cannot be found, throw an exception to the calling code.

  • B. All code must be checked into SourceSafe each night.

  • C. Camel case is used for all public properties.

  • D. Pascal case is to be used for all class names.

  • E. Custom exceptions should inherit from the ApplicationException base class.

A1:

The correct answers are D and E. Answer B is not a coding standard, and answer C is incorrect. The other two are coding standards mentioned in the chapter and reviewed by FxCop. Answer A is incorrect because exceptions should not be used for events that might be expected during the normal course of operation. In this example, before attempting to access the file, its existence should be verified.

Question 2

A good unit test should include which of the following checks? (Choose two.)

  • A. Verify that all the necessary files deploy successfully with the MSI package.

  • B. Check each method and property by passing in different valuessome valid, some invalid.

  • C. Test for the expected return value from each function.

  • D. Test in an environment that is as close to the user's environment as possible.

  • E. Test that your latest code changes did not break some other part of the application.

A2:

The correct answers are B and C. Answer A would have to be considered a deployment test. Answer D is a description of a QA test, and answer E describes an assembly (or regression) test.

Question 3

Which of the following items seem most crucial to a successful solution for Charles Laboratories? (Choose two.)

  • A. Security

  • B. Performance

  • C. Accessibility

  • D. Extensibility

  • E. Deployability

A3:

The correct answers are A and D. Although all the answers have some place in the solution, the two most explicitly stated factors were security, because of the risk of theft, and extensibility, because the first release is only the beginning. Additional features are planned after the core solution is deployed.

Question 4

Which of the following values would represent the expected ROI of the solution at Charles Laboratories?

  • A. $500,000

  • B. $750,000

  • C. -$250,000

  • D. $250,000

  • E. Break even

A4:

The correct answer is D. The case study points out that savings are expected to be $250,000 annually over a three-year period, or $750,000. The cost of the solution is $500,000. Therefore, the ROI is $250,000, or 1.5.

Question 5

List the following steps in the correct order in which they would be accomplished during the development process.

  • A. Coding

  • B. Release process

  • C. QA testing

  • D. Unit testing

  • E. Design documentation

  • F. Code inspections

A5:

The correct order is E, A, F, D, C, B. Other processes, such as the build process and issue tracking, also occur concurrently throughout the later project phases.

Question 6

What would be the main reason for using Enterprise Templates at Charles Laboratories?

  • A. Charles Laboratories is not a good candidate for Enterprise Templates.

  • B. There are more than two or three people on the team, and they would make the team more productive.

  • C. There is a requirement for a Windows client solution, and Enterprise Templates work best in this setting.

  • D. Most of the developers are new to .NET, except for one senior architect.

  • E. Enterprise Templates have policies, which will make the application more secure.

A6:

The correct answer is D. The case study tells you that you have one senior .NET developer/architect and six developers who are new to the language. Enterprise Templates help get productivity up more quickly with the new developers. Although answer B is correct, it is not the "main" reason. Answer E is wrong because Enterprise Template policies have nothing to do with application security policies. There is no reason to expect that Enterprise Templates are any more or less valuable in a Windows client application than in a Web application, so answer C is not correct.

Question 7
graphics/trick_icon.gif

One of the programmers, Perry, has been described as a bit of a cowboy (unstructured) programmer. How would standards on the Charles Laboratories development team help prevent his programming style from becoming a problem? (Choose the best two responses.)


  • A. Enterprise Templates would increase the chances that Perry would conform to team standards.

  • B. Visual SourceSafe would not allow Perry to check in code, thus overwriting other team members' work.

  • C. Coding standards would keep Perry's work in line with the others on the team.

  • D. Good exception-handling patterns would catch any inadvertent errors in Perry's code.

  • E. Design and code inspections would subject Perry's work to the scrutiny of others.

A7:

The correct answers are A and E. This question is a tough one because answers C and D appear to be valid choices, but C is not the answer because having standards in place does not ensure that they are followed. Answer D is not correct because even if it's true, it is not a desirable best practice to plan on catching errors after the code is already in place. Answer B is not correct because Visual SourceSafe does not safeguard against one developer overwriting another developer's code; it only provides a structure. Good processes are still required. Answers A and E are correct statements.

Question 8

Which of the following would be the best-fit solution at Charles Laboratories?

  • A. ASP.NET application

  • B. ASP.NET combined with XML Web Services

  • C. .NET Windows Forms application

  • D. XML Web Services

A8:

The correct answer is C. Because all users are in house and security is so crucial, there are no overriding reasons to create a Web or Web Services application.

graphics/note_icon.gif

The remainder of the questions in this section apply to the Billington Pharmaceuticals master case study, described right after this book's Introduction.


Question 9

A junior developer from the Billington team asked you about team coding standards. Assuming you conformed to the Microsoft standards, which of the following statements would apply? (Choose all that apply.)

  • A. Use camel case for all method parameters.

  • B. Use Hungarian notation prefixes for internal, hidden variables.

  • C. GetTimeOfDay() is better as a method than a property.

  • D. If errors are encountered in a method call, return a non-zero value.

  • E. Put all cleanup code in the Class_Terminate event.

A9:

The correct answers are A and C. Camel case is the correct choice for parameters (arguments), so answer A is a valid standard. Because the time of day changes continuously, GetTimeOfDay() should be considered a method instead of a property. Properties are reserved for representing persisted "state." Answer B is not correct because Microsoft no longer recommends using Hungarian notation. Answers D and E are both practices from the past that no longer apply; there is no longer a terminate event in classes, and using a return value to denote status is no longer considered a best practice.

Question 10

Which of the following challenges to implementing consistent coding standards do you see in the Billington Pharmaceuticals case study? (Choose two.)

  • A. Many of the developers are new to .NET.

  • B. Developers from two different teams and two different languages need to agree on standards.

  • C. Developers are spread out geographically, so reviews are harder to perform.

  • D. Code inspections increase the chance of missing the deadline.

  • E. Integration with the mainframe makes implementing coding standards more difficult.

A10:

The correct answers are A and B. There is nothing to suggest that a new developer poses a danger to standards. In fact, overall, new developers are a plus, as the code without standards might be less consistent. The mixture of mainframe, ASP, and VBScript developers with JavaScript developers is definitely a challenge because old habits are already ingrained. Therefore, answers A and B are most correct. Nothing in the case study suggests that the developers are not all in the same facility, and there is also no indication of mainframe integrationthe mainframe is to be retired after the solution is complete. Therefore, answers C and E are incorrect. Answer D is incorrect because code inspections, if done properly, will likely decrease the chance of missing the deadline. Code and design errors are caught earlier in the process.

Question 11

Which of the following Visual SourceSafe practices would be good for the team at Billington to implement? (Choose all that apply.)

  • A. Wait until other developers have done a checkin before doing a checkout to make code changes.

  • B. Use Visual SourceSafe's Get Differences feature to make sure you don't overwrite another's code.

  • C. Divide the coding effort to minimize the times that two developers are working in the same module (class).

  • D. Have any code changes inspected before being checked into Visual SourceSafe.

  • E. Store design documents in Visual SourceSafe as well as code.

A11:

The correct answers are A, C, D, and E. Only answer B leads to possible hazards. All the other answers provide for higher-quality code with fewer chances for errors.

Question 12

Which of the following is the biggest risk to the Billington solution that would be mitigated by having good standards?

  • A. Developers overwriting each other's code in source control

  • B. Having each developer write code based on his or her own "style"

  • C. Meeting the deadline

  • D. Having poor-quality code go into production

A12:

The correct answer is D. Answer A applies more to processes than standards, so it is not the correct choice. Standards do not directly allow you to complete code sooner (although the code might get 100% debugged sooner). Therefore, although answer C is close, it is not the biggest risk. Answer B is even closer to the mark, but the end goal is not to have all code look the same for its own sake, but because maintaining the same code style in turn creates higher-quality code. Higher-quality code doesn't break as often, and if it does, is easy to fix. Therefore, the "most correct" response is answer D.

Question 13

Which of the following items seem most crucial to a successful solution for Billington? (Choose two.)

  • A. Security

  • B. Maintainability

  • C. Extensibility

  • D. Performance

  • E. Availability

A13:

The correct answers are A and E. Although answers B, C, and D are likely important, answers A and E cover more important factors: security, because you are dealing with lethal drugs and people's prescriptions, and availability, because it was explicitly mentioned in the case study.

Question 14

You have proposed that the Billington solution implement a system whereby each code module that uses another class must explicitly request that class's cleanup. Which of the following patterns are you recommending?

  • A. The Singleton pattern

  • B. The Model-View-Controller (MVC) pattern

  • C. The Factory pattern

  • D. The Timeout pattern

  • E. The Finalize and Dispose pattern

A14:

The correct answer is E. The Finalize and Dispose pattern calls for exposing an explicit .Dispose method. This pattern replaces the implied "destroy" that took place in COM technology when the reference count reached zero. Answer B, the MVC pattern, is a well-known pattern for designing layered solutions, but is not the correct answer to the question.

Question 15

Which of the following languages in the Billington IT system (present and future) are the most conducive to enforced coding standards?

  • A. JavaScript

  • B. C#

  • C. VBScript

  • D. ASP

  • E. Visual C++

A15:

The correct answer is B. Because of Enterprise Templates, the Option Strict "switch," and FxCop, it is easiest to enforce standards in C# (or Visual Basic .NET).



Analyzing Requirements and Defining. Net Solution Architectures (Exam 70-300)
MCSD Self-Paced Training Kit: Analyzing Requirements and Defining Microsoft .NET Solution Architectures, Exam 70-300: Analyzing Requirements and ... Exam 70-300 (Pro-Certification)
ISBN: 0735618941
EAN: 2147483647
Year: 2006
Pages: 175

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net