国双面试题
1、Which attribute can we use to warn(警告) consumers(消费者) that code is outdated(过时的 旧试的)?
A.[Deprecated](不推荐) B.[Obsolete] C.[DoNotUse] D.[OutDated]
2、How can we force(强制) reference(引用) equality comparisons between objects?
A.The==operator always compares references
B.Use object.Equals
C.Use object.ReferenceEquals 引用相等性 区别== Equals
D.Use Assert.AreEqual
3、Which of the following features(以下特性) is still not support by C# ?
A.Language integrated query(语言级级别查询 C#)
B.Functional style programming 函数式编程
C.Mixin (混合类型)
D.Closure(闭包 C#)
4、What modifier(修饰) allows us to pass an arbitrary(随意的) number of arguments to method(参数方法)?
A.list B. multi C.params D.Multiparam
5、Whitch calss can we use to convert base types to binary byte arrays?把基本类型转化为二进制数组
A.Convert B.ByteArrayConverter C.BitConverter D.BinaryConverter
6、What constraint(约束) would we use to ensure a generic(确保 泛型) type parameter “T” was always a reference type?
A.where T:ref B.where T:reference C.where T:class D. where T:struct
7、Can we have generic methods in non-generic classes? 非泛型类 里面的泛型方法
A.No B.Yes C.Yes only if the class is abstract D.Yes only if the class is sealed
8、Which class can be used to perform(执行) atomic,processor-independent updates of word-sized data?
A.System.Threading.Mutex B.System.Threading.Interlocked
C.System.Threading.WaitHandle D.System.Threading.ThreadPool
9、What is the name of the data structure(数据结构) that the finalizer(终结函数) thread picks(选择) objects from?
A.Disposable queue B.F-reachable queue C.Graveyard queue D.Finalization queue
10、Which new garbage collector does .NET 4.0 introduce(采用)
A.Server GC B.Background GC C.Low fragmentation(分裂) GC D.Workstation GC
11、When are assemblies(程序集) unloaded from an application domain? 应用程序什么时候去加载程序集
A.Nerver B.When the application domain is unloaded
C.By calling the Unload method on the assembly
D.When the assembly file is deleted
12、What is the primary reason thread synchronization(同步) techniques(技术) are required?
A.To prevent(预防) performance(性能) issuses流出
B.Most modern machines have more than one processor(处理器) or core
C.To reduce memory consumption
D.Most resources are not meant to be accessed访问 concurrently 同时的
13、What is an advantage优势 to using events versus exposing公开 delegates publicly?
A.Events do not use delegates
B.Events are available to other .NET languages but delegates are only available in C#
C.Events prevent external clients from subscribing to the delegate
D.Events encapsulate the delegate and prevent external objects from invoking it directly
14、Which of the following statements does not help UI thread marshaling(调度排列)?
A.Form.BeginInvoke B.Delegate.BeginInvoke C.Dispatcher.BeginInvoke(WPF) D.SynchronizationContext.Post同步上下文
15、Which design pattern helps to achieve实现 double dispatch分派?
A.Bridge.Pattern B.Adapter Pattern C.Visitor Pattern D.Iterator Pattern E.Chain-Of-Responsibility Pattern
16、Task.ConfigureAwait(bool) is introduces in .Net 4.5 Please explain what it does.
17、Please write a small program to reverse a linked list.
Class Node
Object Value{get;set;}
Node Next {get;set;}
Should return the head node of the new reversed linked list node reverse(node headnode)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构