9004554577, Get Adorable Call Girls service. Book call girls & escort service...
Prueba de conociemientos Fullsctack NET v2.docx
1. Test Knowledge C# - Backend
Requirements for test:
- Visual Studio 2019 - SQL Express
- Management Studio
PART A – Basic Knowledge
1. You are creating a complex query that doesn’t require any particular order and you
want to run it in parallel. Which method should you use?
a) AsParallel
b) AsSequential
c) AsOrdered
d) WithDegreeOfParallelism
2. You need to implement cancellation for a long running task. Which object do you
pass to the task?
a) CancellationTokenSource
b) CancellationToken
c) Boolean isCancelled variable
d) Volatile
3. You need to iterate over a collection in which you know the number of items. You
need to remove certain items from the collection. Which statement do you use?
a) switch
b) foreach
c) for
d) goto
4. You have declared an event on your class, and you want outside users of your class
to raise this event. What do you do?
a) Make the event public.
b) Add a public method to your class that raises the event.
c) Use a public delegate instead of an event.
d) Use a custom event accessor to give access to outside users.
5. Your code catches an IOException when a file cannot be accessed. You want to
give more information to the caller of your code. What do you do?
a) Change the message of the exception and rethrow the exception.
2. b) Throw a new exception with extra information that has the IOException as
InnerException.
c) Throw a new exception with more detailed info.
d) Use throw to rethrow the exception and save the call stack.
6. Suppose you want to sort the Recipe class by any of the properties MainIngredient,
TotalTime, or CostPerPerson. In that case, which of the following interfaces would
probably be most useful?
a) IDisposable
b) IComparable
c) IComparer
d) ISortable
7. What is the final result by execute next code:
a) Error compilation
b) Return string if call contain using await
c) Return a Task and execute code synchronous
d) Can not using async for static Methods
e) C# not return Task
public static async Task<string> DownloadContent()
{
using(HttpClient client= new HttpClient())
{
string result= await client.GetStringAsync(“http://www.microsoft.com”);
return result;
} }
8. In a multithreaded application how would you increment a variable called counter in
a lock free manner? Choose all that apply.
a) lock(counter){counter++;}
b) counter++;
c) Interlocked.Add(ref counter, 1);
d) Interlocked.Increment (counter);
e) Interlocked.Increment (ref counter);
9. If I need create similar to the way a database connection pooling works but using
Task, what is a better option?
a) ThreadPool
b) TaskFactory;
3. c) List<Task>);
d) ITaskConcurrent;
e) Thread;
10. What is correct sentence for next code?
a) finalTask.WaitAll()
b) finalTask.WaitChild()
c) finalTask.Wait()
d) await finalTask;
e) await finalTask.WaitAll();
Task<Int32[]> parent = Task.Run(() =>
{
var results = new Int32[3];
TaskFactory tf = new TaskFactory(TaskCreationOptions.AttachedToParent,
TaskContinuationOptions.ExecuteSynchronously); tf.StartNew (() =>
results[0] =0); tf.StartNew (() =>results[1] =1); tf.StartNew (() =>
results[2] =2); return results;
});
var finalTask = parent.ContinueWith(
parentTask=> {
foreach(int iin parentTask.Result)
Console.WriteLine(i);
});
____________________________
11. Which code can create a lambda expression?
a) delegate x = x => 5 + 5;
b) delegate MySub(double x); MySub ms = delegate(double y) { y * y; }
c) x => x * x;
d) delegate MySub(); MySub ms = x * x;
12. Which collection would you use if you need to quickly find an element by its key
rather than its index?
4. a) Dictionary
b) List
c) SortedList
d) Queue
13. My.com is a company with kind of 20 TPS and have error for access a list, how to
improve performance and robust
a) Using lock by list
b) Controller error though try catch
c) BlockingCollection<T>
d) ConcurrentBag<T>
14. Which ADO.NET object is a fully traversable cursor and is disconnected from the
database?
a) DBDataReader
b) DataSet
c) DataTable
d) DataAdapter
15. Which clause orders the state and then the city?
a) orderby h.State orderby h.City
b) orderby h.State thenby h.City
c) orderby h.State, h.City
d) orderby h.State, thenby h.City
16. What is property correct for this sentence
a) IsCancellationRequested
b) IsCancel
c) Syntaxis is damaged
d) StatusRequested
Task task = Task.Run(() =>
{
while(!token.__________________)
{
Console.Write(“*”);
Thread.Sleep(1000);
}
5. }, token);
Console.WriteLine(“Press enter to stop the task”);
Console.ReadLine();
cancellationTokenSource.Cancel();
Console.WriteLine(“Press enter to end the
application”);
Console.ReadLine();
17. Which of the following regular expressions matches license plate values that must
include three uppercase letters followed by a space and three digits, or three digits
followed by a space and three uppercase letters?
a) (^d{3} [A-Z]{3}$)|(^[A-Z]{3} d{3}$)
b) ^d{3} [A-Z]{3} [A-Z]{3} d{3}$
c) ^w{3} d{3}|d{3} w{3}$
d) ^(d{3} [A-Z]{3})?$
18. You have declared an event on your class, and you want outside users of your class
to raise this event. What do you do?
a) Make the event public.
b) Add a public method to your class that raises the event.
c) Use a public delegate instead of an event.
d) Use a custom event accessor to give access to outside users.
19. What describes a strong name assembly?
a) Name
b) Version
c) Public key token
d) Culture
e) Processor Architecture
f) All the above
20. You have declared an event on your class, and you want outside users of your class
to raise this event. What do you do?
a) Make the event public
b) Add a public method to your class that raises the event.
c) Use a public delegate instead of an event.
d) Use a custom event accessor to give access to outside users.
6. 21. The IEnumerable and IEnumerator interface in .NET helps you to implement the
iterator pattern, which enables you to access all elements in a collection without
caring about how it’s exactly implemented. You can find these interfaces in the
System.Collection and System.Collections. Generic namespaces. When using the
iterator pattern, you can just as easily iterate over the elements in an array, a list, or
a custom collection. It is never used in LINQ, which can access all kinds of
collections in a generic way without actually caring about the type of collection.
a) True
b) False
22. What is this method for?
a) Create class
b) Finalizer
c) Ignore errors
d) Execute garbage collector.
7. PART B – ASP NET Knowledge
23. What is the technique in which the client sends a request to the server, and the
server holds the response until it either times out or has information to send to the
client is?
a) HTTP polling.
b) HTTP long polling
c) WebSockets
d) HTTP request-response
e) HTTP2
24. What is the first request sent to start HTTP polling?
a) HTTP DELETE.
b) HTTP GET
c) HTTP CONNECT
d) Upgrade request
25. You create a LINQ query as follows. Which of the statements is correct?
a) A foreach loop is needed before this query executes against the database.
b) NavigationProperty needs to be referenced before this query executes
against the database
c) The query returns results immediately
d) It depends on whether the LazyLoadingEnabled property is set.
var query = (from acct in context.Accounts
where acct.AccountAlias == "Primary"
selectAcct).FirstOrDefault();
26. Assume you call the Add method of a context on an entity that already exists in the
database. Which of the following is true? (Choose all that apply.)
a) A duplicate entry is created in the database if there is no key violation.
b) If there is a key violation, an exception is thrown
c) The values are merged using a first-in wins approach.
d) The values are merged using a last-in wins approach.
27. What happens if you attempt to Attach an entity to a context when it already exists
in the context with an EntityState of unchanged?
a) A copy of the entity is added to the context with an EntityState of
unchanged.
b) A copy of the entity is added to the context with an EntityState of Added.
c) Nothing happens and the call is ignored.
8. d) The original entity is updated with the values from the new entity, but a copy
is not made. The entity has an EntityState of Unchanged.
28. The application you’re working on uses the EF to generate a specific DbContext
instance. The application enables users to edit several items in a grid and then
submit the changes. Because the database is overloaded, you frequently experience
situations that result in only partial updates. What should you do?
a) Call the SaveChanges method of the DbContext instance, specifying the
UpdateBehavior.All enumeration value for the Update behavior.
b) Use a TransactionScope class to wrap the call to update on the DbContext
instance.
c) Create a Transaction instance by calling the BeginTransaction method of the
DbContext Database property. Call the SaveChanges method; if it is
successful, call the Commit method of the transaction; if not, call the
Rollback method.
d) Use a TransactionScope class to wrap the call to SaveChanges on the
DbContext. Call Complete if SaveChanges completes without an exception.
29. The application you’re working on uses the EF. You need to ensure that operations
can be rolled back if there is a failure and you need to specify an isolation level.
Which of the following would allow you to accomplish this? (Choose all that
apply.)
a) A EntityTransaction.
b) A TransactionScope.
c) A SqlTransaction.
d) A DatabaseTransaction.
30. Which interfaces must be implemented in order for something to be queried by
LINQ? (Choose all that apply.)
a) IEnumerable.
b) IQueryable.
c) IEntityItem.
d) IDbContextItem.
9. 31. Next code is used for:
a) Create Action Register
b) Create a Route in which the action name.
c) Create Method for configuration request
d) Create Register Website.
public static void
Register(HttpConfiguration
config)
{
config.Routes.MapHttpRout
e( name:"NamedApi",
routeTemplate:
"api/{controller}/{action}/{id}"
, defaults:new { id =
RouteParameter.Optional }
);
config.EnableSystemDiagn
osticsTracing();
}
10. PART C – PRACTICE
Required manage
a) .NET 5
b) SQL Server
c) C#
d) nUnit
For the practical exercise, take into account the following evaluation criteria:
a) Architecture
b) Structure
c) Documentation Code
d) Best Practices
e) Manage Performance
f) Unit Test
g) Security
A bank company requires creating an API to obtain information about properties in the
Colombia, this is in a database as shown in the image, its task is to create a set of services,
additional create a front end in react or angular (marked to *):
a) Create Property Building *
b) Add Image from property
c) Change Price
d) Update property
e) List property with filters*
Note: Complete data type depend on your criteria and add field according for your
consideration
11. Release
Send solution with project in zip file or upload from github or other similar site. Attach
database backup. if is necessary specify steps for run project when download.
GOOD LUCK!