MCSD MCSD 5 — Questions and Answers
Question 1: In C#, which collection type provides O(1) average-time complexity for lookup operations using key-value pairs?
- List<T>
- Queue<T>
- Dictionary<TKey, TValue> (Correct answer)
- LinkedList<T>
Correct answer: Dictionary<TKey, TValue>
Dictionary<TKey, TValue> uses a hash table internally, providing O(1) average-case performance for get and set operations.
Question 2: Which Azure DevOps feature provides a kanban-style board for tracking work items and sprint planning?
- Azure Repos
- Azure Pipelines
- Azure Boards (Correct answer)
- Azure Artifacts
Correct answer: Azure Boards
Azure Boards provides agile planning tools including Kanban boards, backlogs, and sprint planning for tracking work items.
Question 3: What does the 'sealed' keyword prevent when applied to a C# class?
- The class from being instantiated
- Other classes from inheriting from it (Correct answer)
- Methods from being overridden
- The class from implementing interfaces
Correct answer: Other classes from inheriting from it
The 'sealed' modifier prevents other classes from deriving from the marked class, effectively closing the inheritance chain.
Question 4: In a RESTful API, which HTTP method is idempotent and should be used to fully replace an existing resource?
- POST
- PATCH
- DELETE
- PUT (Correct answer)
Correct answer: PUT
PUT is idempotent and replaces the entire resource at the specified URI with the provided representation.
Question 5: In Entity Framework Code First, what attribute specifies that a property is the primary key of the entity?
- [Required]
- [Key] (Correct answer)
- [Index]
- [ForeignKey]
Correct answer: [Key]
The [Key] attribute designates a property as the primary key of the entity in Entity Framework Code First conventions.
Question 6: Which JavaScript concept allows a function to access variables from its outer scope even after the outer function has returned?
- Prototypal inheritance
- Hoisting
- Closure (Correct answer)
- Currying
Correct answer: Closure
A closure is a function that retains access to the variables of its enclosing scope even after that scope has exited.
Question 7: Which Azure messaging service decouples application components using a publish-subscribe model where multiple subscribers can receive the same message?
- Azure Service Bus Queues
- Azure Event Hubs
- Azure Service Bus Topics (Correct answer)
- Azure Queue Storage
Correct answer: Azure Service Bus Topics
Azure Service Bus Topics implement a publish-subscribe pattern, allowing one message to be delivered to multiple subscriptions.
In C#, which collection type provides O(1) average-time complexity for lookup operations using key-value pairs?