我的公司即将招聘。net开发人员。我们在各种。net平台上工作:ASP。NET,紧凑框架,windows窗体,Web服务。我想整理一份好问题的清单/目录,这是一种衡量应聘者是否有经验的最低标准。我的问题是:
你认为一个优秀的。net程序员应该能够回答哪些问题?
我也会把它看作是我自己的一张清单,以便看到我自己的缺陷在哪里(有很多……)
*更新:它想要明确的是,我们不仅仅测试。net知识,解决问题的能力和一般的编程技能对我们来说更重要。
我的公司即将招聘。net开发人员。我们在各种。net平台上工作:ASP。NET,紧凑框架,windows窗体,Web服务。我想整理一份好问题的清单/目录,这是一种衡量应聘者是否有经验的最低标准。我的问题是:
你认为一个优秀的。net程序员应该能够回答哪些问题?
我也会把它看作是我自己的一张清单,以便看到我自己的缺陷在哪里(有很多……)
*更新:它想要明确的是,我们不仅仅测试。net知识,解决问题的能力和一般的编程技能对我们来说更重要。
当前回答
我将提出一些问题,重点是理解使用dotnet之类的编程概念
托管环境和非托管环境之间的区别是什么? GC的利弊 JIT的利弊 如果我们需要开发应用程序X,我们可以使用dotnet吗?为什么?(这将确定他如何看待dotnet)
我还建议写一些小方法,让他用更好的dotnet类或标准方法重写它们,使它们具有更好的性能。 也写不正确的方法(在任何方面)逻辑或其他,并要求他纠正它们。
其他回答
我更喜欢给他一个问题,让他用。net的特性来解决它,你知道,为什么你认为这是最好的解决方案。
这将破解候选人几乎所有的能力,包括技术、分析和解决问题的能力,以及他解决问题的方法。
基本问题包括:
Whats the difference between an abstract class and interface? When would you want to use them? What's the difference between a left join and an inner join? What's the difference between viewstate and sessionstate? What's the difference between overriding and overloading a method? Explain how both are done. What's the difference between protected and internal? What about "protected internal"? How do short-circuited operators work? Explain what the StringBuilder class is and why you'd want to use it? What's the difference between a static method and a non-static method? What does the "volatile" keyword in C# mean? Explain what happens when you pass a "ref" or "out" parameter into a method. What's the difference between those two keywords? What's a weakreference? When would you want to use one? What's the difference between a DataTable and a DataReader? What's the difference between a value-type and a reference type? What does the "readonly" keyword in C# mean?
我认为要求申请人完成简单的编码练习通常会有所帮助,例如:
Write your own linked list class without using the built-in classes. Write your own hashtable class without using the built-in classes. Write a class that represents a binary tree. Write a method that traverses all nodes of the tree. Write a method to perform a binary search on an array without using built-in methods. Draw a database schema for a blog. Each user only has one blog, each blog has many categories, each category has many posts, and each post can belong to more than one category. Ask your applicant to write queries to pull specific information out.
接下来,寻找具体的技术诀窍:
(Event handlers) Create a class with a custom event handler, create another class which hooks onto the custom event handler. (XML) Load an XML document and select all of the nodes with properties x, y, and z. (Functional programming) Create a function that accepts another function as a parameter. A Map or Fold function works really good for this. (Reflection) Write a function which determines if a class has a particular attribute. (Regex) Write a regular expression which removes all tags from a block of HTML.
对于一个熟练的c#程序员来说,这些问题都不是特别难回答的,它们应该能让你很好地了解申请人的特殊优势。您可能还想使用一些使用特定设计模式的问题/代码示例。
[编辑澄清]:
似乎很多人都不理解我为什么会问这些问题。让我来谈谈一些人的评论(我不是直接引用,而是转述):
问:上一次有人使用挥发物或弱引用是什么时候?
答:当我进行技术面试时,我会看一个人是否理解。net的高级和低级特性。volatile和弱引用是。net提供的两个低级特性——即使这些特性在实践中不经常使用,这些问题的答案也非常具有启发性:
A good understanding of volatiles demonstrates that a person understands how compiler optimizations change the correctness of code, how threads keep local copies of shared state which may be out of sync at any given time, and is minimally aware of some of the complexities of multithreaded code. A good understanding of weak references demonstrates that a person knows about the intimate details of the garbage collector and how it decides when to free memory. Sure, you could ask candidates "how does a garbage collector work", but asking about weak references gets a much better, more thoughtful reply.
. net是一种相当抽象的语言,但明星开发人员几乎总是对CLR和. net运行时的底层细节有深刻的理解。
问:为什么每个人都需要实现自己的哈希表或链表?
答:我并不是在暗示Dictionary类是劣等的,或者人们应该滚动自己的哈希表。这是一个基本问题,测试一个人是否对数据结构有最低限度的理解。这就是这些问题要测试的:最低限度的理解。
在数据结构101课程的第一天,您将了解这些哈希表和链表。如果有人不能从头开始编写哈希表或链表,那么他们在技术知识方面存在巨大的差距。
问:为什么这些问题都与原油有关?
答:因为这篇文章的标题是“每一个优秀的。net开发人员应该知道的问题”。每个。net开发人员的职业生涯都是从编写糟糕的应用程序开始的,而90%以开发应用程序为生的人都与业务线应用程序有关。
我认为在大多数情况下,测试一个人对业务线应用程序的知识是合适的,除非你在寻找非常特定领域的开发人员,如编译器开发、游戏引擎开发、定理证明、图像处理等。
我想如果我在面试一个有LINQ经验的人,我可能会让他们解释一下LINQ。如果他们能解释延迟执行、流、IEnumerable/IEnumerator接口、foreach、迭代器块、表达式树(无论如何都是加分项),那么他们可能就能应付其余的问题。(不可否认,他们可能是“还行”的开发人员,还没有“得到”LINQ -我真的在想这样的情况,他们声称知道足够的LINQ,使这个问题成为一个公平的问题。)
在过去,我问过几个已经列出的问题,以及其他一些问题:
引用类型和值类型之间的区别 按引用传递vs按值传递 可替换和终结器 字符串,不可变性,字符编码 浮点 代表 泛型 可空类型
我在Scott Hanselman的博客上找到了这些列表:
伟大的。net开发人员应该知道什么(更多。net面试问题) ASP。NET面试问题
以下是我从这些文章中归纳出来的最重要的问题。我编辑并重新编排了它们。幸运的是,对于这些问题中的大多数,在Stack Overflow上已经有了很好的答案。只要按照链接(我会尽快更新它们)。
与平台无关的。net问题
What is the difference between a thread and a process? What is the difference between an EXE and a DLL? What is strong-typing versus weak-typing? What is the difference between a.Equals(b) and a == b? What is boxing? Is string a value type or a reference type? What is the Global Assembly Cache (GAC)? What problem does it solve? What is an Interface and how is it different from a Class? What is Reflection? Conceptually, what is the difference between early-binding and late-binding? When would using Assembly.LoadFrom or Assembly.LoadFile be appropriate? What is an Asssembly Qualified Name? Is it a filename? How is it different? How is a strongly-named assembly different from one that isn’t strongly-named? What does this do? sn -t foo.dll How does the generational garbage collector in the .NET CLR manage object lifetime? What is non-deterministic finalization? What is the difference between Finalize() and Dispose()? (external article) What is the difference between in-proc and out-of-proc? What technology enables out-of-proc communication in .NET? What is FullTrust? Do GAC’ed assemblies have FullTrust? What is the difference between Debug.Write and Trace.Write? When should each be used? What is the difference between a Debug and Release build? Is there a significant speed difference? Why or why not? What is the difference between: catch (Exception e) {throw e;} and catch (Exception e) {throw;} ? What is the difference between typeof(foo) and myFoo.GetType()? What is the purpose of XML Namespaces? What is the difference between an XML "Fragment" and an XML "Document"? (XML Basics) How would you validate XML using .NET?
ASP。网
What is a PostBack? What is ViewState? How is it encoded? Is it encrypted? Who uses ViewState? Why is it either useful or evil? What Session State providers are available in ASP.NET? What are the pros and cons of each? What is the OO relationship between an ASPX page and its CS/VB code behind file? How would one implement ASP.NET HTML output caching, caching outgoing versions of pages generated via all values of q= except where q=5 (as in http://localhost/page.aspx?q=5)? What are HttpHandlers? What are HttpModules? What is needed to configure a new extension for use in ASP.NET? For example, what if I wanted my system to serve ASPX files with a *.jsp extension? How do cookies work? What is an example of Cookie abuse? What kind of data is passed via HTTP Headers? How does IIS communicate at runtime with ASP.NET? Where is ASP.NET at runtime in the different versions of IIS (5 to 7)?
除了上面提到的一些问题外,我还喜欢以下几个问题:
委托是什么? 什么是应用程序域? 什么时候使用lock关键字? 标准库泛型集合类是否线程安全? 什么是扩展方法? XmlDocument和XmlReader之间的区别是什么? 如何从应用程序配置文件中读入配置设置?