我的公司即将招聘。net开发人员。我们在各种。net平台上工作:ASP。NET,紧凑框架,windows窗体,Web服务。我想整理一份好问题的清单/目录,这是一种衡量应聘者是否有经验的最低标准。我的问题是:

你认为一个优秀的。net程序员应该能够回答哪些问题?

我也会把它看作是我自己的一张清单,以便看到我自己的缺陷在哪里(有很多……)

*更新:它想要明确的是,我们不仅仅测试。net知识,解决问题的能力和一般的编程技能对我们来说更重要。


当前回答

我更喜欢给他一个问题,让他用。net的特性来解决它,你知道,为什么你认为这是最好的解决方案。

这将破解候选人几乎所有的能力,包括技术、分析和解决问题的能力,以及他解决问题的方法。

其他回答

这很有趣,冒着被否决的风险,因为我天生耳聋,被问到这样的问题需要我个人更努力地交流我的想法。

坦率地说,我真的不会读太多的典型问题,因为潜在的范式是“你能多好地表达你的想法和理解?”’,这才是面试官真正想要的。由于我的性格,沟通一直是我最大的弱点,而且很容易感到沮丧。

拥有知识并成为无所不知的类型是最理想的,但不幸的是,有些事情我不知道,但如果你真的不知道答案,不要害怕,承认它,而不是虚张声势。如果面试官问了我一个类似上述的问题,而我不确定或者误解了这个问题,我会直接说出来,这对我个人来说可能会很尴尬,但我已经学会了处理这个问题。

你会惊讶地发现,有多少人会在一天结束时被发现他们的“裤子脱了”。

我的2美分, 最好的问候, 汤姆。

我想如果我在面试一个有LINQ经验的人,我可能会让他们解释一下LINQ。如果他们能解释延迟执行、流、IEnumerable/IEnumerator接口、foreach、迭代器块、表达式树(无论如何都是加分项),那么他们可能就能应付其余的问题。(不可否认,他们可能是“还行”的开发人员,还没有“得到”LINQ -我真的在想这样的情况,他们声称知道足够的LINQ,使这个问题成为一个公平的问题。)

在过去,我问过几个已经列出的问题,以及其他一些问题:

引用类型和值类型之间的区别 按引用传递vs按值传递 可替换和终结器 字符串,不可变性,字符编码 浮点 代表 泛型 可空类型

基本问题包括:

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%以开发应用程序为生的人都与业务线应用程序有关。

我认为在大多数情况下,测试一个人对业务线应用程序的知识是合适的,除非你在寻找非常特定领域的开发人员,如编译器开发、游戏引擎开发、定理证明、图像处理等。

我将提出一些问题,重点是理解使用dotnet之类的编程概念

托管环境和非托管环境之间的区别是什么? GC的利弊 JIT的利弊 如果我们需要开发应用程序X,我们可以使用dotnet吗?为什么?(这将确定他如何看待dotnet)

我还建议写一些小方法,让他用更好的dotnet类或标准方法重写它们,使它们具有更好的性能。 也写不正确的方法(在任何方面)逻辑或其他,并要求他纠正它们。

我不会问那些“从课本上知道一些东西”的问题,而是问一些修补性的问题,比如:

在普通c#中foreach循环做什么?(期望他写一个迭代器循环。) 什么是单例? 让他/她解析一个String to Datetime(期望他/她使用TryParse而不是try/catch) 实现单例模式、策略模式和命令模式 让他/她重构一段代码进行测试。期望他/她将外部服务从测试单元中抽象出来,并实现他自己的服务的Test-double(不提供mock框架)

这些都不是100%确定的,这取决于我问的人:

让他/她保护一个方法不受空输入的影响(期望他/她使用多次返回来减少嵌套) 对象初始化器如何工作(期望他/她写线程安全的赋值)

此外,我还会问他/她是如何学习他/她的东西的,他/她在读什么(什么博客,书籍)。