Đề Thi FE PRN222 - SP26 - B5 - FE - RE

adminadmin is verified member.

Member
Thành viên BQT
Administrator
Học kỳ
SP2026
Thời Gian
4/5/26
Loại tài liệu
FE
Mã Đề
PRN222_SP26_B5RE_371829
PRN222 SP26 B5 FE RE
1. (Choose 1 answer)

Given the code: builder.Services.AddScoped<IOrderService, OrderService>(); How will OrderService behave?
A. Same instance for the entire application
B. New instance for each HTTP request
C. New instance every time injected
D. Thread-local instance
2. (Choose 1 answer)

services.AddTransient<ILogger, ConsoleLogger>(); What does this code do?
A. Registers ILogger so that each request gets a new ConsoleLogger instance
B. Registers ILogger as a singleton
C. Registers ConsoleLogger directly without abstraction
D. Throws an error since ILogger is abstract
3. (Choose 1 answer)

Which of the following is an example of a situation where a Scoped service lifetime would be appropriate?
A. A global application configuration.
B. A request-specific database context in a web application.
C. A stateless utility service.
D. A single instance of a logger.
4. (Choose 1 answer)

What is the main goal of Inversion of Control (IoC)?
A. To increase performance
B. To invert object creation responsibility
C. To remove polymorphism
D. To disable inheritance
5. (Choose 1 answer)

What is "Constructor Injection"?
A. Injecting dependencies via properties.
B. Injecting dependencies via method parameters.
C. Injecting dependencies through a class's constructor.
D. Injecting dependencies at runtime.
6. (Choose 1 answer)

With AddTransient<EmailService, EmailService>(), injecting into a controller twice will produce:
A. The same instance
B. Different instances
C. Null references
D. Runtime error
7. (Choose 1 answer)

What is the purpose of the @page directive in a Blazor component?
A. To define a database connection.
B. To specify the route for the component.
C. To encrypt data.
D. To manage user sessions.
8. (Choose 1 answer)

What is a potential disadvantage of Blazor WebAssembly compared to Blazor Server?
A. Higher server load.
B. Initial download size and performance.
C. Limited browser compatibility.
D. Lack of SignalR support.
9. (Choose 1 answer)

Which of the following best describes the “C# Everywhere” feature of Blazor?
A. You can only use C# on the server, not the client.
B. C# can be used for both client-side and server-side logic.
C. C# must be compiled into JavaScript first.
D. Blazor only supports JavaScript for client-side interactivity.
10. (Choose 1 answer)

What is Blazor?
A. A JavaScript framework.
B. A framework for building interactive web UIs using C# instead of JavaScript.
C. A database management system.
D. A server-side scripting language.
11. (Choose 2 answers)

Which two hosting models does Blazor support?
A. Blazor Server
B. Blazor WebAssembly
C. Blazor Desktop
D. Blazor Native
12. (Choose 1 answer)

What is the root component of a Blazor app?
A. Index.razor
B. Routes.razor
C. App.razor
D. MainLayout.razor
13. (Choose 1 answer)

What is the main class used for communication in SignalR?
A. Hub
B. Controller
C. PageModel
D. Service
14. (Choose 1 answer)

What is the purpose of the Context object in a SignalR hub?
A. To manage database connections.
B. To provide information about the current connection.
C. To encrypt data.
D. To manage user sessions.
15. (Choose 1 answer)

How do you use hubs in SignalR for ASP.NET Core?
A. By defining JavaScript functions.
B. By creating classes that inherit from Hub.
C. By using static HTML files.
D. By using database queries.
16. (Choose 1 answer)

How do you handle events for a SignalR connection on the client-side?
A. By writing CSS styles.
B. By using JavaScript event listeners on the connection object.
C. By using static HTML files.
D. By using database queries.
17. (Choose 1 answer)

What is the purpose of the User feature in SignalR?
A. To manage database connections.
B. To send messages to clients based on their authenticated user identity.
C. To encrypt data.
D. To manage user sessions.
18. (Choose 1 answer)

