User Tools

Site Tools


study_questions_audio_creation

This is an old revision of the document!


Study Questions - Audio Creation

CDEx Settings

Bitrate = 80 kbps

Mono

Quality = Very high (q = 0)

Questions To Be Recorded

Lesson 1: Navigating the File System

C2L1Q1: How do you enumerate the drives in a system?

Answer: Call the DriveInfo.GetDrives method.

C2L1Q2: How do you enumerate the files in a particular directory?

Answer:

  1. Create a new DirectoryInfo object, specifying the directory in the constructor.
  2. Call the GetFiles method on the DirectoryInfo object, which returns a collection of FileInfo objects.

C2L1Q3: How would you determine the size of a particular file in the file system?

Answer:

  1. Create a new FileInfo object, specifying the path to the file in the constructor.
  2. Examine the FileInfo's Length property.

C2L1Q4: How do you copy a file?

Answer:

  1. Create a new FileInfo object, specifying the path to the source file in the constructor.
  2. Call the FileInfo's CopyTo method, specifying the path to the destination file.

C2L1Q5: What are the high level steps required to monitor a directory for changes?

Answer:

  1. Create a FileSystemWatcher object.
  2. Set the Path property.
  3. Register for the event that you are interested in.
  4. Set the EnableRaisingEvents property to true.

C2L1Q6: How do you create a DriveInfo object for a specific drive?

Answer: Create a new DriveInfo object, specifying the drive letter in the constructor.

C11L2Q6: [Replacement] CAS declarations are only significant in what type of assemblies?

Answer: Partially trusted assemblies.

C11L3Q9: [Replacement] 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?

Answer:

  • RequestRefuse (assembly) is equivalent to Deny (class and methods).
  • RequestOptional (assembly) is equivalent to PermitOnly (class and methods).
  • RequestMinimum (assembly) is equivalent to Demand (class and methods).

C10L2Q5: [Replacement] What does the DebuggerHidden attribute do?

Follow up question: How is it different from the DebuggerStepThrough attribute?

Answer: It causes the debugger to step through the code for the class, method or property it decorates, and causes the debugger to ignore any breakpoints in the code.

Follow up answer: The DebuggerStepThrough attribute will not cause debugger to ignore any breakpoints in the code.

C10L2Q6: [Replacement] What does the DebuggerStepThrough attribute do?

Follow up question: How is it different from the DebuggerHidden attribute?

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 DebuggerHidden attribute will cause debugger to ignore any breakpoints in the code.

C10L2Q7: [Replacement] How do you prevent the debugger from breaking inside a class, method or property, even if there is a breakpoint?

Answer: Add a DebuggerHidden attribute to the class, method or property.

C10L2Q8: [Replacement] How do you prevent the debugger from breaking inside a class, method or property, but still stop on any breakpoints?

Answer: Add a DebuggerStepThrough attribute to the class, method or property.

C10L2Q9: How do you add a DebuggerHidden or DebuggerStepThrough attribute to a property?

Answer: Decorate either or both of the accessor methods with the attribute.

Lesson 3: Working with Dictionaries

C4L3Q1: When iterating over a Hashtable, what order are entries returned in, by default?

Answer: The order of the hash values.

C4L3Q2: What are the five non-generic, non-specialised dictionary collections, what is each used for and what is the generic equivalent?

Answer:

  • Hashtable, used for simple basic dictionaries, Dictionary<>.
  • SortedList, used for dictionaries that are sorted by key, SortedList<> and SortedDictionary<>.
  • ListDictionary, used for small dictionaries, Dictionary<>.
  • HybridDictionary, used for dictionaries of unknown or varying size, Dictionary<>.
  • OrderedDictionary, used where direct control of the order is required, Dictionary<>.

C4L3Q3: What type of object does a non-generic dictionary collection contain?

Answer: DictionaryEntry

C4L4Q6: [Replacement] What are the five specialised collections and their generic equivalent?

Answer:

  1. BitArray, no generic equivalent.
  2. BitVector32, no generic equivalent.
  3. StringCollection, equivalent to List<String>.
  4. StringDictionary, equivalent to Dictionary<String>.
  5. NameValueCollection, equivalent to Dictionary<>.

C4L5Q3: What are the three non-specialised, non-directory, non-generic collections and their generic equivalent?

Answer:

  1. ArrayList, equivalent to List<>.
  2. Queue, equivalent to Queue<>.
  3. Stack, equivalent to Stack<>.

ITQ4: What are Robert Martin's three laws of Test Driven Development?

Answer:

  1. You are not allowed to write a line of production code until you have written a failing unit test.
  2. You are not allowed to write more of the unit test than is sufficient to fail.
  3. You are not allowed to write more production code than is sufficient to pass the test.

Extension

C4XQ1: What does the compiler do when an iterator is implemented?

Answer: Automatically generates the Current, MoveNext and Dispose methods of the IEnumerable interface.

C4XQ2: How do you implement an iterator?

Answer:

  1. Implement the IEnumerable interface.
  2. Create a method called GetEnumerator which returns an IEnumerator.
  3. Use the yield return statement to return each element.
  4. If required, use the yield break to end the iteration.

C1XQ1: What is the primary purpose of a delegate?

Answer: To facilitate event handling.

PragC2Q14: What are three techniques to maintain orthogonality?

Answer:

  • Keep code decoupled.
  • Avoid global data.
  • Avoid similar functions.

PragC2Q15: How is orthogonality related to unit testing?

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.

C4XQ3: What are two ways that the default iterator functionality can be extended?

Answer:

  1. Named iterators can be created which allows a class to have multiple iteration techniques.
  2. Parameterised iterators can be created which allows clients control over some or all of the iteration behaviour.

C1L3Q3: If an event needs to pass custom data, what class should be derived from and what is the naming convention?

Answer: EventArgs should be derived from and the naming convention is {EventName}EventArgs.

C1L3Q4: What is the naming convention for a delegate for an event?

Answer: {EventName}Handler

C1L3Q5: What two things should be done to allow a class to raise an event?

Answer:

  1. A public event needs to be declared.
  2. A protected On{EventName} method should be created.
study_questions_audio_creation.1251423204.txt.gz · Last modified: 2017/01/01 19:54 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki