Đề Thi FE PRN212 - SP26 - B5 - FE

adminadmin is verified member.

Member
Thành viên BQT
Administrator
Học kỳ
SP2026
Thời Gian
29/4/26
Loại tài liệu
FE
PRN212 SP26 B5 FE
  1. Câu 1

    What will be the output of the following C# program?

    C#

    <span>enum</span> Role { Admin = <span>1</span>, Guest = <span>2</span> }<br><span><span>static</span> <span>void</span> <span>Main</span>(<span></span>)</span><br>{<br> <span>var</span> json = JsonSerializer.Serialize(Role.Admin, <span>new</span> JsonSerializerOptions<br> {<br> Converters = {<span>new</span> JsonStringEnumConverter()}<br> });<br> Console.WriteLine(json);<br>}<br>
    A. 1

    B. "Admin"

    C. "1"

    D. "ADMIN"

    Đáp án: B
  2. Câu 2 (Choose 1 answer)

    In JSON syntax, arrays are enclosed in:

    A. Square brackets

    B. Curly braces

    C. Parentheses

    D. Angle brackets

    Đáp án: A
  3. Câu 3 (Choose 1 answer)

    Which of the following is a valid JSON structure?

    A. {"name": "John", "age": 30}

    B. { "name": "John", age: 30}

    C. ("name": "John", age: 30)

    D. ("name": "John", "age": 30)

    Đáp án: A
  4. Câu 4 (Choose 1 answer)

    Which attribute can be used to control the serialization behavior of a property in .NET JSON serialization?

    A. [JsonFormatter]

    B. [JsonProperty]

    C. [Serializable]

    D. [JsonIgnoreSerialization]

    Đáp án: B (Lưu ý: Trong System.Text.Json thường dùng JsonPropertyName hoặc JsonIgnore, nhưng dựa theo file là B).
  5. Câu 5 (Choose 1 answer)

    Which control is used to arrange child elements sequentially in either a horizontal or vertical direction?

    A. DockPanel

    B. StackPanel

    C. Grid

    D. ViewBox

    Đáp án: B
  6. Câu 6 (Choose 1 answer)

    Which property of the Application class allows you to specify a XAML file as the entry point for the application?

    A. StartupObject

    B. EntryPoint

    C. MainFile

    D. StartupUri

    Đáp án: D
  7. Câu 7 (Choose 1 answer)

    What does WPF stand for?

    A. Windows Programming Framework

    B. Windows Presentation Foundation

    C. Windows Processing Foundation

    D. Windows Platform Foundation

    Đáp án: B
  8. Câu 8 (Choose 1 answer)

    Which control is used to display data in a table format in WPF?

    A. ListBox

    B. DataGrid

    C. TextBox

    D. ComboBox

    Đáp án: B
  9. Câu 9 (Choose 1 answer)

    A DataGrid automatically generates columns when:

    A. AutoGenerateColumns="True" and ItemsSource is set

    B. Binding mode is OneWayToSource

    C. RowTemplate is supplied

    D. It is placed inside a Canvas

    Đáp án: A
  10. Câu 10 (Choose 3 correct answers)

    The Builder pattern involves which THREE participants?

    A. Director

    B. Product

    C. ConcreteBuilder

    D. Façade

    Đáp án: A, B, C
  11. Câu 11 (Choose 1 answer)

    In which design pattern does an object notify other objects about state changes, allowing them to react accordingly?

    A. Observer

    B. Chain of Responsibility

    C. State

    D. Strategy

    Đáp án: A
  12. Câu 12 (Choose 1 answer)

    In the Factory Method pattern, object creation is:

    A. Hard-coded in the client

    B. Deferred to subclasses at runtime

    C. Achieved through reflection only

    D. Performed by the CLR JIT compiler

    Đáp án: B
  13. Câu 13 (Choose 1 answer)

    Why should you use Design Patterns?

    A. To write complex and inefficient code.

    B. To improve code reusability, maintainability, and scalability.

    C. To avoid using frameworks or libraries.

    D. To remove the need for object-oriented programming principles.

    Đáp án: B
  14. Câu 14 (Choose 1 answer)

    What is a static local function in C#?

    A. A function that cannot access instance variables of the enclosing method.

    B. A function that is only accessible to other classes.

    C. A method that can access non-static fields.

    D. A function that can only be defined globally.

    Đáp án: A
  15. Câu 15 (Choose 1 answer)

    Which of the following is a value type in C#?

    A. Class

    B. Interface

    C. Enum

    D. Delegate

    Đáp án: C
  16. Câu 16 (Choose 1 answer)

    Which class is primarily used for input and output operations in C#?

    A. FileIO

    B. Console

    C. System.IO

    D. InputOutput

    Đáp án: B (Theo nội dung file trích xuất).
  17. Câu 17 (Choose 1 answer)

    What is the purpose of string interpolation in C#?

    A. To format strings using the '+' operator

    B. To embed expressions inside string literals

    C. To concatenate multiple strings

    D. To split strings into substrings

    Đáp án: B
  18. Câu 18 (Choose 1 answer)

    What are reference returns in .NET?

    A. Methods that return references to objects

    B. Methods that return values directly

    C. Constants used to reference memory locations

    D. Pointers used in low-level programming languages

    Đáp án: A
  19. Câu 19 (Choose 1 answer)

    Which of the following is TRUE about JSON serialization in .NET?

    A. It can serialize both public and private fields

    B. It is commonly used for web APIs

    C. It requires the use of the XmlSerializer class

    D. It only works with string data

    Đáp án: B (Dựa trên đáp án A/B trong ngữ cảnh file).
  20. Câu 20 (Choose 1 answer)

    What is thread starvation in concurrency programming?

    A. A situation where threads are executed sequentially

    B. A situation where there is no coordination between multiple threads

    C. A situation where a thread does not get access to the shared resource it needs to progress

    D. A situation where multiple cores are not utilized efficiently

    Đáp án: C
  21. Câu 21 (Choose 1 answer)

    Which panel in WPF stacks content in a vertical or horizontal manner as dictated by the Orientation property?

    A. Canvas

    B. DockPanel

    C. Grid

    D. StackPanel

    Đáp án: D
  22. Câu 22 (Choose 1 answer)

    What happens when two threads access shared data simultaneously?

    A. No effect

    B. Compilation error

    C. Race condition

    D. Memory leak

    Đáp án: C
  23. Câu 23 (Choose 1 answer)

    Which of the following correctly describes the Database First Model?

    A. Design the database from C# source code

    B. Generate code from an existing database

    C. Create the database directly from the Visual Studio interface

    D. Not related to databases

    Đáp án: B
  24. Câu 24 (Choose 1 answer)

    How can you add a new record using Entity Framework Core?

    A. By adding the entity to the DbSet and calling SaveChanges.

    B. By directly executing a raw SQL query.

    C. By inserting the record into the database via stored procedures.

    D. By using the SQL Server Management Studio interface.

    Đáp án: A
  25. Câu 25 (Choose 1 answer)

    Which class in Entity Framework Core represents a table in the database?

    A. DbTable

    B. DbModel

    C. DbContext

    D. DbSet

    Đáp án: D
  26. Câu 26 (Choose 1 answer)

    What is meant by "materialization" in EF Core?

    A. The process of caching query results.

    B. The process of serializing objects to XML.

    C. The process of converting database rows into entity objects.

    D. The process of encrypting data before storage.

    Đáp án: C
  27. Câu 27 (Choose 1 answer)

    Which method of the DbSet class is used to retrieve a single entity from the database that matches a specified condition, or a default value if no such entity is found?

    A. Find

    B. FirstOrDefault

    C. SingleOrDefault

    D. Where

    Đáp án: C (File ghi đáp án C).
  28. Câu 28 (Choose 1 answer)

    Which code snippet demonstrates abstraction using an abstract class?

    A. (Đoạn mã sử dụng abstract class Shape và override void Draw())

    B. (Đoạn mã sử dụng phương thức không abstract)

    C. (Đoạn mã sử dụng virtual)

    D. (Đoạn mã lớp thông thường)

    Đáp án: A
  29. Câu 29 (Choose 1 answer)

    What are auto-implemented properties in C#?

    A. Properties where the compiler automatically creates a private, anonymous field.

    B. Methods that automatically return property values.

    C. Fields that require explicit getter and setter definitions.

    D. Variables that are only accessible within the same class.

    Đáp án: A
  30. Câu 30 (Choose 1 answer)

    What is the purpose of the 'is' operator in C#?

    A. To check if an object is compatible with a given type

    B. To convert an object to a given type

    C. To declare a static member

    D. To create a new instance of a class

    Đáp án: A
  31. Câu 31 (Choose 1 answer)

    What happens if a class inherits from multiple classes in C#?

    A. The class will have access to members of all base classes.

    B. The class will cause a compile-time error because C# does not support direct multiple inheritance.

    C. The class will override all methods of the base classes.

    D. The class will not be able to create an instance of itself.

    Đáp án: B
  32. Câu 32 (Choose 1 answer)

    Which of the following is the correct way to create a new file using the File class?

    A. File.WriteAllText("example.txt", "Hello, World!");

    B. File.Create("example.txt", "Hello, World!");

    C. File.CreateNew("example.txt", "Hello, World!");

    D. File.Open("example.txt", FileMode.Open);

    Đáp án: A
  33. Câu 33 (Choose 1 answer)

    Which of the following classes is NOT part of the System.IO namespace?

    A. File

    B. Directory

    C. HttpClient

    D. StreamReader

    Đáp án: C
  34. Câu 34 (Choose 1 answer)

    What is the value of fs.Position immediately after opening an existing file with FileMode.Open?

    C#

    <span>using</span> <span>var</span> fs = <span>new</span> FileStream(<span>"a.txt"</span>, FileMode.Open);<br>Console.WriteLine(fs.Position);<br>
    A. 0

    B. -1

    C. file length

    D. Undefined

    Đáp án: A
  35. Câu 35 (Choose 1 answer)

    Which class allows access to directory creation time?

    A. Directory

    B. DirectoryHelper

    C. DirectoryInfo

    D. DirectoryManager

    Đáp án: C
  36. Câu 36 (Choose 1 answer)

    What is the 'select' clause used for in a query expression?

    A. To project the result into a new form

    B. To filter the elements based on a condition

    C. To sort the elements in ascending order

    D. To group the elements based on a condition

    Đáp án: A
  37. Câu 37 (Choose 1 answer)

    What does the Combine(Delegate, Delegate) method do?

    A. Removes one delegate from another

    B. Creates a static method delegate

    C. Concatenates the invocation lists of two delegates

    D. Returns the target class of a delegate

    Đáp án: C
  38. Câu 38 (Choose 1 answer)

    Which of the following is a valid lambda expression?

    A. (x, y) => x + y

    B. x plus y

    C. add(x, y)

    D. x => >> y

    Đáp án: A
  39. Câu 39 (Choose 1 answer)

    Which delegate type is used to represent a method that takes no parameters and returns void?

    A. Action

    B. Func

    C. Predicate

    D. EventHandler

    Đáp án: A
  40. Câu 40 (Choose 1 answer)

    Which of the following represents the Action delegate type with one parameter and no return value?

    A. Action<>

    B. Action

    C. Action<T1, TResult>

    D. Action<T, T>

    Đáp án: B
  41. Câu 41 (Choose 1 answer)

    Which of the following is not a valid example of using a generic class in C#?

    A. List myList = new List();

    B. Dictionary<TKey, TValue> myDict = new Dictionary<TKey, TValue>();

    C. Stack myStack = new Stack();

    D. ArrayList myArray = new ArrayList();

    Đáp án: D
  42. Câu 42 (Choose 1 answer)

    What is the benefit of using List over ArrayList?

    A. Compile-time type checking

    B. Boxing and unboxing

    C. Lack of type safety

    D. Dynamic typing

    Đáp án: A
  43. Câu 43 (Choose 1 answer)

    What is the purpose of using generic methods in C#?

    A. To restrict the types that can be used with the method.

    B. To allow the method to accept different types dynamically.

    C. To improve performance by eliminating boxing and unboxing operations.

    D. To make the method more readable and maintainable.

    Đáp án: C (Dựa trên đáp án trong file).
  44. Câu 44 (Choose 1 answer)

    What is the constraint 'where T: new()' used for?

    A. To specify that T must have a public parameterless constructor

    B. To specify that T must be a reference type

    C. To specify that T must be a value type

    D. To specify that T must implement an interface

    Đáp án: A
  45. Câu 45 (Choose 1 answer)

    What is the purpose of the struct constraint in the following generic class?

    public class NumericContainer&lt;T&gt; where T : struct

    A. It ensures that T can only be a reference type.

    B. It ensures that T can only be a value type.

    C. It allows T to be any type, including struct.

    D. It restricts T to classes that implement INumeric.

    Đáp án: B
  46. Câu 46 (Choose 1 answer)

    Which release first dropped the "Core" branding and adopted the single name ".NET"?

    A. .NET 2.2

    B. .NET 3.1

    C. .NET 4

    D. .NET 5

    Đáp án: D
  47. Câu 47 (Choose 1 answer)

    What is the main purpose of the NuGet package in .NET?

    A. To store user credentials for .NET applications

    B. To package and distribute libraries and dependencies for .NET applications

    C. To debug and deploy .NET applications

    D. To convert C# code into machine language

    Đáp án: B
  48. Câu 48 (Choose 1 answer)

    What is the CoreCLR?

    A. A common language runtime for .NET Framework

    B. A runtime environment for ASP.NET Core applications

    C. A replacement for the traditional .NET Framework runtime, optimized for performance and cross-platform support

    D. A tool used for compiling C# code into machine code

    Đáp án: C
  49. Câu 49 (Choose 1 answer)

    What is a primary feature of the .NET Framework architecture?

    A. It is only designed for mobile platforms.

    B. It includes the Common Language Runtime (CLR) for code execution.

    C. It lacks a Base Class Library (BCL).

    D. It supports only one programming language.

    Đáp án: B
  50. Câu 50 (Choose 1 answer)

    What is the output of the .NET compilation process called?

    A. Bytecode

    B. Source code

    C. Assembly

    D. Machine code

    Đáp án: C
 