Which namespace must be imported to use Hub?
A. Microsoft.Extensions.DependencyInjection
B. Microsoft.AspNetCore.SignalR
C. System.Threading.Tasks
D. Microsoft.AspNetCore.Mvc
19. (Choose 1 answer)

Which method registers SignalR services in Startup?
A. services.AddHub()
B. services.AddSignalR()
C. app.UseSignalR()
D. services.RegisterSignalR()
20. (Choose 1 answer)

An IP address is primarily used to:
A. Identify a physical device on a local network only
B. Provide logical addressing for devices across networks
C. Encrypt data during transmission
D. Define the maximum transmission speed
21. (Choose 1 answer)

The AcceptSocketAsync() method in TcpListener is used to:
A. a. Send data to a client
B. b. Accept a pending client connection asynchronously
C. c. Stop the listener
D. d. Bind to an IP address
22. (Choose 1 answer)

What is the function of a DNS (Domain Name System)?
A. To encrypt network traffic.
B. To translate hostnames into IP addresses.
C. To manage network security.
D. To route network packets.
23. (Choose 1 answer)

Which protocol is connection-oriented and ensures reliable data transfer?
A. UDP
B. IP
C. TCP
D. HTTP
24. (Choose 1 answer)

What is the default HTTP method when calling GetAsync() in HttpClient?
A. POST
B. b PUT
C. c GET
D. d DELETE
25. (Choose 1 answer)

Which.NET class is used to listen for incoming TCP connections on a specific port?
A. TcpClient
B. UdpClient
C. TcpListener
D. Socket
26. (Choose 1 answer)

Consider this C# code: public IActionResult Save(Person person) { if (ModelState.IsValid) return Content("Valid"); return Content("Error"); } If no value for Age is passed and Age is int, what happens?
A. Valid
B. Error
C. Exception
D. Null
27. (Choose 1 answer)

Consider this C# code: public class Person { public int Age { get; set; } } public IActionResult Save(Person person) { if (!ModelState.IsValid) { return Content("Invalid!"); } return Content("OK"); } Input: Age = "abc"? What is the output?
A. OK
B. Invalid!
C. Exception
D. Null
28. (Choose 1 answer)

Which directive is used to declare a strongly-typed View?
A. @model
B. @view
C. @bind
D. @data
29. (Choose 1 answer)

Consider this C# code: public IActionResult Index() { ViewData["User"] = "Admin"; return View(); } Razor: <p>@ViewBag.User</p> What is displayed?
A. Admin
B. null
C. Error
D. Nothing
30. (Choose 1 answer)

What does the IActionResult interface represent?
A. A database connection.
B. The result of an action method.
C. A user session.
D. A network request.
31. (Choose 1 answer)

What is "Model Validation" in ASP.NET Core MVC?
A. The process of encrypting data.
B. The process of ensuring that user input meets specific criteria.
C. The process of managing database connections.
D. The process of routing HTTP requests.
32. (Choose 1 answer)

How do you inject a service into a Razor PageModel?
A. By directly creating an instance of the service.
B. By adding the service as a constructor parameter.
C. By using global variables.
D. By using static methods.
33. (Choose 1 answer)

What is the file extension for Razor Page files?
A. .cshtml
B. .razor
C. .aspx
D. .html
34. (Choose 1 answer)

How is dependency injection typically used in Razor Pages?
A. By directly creating instances of dependencies.
B. By injecting dependencies into the PageModel constructor.
C. By using global variables.
D. By using static methods.
35. (Choose 1 answer)

ViewData in Razor Pages is:
A. A list of HTML helpers
B. A dictionary for passing data from PageModel to Razor Page
C. A type of middleware
D. A static variable shared by all pages
36. (Choose 1 answer)

What is the purpose of the [BindProperty] attribute in Razor Pages?
A. To define a database connection.
B. To bind form data to a PageModel property.
C. To encrypt data.
D. To manage user sessions.
37. (Choose 1 answer)

In Razor Pages, client-side validation is enabled by:
A. ASP.NET pipeline
B. jQuery Unobtrusive Validation
C. SignalR
D. AJAX by default
38. (Choose 1 answer)

