面试题目
Jeffery1982
这个作者很懒,什么都没留下…
展开
-
什么叫DependancyProperty
DependencyProperty是Wpf属性定义中很重要的一个类,在传统的属性定义中,如一个控件的某属性变化了,需要重画才可以使属性的变化添加到控件。也就是说,你需要使用Graphics的实例来进行重画。而这样,是比较麻烦的事情。Wpf使用了DependencyProperty后,可以通过DependencyProperty的属性来指定是否将变化影响到界面或其子控件。有了这个机制,就可以大大加转载 2010-02-28 08:57:00 · 498 阅读 · 0 评论 -
判断树的两个节点的公共ancestor
<br /> public Node GetCommonAncester(Node root, Node p, Node q) { if (covers(root.left, p) && covers(root.left, q)) root = GetCommonAncester(root.left, p, q); else if (covers(root.right, p) && covers(root原创 2011-05-19 11:56:00 · 712 阅读 · 0 评论 -
一个int数组,求乘起来最大的连续子序列
一道题目,和朋友分析了半天,只有以下的一些结论:1. 如果是正数的话,就全部乘起来就可以了2. 如果是偶数个的负数的话,就直接全部乘起来就可以了。3. 单数个负数的话是挺复杂的。。。原创 2011-05-21 13:32:00 · 667 阅读 · 0 评论 -
给一个数组,求a[i]<a[j]的情况下,j-i的最大值是多少,要求用O(n)时间复杂度
<br />碰到一道,看似挺简单,但是又挺难,到现在还没想出来,先放在这里。<br />原创 2011-05-21 13:28:00 · 1403 阅读 · 1 评论 -
将A数组中含有的元素并且B数组中没有的输出到一个新的list中
<br />class Program { static void Main(string[] args) { string stringValue = "abcdefg"; int intValue = 10; int intValue2 = 20; double doubleValue = 2.5; List<object> A原创 2011-04-24 03:40:00 · 1986 阅读 · 0 评论 -
一道关于运用Hashtable的题目
You are given an array of integers and a sum. Find all pairs of integers that equal that sum. Assume you have some sort of data structures that will be able to store the pairs. Write an algorithm to find all these pairs.原创 2011-04-28 13:14:00 · 504 阅读 · 0 评论 -
C#中Hashtable的概念
<br />C#中Hashtable的实现是:<br />类实现一个哈希表,该哈希表将键映射到相应的值。任何非 null 对象都可以用作键或值。为了成功地在哈希表中存储和获取对象,用作键的对象必须实现 hashCode 方法和 equals 方法。<br /> <br />在哈希表中添加一个key/键值对:HashtableObject.Add(key,);在哈希表中去除某个key/键值对:HashtableObject.Remove(key);从哈希表中移除所有元素: HashtableObject.Cl原创 2011-04-28 00:23:00 · 451 阅读 · 0 评论 -
Non technical related question
<br />As common, you will be asked if you have any question to ask interviewer. Following is some example:<br />If you are interviewing with the hiring manager, ask questions about the job, the desired qualities and the challenges.If you are interviewing w原创 2011-04-28 10:58:00 · 455 阅读 · 0 评论 -
Difference between perf testing / Stress testing / Load testing
Just refer from other article. Will read when have time.http://agiletesting.blogspot.com/2005/02/performance-vs-load-vs-stress-testing.html原创 2011-04-27 17:44:00 · 402 阅读 · 0 评论 -
一些基本概念
<br />int的最大值是2的31次方-1,为什么是这样呢,因为第一位要放正负号,最后要减1是因为如果满了其实就溢出了。<br />unsigned int就是2的32次方-1了,因为他不需要存储正负号。原创 2011-04-29 09:35:00 · 367 阅读 · 0 评论 -
some non-tech related question
1. Why do you want to join microsoft?2. Why do you want to join our team instead of your team?3. Need to prepare some question about the project you apply.4. If the testing schedule changed just before the deadline. How would you do?5. If some p0 bug found原创 2011-05-01 14:39:00 · 570 阅读 · 0 评论 -
求出int数组中和最大的子序列
public int GetMaxSum(int[] arr) { int temp = 0; int max1 = 0; int max2 = 0; for (int i = 0; i 0) { max1 = temp; } else原创 2011-05-05 02:41:00 · 408 阅读 · 0 评论 -
输入一个字符串的anagram的C#算法
<br />输出字符串所有的anagram的string,用的是递归调用的办法。non-recursive: TODO!!!<br /> <br />public void GetAnagramString(string str1, string str2) { if (str1.Length < 1) Console.WriteLine(str2 + str1); else原创 2011-05-04 09:52:00 · 978 阅读 · 0 评论 -
计算机英语词汇贴
<br />异或:Exclusive or<br />小括号:bracket (Parentheses)<br />中括号:square brackets<br />大括号:brace<br /><br />原创 2011-05-03 03:24:00 · 550 阅读 · 0 评论 -
Some other questions
1. What's the test plan need to contain?2. What's the SDLC?3. If you manager don't agree your estimation. For example, the manday you provide is more than he want.原创 2011-05-04 04:48:00 · 434 阅读 · 0 评论 -
向右swap int数组
public void MoveArray(int[] arr, int n) { int index = 0; int count = 0; int len = arr.Length; n = n % len; int prev = arr[0]; while (count原创 2011-05-05 14:09:00 · 393 阅读 · 0 评论 -
求出两个字符串的最长公共子串
这道题要用到suffex-tree的概念,可能还需要用到动态规划(英文可能叫Dynamic Programming),现在突然有事情要做,之后一定补上。下面是wiki的解释:http://en.wikipedia.org/wiki/Longest_common_substring_problem原创 2011-05-06 05:58:00 · 602 阅读 · 0 评论 -
查询链表是否有重合节点
<br />和同事讨论了一下,有好几种方法是可行的:<br />1. 算出两个的<br />2. 将链表A走完,末尾指向的B的头节点<br />3. 将A链表倒转,然后走B链表,如果B链表的最后一个节点是A链表之前的头节点,则表示重合。<br />4. 用Hashtable来存储A链表,然后走B链表,来判断hashtable里面是否有重复节点存在。<br />public Node GetFirstDuplicateNode(Node a, Node b) { i原创 2011-05-07 03:22:00 · 1090 阅读 · 0 评论 -
螺旋形打印矩阵
<br /><br />代码是从网上copy来的,但是自己理解了一下,并且重新修改了一下,本来他是逆时针打印的,现在我改成顺时针打印,挺好理解的。<br />这里用到的就是int[,]而不是int[][],据说int[,]只有在c#里面有,到现在还不知道具体怎么区分这两个之间的区别。<br /> <br /> int[,] array = new int[6, 6]{<br /> {11,12,13,14,15, 16},<br /> {21,22,23,原创 2011-05-19 07:12:00 · 745 阅读 · 0 评论 -
一道Amazon经典的题目,经常会考到,给一个target数字以及一个数组,求所有的加起来为这个数字的组合
<br />用HashTable来做最方便,其实这道题目已经很久之前就知道了,怎么做已经滚瓜烂熟了,结果我在写code的时候还碰到了这样那样的问题,看来有些问题看似容易,但是没有实践一下的话说不定真到到实践的时候就又会碰到一大堆问题的。<br />以下贴一下这个函数的实现,可能写的比较冗余了,但是算法还是基本能体现的<br />public static void FindTarget2Numbers(int[] a, int targetNumber) { Ha原创 2011-05-18 13:37:00 · 1192 阅读 · 0 评论 -
C#中接口和抽象类
今天先放一道简单题: 抽象类和接口有什么区别?difference between interface and abstract class? 抽象类:能够被实例化。接口:不能被实例化。 抽象类:一个类只能继承一个抽象类。接口:一个类可以继承多个接口。 抽象类:具有其他类的通用属性。接口:可以包含属性,索引器,事件(这些都必须被定义为public),原创 2010-02-25 16:46:00 · 400 阅读 · 0 评论 -
c#中反射的理解
Understanding about C# reflection. System.Reflection C#中反射能否访问私有方法:可以。C#中反射能否访问私有变量:可以。原创 2010-02-26 17:36:00 · 976 阅读 · 0 评论 -
开博了
注册了CSDN的帐号但是从来也没有在上面写过博客,准备开博了,最近真是郁闷,觉得面试面得自己很没面子,做了这么多年的程序一些简单的题目都没有办法回答出来。实在是太没面子了,准备弄个每日一题放在上面,可以积累一下。原创 2010-02-25 16:45:00 · 327 阅读 · 0 评论 -
Windows Form下面如何处理多国语言
.NET中编写Windows Form程序如何处理多国语言?How to resolve the multi language problem in .NET when developing the Windows Form? 多国语言中本地化与国际化的区别。Whats the difference between Localization & Globalization?原创 2010-03-01 18:46:00 · 432 阅读 · 0 评论 -
XML, XSLT, XSD, XPATH, XSL
Xml, xslt, xsd, xpath描述一下XML: Extensible Markup Language扩展标记语言,用来处理结构化文档。XSLT: XSL Transformations。用来将一种XML转换成另外一种XML文档。也可以将XML转换成XHTML或者HTML在浏览器中显示。XSD: XML Schemas Definition。用来定义XML文档的结构。XML原创 2010-03-07 15:14:00 · 1128 阅读 · 0 评论 -
WPF中所有的控件都继承于什么?
都继承于UIElement.(Visual, DependencyObject, DispatcherObject)扩展:Element一般是通过继承自FrameworkElement自定义控件时,一般是通过继承自Control原创 2010-03-10 17:19:00 · 1120 阅读 · 0 评论 -
一道数据库的概念题
<br />Do you know what's the ACID?<br /> <br /> <br />http://en.wikipedia.org/wiki/ACID<br /> <br />atomicity, consistency, isolation, durability is a set of property which garentee the database transaction processed reliable.<br /> <br /> <br />Atomicity原创 2011-05-10 10:22:00 · 569 阅读 · 0 评论 -
How to answer tell me about yourself question.
<br />Non-tech related question.原创 2011-05-11 02:52:00 · 452 阅读 · 0 评论 -
另外一道关于Random的编程题
如果有1000个不同的数字,如何随机取得其中的100个成为数列,并且数列中没有重复。原创 2011-05-11 01:44:00 · 448 阅读 · 0 评论 -
What's the difference between Dictionary, Hashtable & Hashset?
<br />This is just the reference. Will post the difference late when have time.<br />http://suebuntu.blogspot.com/2010/06/c-dictionary-hashtable-and-hashset.html原创 2011-05-17 09:01:00 · 608 阅读 · 0 评论 -
重载运算符
<br />没想到在C#里面也可以重载运算符,还挺有趣的,具体的格式是这样子的:<br />public static decimal operator +(Program a, int b) { return a.i + b; } <br />用的时候也很有趣:<br /> <br />Program p1 = new Program(); Program p2 = new Program();原创 2011-05-18 16:09:00 · 404 阅读 · 0 评论 -
What's the difference between Heap and Stack
也算是C++里面的一个概念吧。另外还涉及到了statichttp://www.cnblogs.com/jsean/articles/1599801.html原创 2011-05-17 15:35:00 · 668 阅读 · 0 评论 -
再读Dynamic Programming
<br />真后悔大学没有好好学,当时记得老师说过动态规划的题目,但是自己当时根本不知道学这个是干嘛用的。。。<br />现在想起来应该先出来工作两年,面试两年,然后再开始上课就知道这些东西的重要性了!<br />言归正传,来说DP<br /> <br />背包问题是NP完全问题,DP用来求背包问题是最优的可解方案之一。<br />所谓背包问题就是:设有n件物品,每件价值记为Pi,每件体积记为Vi,用一个最大容积为Vmax的背包,求装入物品的最大价值。<br />用一个数组f[i,j]表示取i件商品填充一个原创 2011-05-19 05:21:00 · 696 阅读 · 0 评论 -
判断两棵二叉树是否是balanced
<br />static void Main(string[] args) { Node root = new Node(); Node c1 = new Node(); Node c2 = new Node(); root.left = c1; root.right = c2; Node c11 = new Node();原创 2011-05-19 11:39:00 · 474 阅读 · 0 评论 -
树的深度优先非递归算法
前序遍历(pre-order traverse) public void DFS_Pre(Node root) { Stack s = new Stack(); while (s.Count != 0) { Console.WriteLine(s.Pop().value); if (root.left != null) s.Push(root.l原创 2011-05-19 12:29:00 · 798 阅读 · 0 评论 -
Amazon面试题目
<br /><br />1. Computer Fundemental<br />2. OO design<br />3. Coding question<br />4. Data structure<br />5. Algorythm<br />6. Edge case<br />7. Quality Ensurance.<br />8. Customer Focus<br />9.原创 2011-05-17 07:02:00 · 1457 阅读 · 0 评论 -
What's the difference between overload and override
<br />Overload means same function name defined in the class, but with different parameters. It's just about the polymophysm.<br />void func( int );<br />void func( double );<br />void fund( unsigned int );<br /> <br />Override means same function name wit原创 2011-05-18 13:06:00 · 891 阅读 · 0 评论 -
快速排序
<br />今天研究了一下快速排序法,发现自己还真笨,快速排序法到现在都还没搞清楚。<br />这个方法用的是递归(每做一次partition,都会将pivotloc放到中间,既把比它小的放左边,比它大的放右边)<br />public void QuickSort(int [] r, int low, int high) { int pivotloc = 0; if (low < high) {原创 2011-05-08 16:01:00 · 458 阅读 · 0 评论