Đính kèm

  • PRN212 SP26 B5 FE_001.webp
    PRN212 SP26 B5 FE_001.webp
    65.8 KB · Lượt xem: 1
  • PRN212 SP26 B5 FE_002.webp
    PRN212 SP26 B5 FE_002.webp
    32.8 KB · Lượt xem: 1
  • PRN212 SP26 B5 FE_003.webp
    PRN212 SP26 B5 FE_003.webp
    41.6 KB · Lượt xem: 1
  • PRN212 SP26 B5 FE_004.webp
    PRN212 SP26 B5 FE_004.webp
    34.2 KB · Lượt xem: 1
  • PRN212 SP26 B5 FE_005.webp
    PRN212 SP26 B5 FE_005.webp
    31.4 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_006.webp
    PRN212 SP26 B5 FE_006.webp
    31.3 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_007.webp
    PRN212 SP26 B5 FE_007.webp
    43.9 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_008.webp
    PRN212 SP26 B5 FE_008.webp
    32.9 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_009.webp
    PRN212 SP26 B5 FE_009.webp
    50.1 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_010.webp
    PRN212 SP26 B5 FE_010.webp
    34.3 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_011.webp
    PRN212 SP26 B5 FE_011.webp
    34.2 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_012.webp
    PRN212 SP26 B5 FE_012.webp
    45.7 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_013.webp
    PRN212 SP26 B5 FE_013.webp
    57 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_014.webp
    PRN212 SP26 B5 FE_014.webp
    55.4 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_015.webp
    PRN212 SP26 B5 FE_015.webp
    28.3 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_016.webp
    PRN212 SP26 B5 FE_016.webp
    33.7 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_017.webp
    PRN212 SP26 B5 FE_017.webp
    49.1 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_018.webp
    PRN212 SP26 B5 FE_018.webp
    52.6 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_019.webp
    PRN212 SP26 B5 FE_019.webp
    53.3 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_020.webp
    PRN212 SP26 B5 FE_020.webp
    57.6 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_021.webp
    PRN212 SP26 B5 FE_021.webp
    30.1 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_022.webp
    PRN212 SP26 B5 FE_022.webp
    38 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_023.webp
    PRN212 SP26 B5 FE_023.webp
    59.3 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_024.webp
    PRN212 SP26 B5 FE_024.webp
    65.6 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_025.webp
    PRN212 SP26 B5 FE_025.webp
    35 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_026.webp
    PRN212 SP26 B5 FE_026.webp
    57.2 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_027.webp
    PRN212 SP26 B5 FE_027.webp
    37.2 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_028.webp
    PRN212 SP26 B5 FE_028.webp
    113.8 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_029.webp
    PRN212 SP26 B5 FE_029.webp
    60.1 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_030.webp
    PRN212 SP26 B5 FE_030.webp
    50 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_031.webp
    PRN212 SP26 B5 FE_031.webp
    54 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_032.webp
    PRN212 SP26 B5 FE_032.webp
    55.6 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_033.webp
    PRN212 SP26 B5 FE_033.webp
    35.6 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_034.webp
    PRN212 SP26 B5 FE_034.webp
    54.4 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_035.webp
    PRN212 SP26 B5 FE_035.webp
    35.5 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_036.webp
    PRN212 SP26 B5 FE_036.webp
    54.3 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_037.webp
    PRN212 SP26 B5 FE_037.webp
    55.3 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_038.webp
    PRN212 SP26 B5 FE_038.webp
    31 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_039.webp
    PRN212 SP26 B5 FE_039.webp
    32 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_040.webp
    PRN212 SP26 B5 FE_040.webp
    33.2 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_041.webp
    PRN212 SP26 B5 FE_041.webp
    62.1 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_042.webp
    PRN212 SP26 B5 FE_042.webp
    39.5 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_043.webp
    PRN212 SP26 B5 FE_043.webp
    66.8 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_044.webp
    PRN212 SP26 B5 FE_044.webp
    56.1 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_045.webp
    PRN212 SP26 B5 FE_045.webp
    86.2 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_046.webp
    PRN212 SP26 B5 FE_046.webp
    31.4 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_047.webp
    PRN212 SP26 B5 FE_047.webp
    56.2 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_048.webp
    PRN212 SP26 B5 FE_048.webp
    46.8 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_049.webp
    PRN212 SP26 B5 FE_049.webp
    59.2 KB · Lượt xem: 0
  • PRN212 SP26 B5 FE_050.webp
    PRN212 SP26 B5 FE_050.webp
    34.5 KB · Lượt xem: 1

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