Which principle is emphasized by DI in Razor Pages?
A. Don't Repeat Yourself (DRY)
B. Maximum Reuse
C. Procedural Programming
D. Loose Session Coupling
39. (Choose 1 answer)

What is the typical use case for a Worker Service?
A. Handling real-time user interactions.
B. Performing scheduled tasks or background processing.
C. Rendering web pages.
D. Managing user authentication.
40. (Choose 1 answer)

How do you implement a background task using a Worker Service?
A. By writing JavaScript functions.
B. By overriding the ExecuteAsync(CancellationToken) method in a class derived from BackgroundService.
C. By using static HTML files.
D. By using database queries.
41. (Choose 1 answer)

What is the purpose of the CancellationToken parameter in ExecuteAsync(CancellationToken)?
A. To manage database transactions.
B. To allow the service to be gracefully stopped.
C. To encrypt data.
D. To manage user sessions.
42. (Choose 1 answer)

Consider this C# code: public class Worker: BackgroundService { protected override Task ExecuteAsync(CancellationToken stoppingToken) { return Task.CompletedTask; } } What is ExecuteAsync?
A. The entry point for background execution.
B. The constructor.
C. A logging method.
D. A thread initializer.
43. (Choose 1 answer)

Which scenarios are most suitable for Worker Services?
A. Processing queue messages
B. Running Blazor UI
C. Displaying Razor Pages
D. Hosting REST APIs only
44. (Choose 1 answer)

What is the role of the ExecuteAsync(CancellationToken) method in a BackgroundService?
A. To handle HTTP requests.
B. To define the main logic of the background task.
C. To manage database connections.
D. To define user interfaces.
45. (Choose 1 answer)

Asynchronous programming improves applications by:
A. Automatically turning them into multi-threaded
B. Improving performance for I/O-bound operations
C. Never blocking a thread
D. Always running faster than synchronous code
46. (Choose 1 answer)

Which extension method is used to enable PLINQ on a data source?
A. AsQueryable()
B. AsEnumerable()
C. AsParallel()
D. ParallelQuery()
47. (Choose 1 answer)

Which of the following is a major advantage of parallel computing over serial computing?
A. It always increases electricity consumption
B. It saves time and reduces costs
C. It restricts the use of multiple processors
D. It prevents the use of distributed resources
48. (Choose 1 answer)

What is the primary advantage of asynchronous programming?
A. Increased CPU usage.
B. Improved responsiveness and reduced blocking.
C. Simplified debugging.
D. Reduced memory consumption.
49. (Choose 1 answer)

In PLINQ, which method converts a LINQ query into a parallel query?
A. ToParallel()
B. Parallelize()
C. AsParallel()
D. RunParallel()
50. (Choose 1 answer)

What is the purpose of the Task.WhenAll() method?
A. To execute a single task.
B. To wait for all provided tasks to complete.
C. To cancel a task.
D. To create a new thread.
 

