Programming in C#: Exam 483

Beschreibung

Quiz am Programming in C#: Exam 483, erstellt von R M am 08/01/2015.
R M
Quiz von R M, aktualisiert more than 1 year ago
R M
Erstellt von R M vor mehr als 9 Jahre
12
1

Zusammenfassung der Ressource

Frage 1

Frage
What is the mechanism of ensuring that two threads don't execute portions of a program at the same time?
Antworten
  • Synchronization
  • Alignment
  • Hazard-Checking
  • Paralellization

Frage 2

Frage
Can you pass an integer to a thread as a parameter?
Antworten
  • Yes, but only as an Object. It must be cast inside the thread.
  • Yes.
  • No.
  • No, unless it is a foreground thread.

Frage 3

Frage
What does the [Threadstatic] attribute in a variable entail?
Antworten
  • Each copy of a spawned thread has its own copy of a field.
  • Each copy of a spawned thread can manipulate the field.
  • The field can only be modified by one thread at a time.
  • The field can be modified by the main thread, or any spawned foreground threads.

Frage 4

Frage
How would you add a sequence to a Task?
Antworten
  • .ContinueWith((FirstTask){ //Func })
  • .NextTask((FirstTask){ //Func })
  • .Continue((FirstTask){ //Func })
  • .Then((FirstTask{ //Func })

Frage 5

Frage
Which are acceptable overloads of the .ContinueWith function?
Antworten
  • TaskContinueationOptions.OnlyCancelled
  • TaskContinueationOptions.OnlyOnFaulted
  • TaskContinueationOptions.OnlyRanToCompletion
  • TaskContinueationOptions.OnlyBlocked
  • TaskContinueationOptions.OnlyStopped
  • TaskContinueationOptions.OnlyCompleted
  • TaskContinueationOptions.OnlyOnCompletion

Frage 6

Frage
What does a task object do?
Antworten
  • Spawn a new thread.
  • Spawn a new process.
  • Nothing, it's syntactic sugar
  • Provides a method of managing thread resources.

Frage 7

Frage
What principles should you keep in mind while creating an asynchronous method?
Antworten
  • Always use await statements.
  • Avoid returning void.
  • Be sure to test to ensure a performance increase.
  • Return a Task or Task<T>

Frage 8

Frage
ConcurrentStacks allow enumeration
Antworten
  • True
  • False

Frage 9

Frage
You havve a lot of items that need to be processed. For each item, you need to perform complex arithmetic that takes up moderate CPU time. Which technique should you use?
Antworten
  • Create a Task for each item, and wait till all of them are finished
  • Use a Parallel.For to process all items concurrently
  • Use Async/Await to process all items concurrently
  • Add all items to a BlockingCollection and process them on a thread created by the thread class.

Frage 10

Frage
You are creating a complex query that doesn't require any particular order, and you want to run it as parallel. Which method should you use?
Antworten
  • AsParallel
  • AsSequential
  • AsOrdered
  • WithDegreeOfParallelism

Frage 11

Frage
In an ASP.NET project, your application retrieves data from a remote server and writes the response to a database. Should you use the Async/Await keywords for processing?
Antworten
  • Yes, this will free your thread to serve other requests while waiting for a naturally occurring I/O bottleneck.
  • No, both operations depend on external factors. You must wait before they are finished.
  • No, in a server application you don't have to use async/await, as the keywords are primarily used in client applications.
  • Yes, this puts your thread to sleep while waiting for I/O so it uses no CPU time.

Frage 12

Frage
What does the volatile keyword do?
Antworten
  • Ensures that individual copies of a variable are stored in memory
  • Disables compiler optimizations that assume a single-threaded application
  • Ensures a variable is never added to a swap file on a disk
  • Informs the compiler that the variable will be heavily accessed

Frage 13

Frage
Is var++ an atomic operation?
Antworten
  • True
  • False
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

What is a Computer?
cscutt
Core Spring 4.2 Certification Mock Exam
antoine.rey
Digital Media Sales Exam Certification
steven_sexton
Programming in C# Exam 70-483 Q&A
Richard Brown
Ц_ЕПМБПС_10 часть 1
Andrey Tamashenko
Microsoft Excel Basics
anvithavinod24
Ц_ЕПМБПС_10 часть 2
Andrey Tamashenko
Online course: Administration Essentials for the Service Cloud
Saulo Oliveira
70-410 - MCSA: Windows Server 2012 - Installing and Configuring - Exam 2
Mike M
70-410 - MCSA: Windows Server 2012 - Installing and Configuring - Exam 3
Mike M
70-410 - MCSA: Windows Server 2012 - Installing and Configuring - Exam 1
Mike M