Đính kèm

  • PRN222 SP26 B5 FE RE_01.webp
    PRN222 SP26 B5 FE RE_01.webp
    34.5 KB · Lượt xem: 3
  • PRN222 SP26 B5 FE RE_02.webp
    PRN222 SP26 B5 FE RE_02.webp
    36.7 KB · Lượt xem: 2
  • PRN222 SP26 B5 FE RE_03.webp
    PRN222 SP26 B5 FE RE_03.webp
    36 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_04.webp
    PRN222 SP26 B5 FE RE_04.webp
    24.2 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_05.webp
    PRN222 SP26 B5 FE RE_05.webp
    27.1 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_06.webp
    PRN222 SP26 B5 FE RE_06.webp
    26 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_07.webp
    PRN222 SP26 B5 FE RE_07.webp
    26 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_08.webp
    PRN222 SP26 B5 FE RE_08.webp
    31.2 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_09.webp
    PRN222 SP26 B5 FE RE_09.webp
    35.8 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_10.webp
    PRN222 SP26 B5 FE RE_10.webp
    26 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_11.webp
    PRN222 SP26 B5 FE RE_11.webp
    20.7 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_12.webp
    PRN222 SP26 B5 FE RE_12.webp
    18.4 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_13.webp
    PRN222 SP26 B5 FE RE_13.webp
    18.7 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_14.webp
    PRN222 SP26 B5 FE RE_14.webp
    26.4 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_15.webp
    PRN222 SP26 B5 FE RE_15.webp
    25.5 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_16.webp
    PRN222 SP26 B5 FE RE_16.webp
    28.8 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_17.webp
    PRN222 SP26 B5 FE RE_17.webp
    26.9 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_18.webp
    PRN222 SP26 B5 FE RE_18.webp
    25.4 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_19.webp
    PRN222 SP26 B5 FE RE_19.webp
    23.5 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_20.webp
    PRN222 SP26 B5 FE RE_20.webp
    28.8 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_21.webp
    PRN222 SP26 B5 FE RE_21.webp
    25.5 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_22.webp
    PRN222 SP26 B5 FE RE_22.webp
    26 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_23.webp
    PRN222 SP26 B5 FE RE_23.webp
    17.8 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_24.webp
    PRN222 SP26 B5 FE RE_24.webp
    18.7 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_25.webp
    PRN222 SP26 B5 FE RE_25.webp
    21.3 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_26.webp
    PRN222 SP26 B5 FE RE_26.webp
    33.2 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_27.webp
    PRN222 SP26 B5 FE RE_27.webp
    35.5 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_28.webp
    PRN222 SP26 B5 FE RE_28.webp
    18.8 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_29.webp
    PRN222 SP26 B5 FE RE_29.webp
    27.9 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_30.webp
    PRN222 SP26 B5 FE RE_30.webp
    21.6 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_31.webp
    PRN222 SP26 B5 FE RE_31.webp
    30 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_32.webp
    PRN222 SP26 B5 FE RE_32.webp
    28.1 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_33.webp
    PRN222 SP26 B5 FE RE_33.webp
    16.4 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_34.webp
    PRN222 SP26 B5 FE RE_34.webp
    30.2 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_35.webp
    PRN222 SP26 B5 FE RE_35.webp
    25 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_36.webp
    PRN222 SP26 B5 FE RE_36.webp
    27.7 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_37.webp
    PRN222 SP26 B5 FE RE_37.webp
    21.5 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_38.webp
    PRN222 SP26 B5 FE RE_38.webp
    23.6 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_39.webp
    PRN222 SP26 B5 FE RE_39.webp
    27.8 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_40.webp
    PRN222 SP26 B5 FE RE_40.webp
    33.4 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_41.webp
    PRN222 SP26 B5 FE RE_41.webp
    32.5 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_42.webp
    PRN222 SP26 B5 FE RE_42.webp
    41.3 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_43.webp
    PRN222 SP26 B5 FE RE_43.webp
    23.5 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_44.webp
    PRN222 SP26 B5 FE RE_44.webp
    32.2 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_45.webp
    PRN222 SP26 B5 FE RE_45.webp
    30 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_46.webp
    PRN222 SP26 B5 FE RE_46.webp
    21.4 KB · Lượt xem: 0
  • PRN222 SP26 B5 FE RE_47.webp
    PRN222 SP26 B5 FE RE_47.webp
    36.4 KB · Lượt xem: 1
  • PRN222 SP26 B5 FE RE_48.webp
    PRN222 SP26 B5 FE RE_48.webp
    28.1 KB · Lượt xem: 1
  • PRN222 SP26 B5 FE RE_49.webp
    PRN222 SP26 B5 FE RE_49.webp
    20.3 KB · Lượt xem: 1
  • PRN222 SP26 B5 FE RE_50.webp
    PRN222 SP26 B5 FE RE_50.webp
    23.1 KB · Lượt xem: 3

Tạo tài khoản hoặc đăng nhập để bình luận

Bạn phải là thành viên mới có thể bình luận.

Tạo tài khoản

Hãy tạo tài khoản trên cộng đồng của chúng tôi. Thật dễ dàng!

Đăng nhập

Bạn đã có tài khoản? Đăng nhập tại đây.

Back
Top