2009年1月21日星期三

软件开发者面试百问(转载)

想雇到搞软件开发的聪明人可不容易。万一一不小心,就会搞到一堆低能大狒狒。我去年就碰到这种事了。你肯定不想这样吧。听我的,没错。在树上开站立会议门都没有。

问点有难度的问题能帮你把聪明人跟狒狒们分开。我决定把我自己整理出来的软件开发者面试百问发出来,希望能帮到你们的忙。

这个列表涵盖了软件开发知识体系中定义的大多数知识域。当然,如果你只想找出类拔萃的程序员,便只需涉及结构、算法、数据结构、测试这几个话题。如果想雇架构师,也可以只考虑需求、功能设计、技术设计这些地方。

不过不管你怎么做,都要牢记一点:

这里大多数问题的答案都没有对错之分!

你可以把我的这些问题作为引子,展开讨论。例如下面有个问题是使用静态方法或是单例的缘由。如果那个面试的就此展开长篇大论,那他很有可能是个聪明能干的家伙!如果他一脸茫然的看着你,发出这种声音,很明显这就是只狒狒了。同样,想知道一个数是不是2的乘方也有很多方法,不过要是面试的人想用mod运算符,嗯……你知道我的意思吧。(你不知道也没关系,来根香蕉?)

需求

  1. 你能给出一些非功能性(或者质量)需求的例子么?
  2. 如果客户需要高性能、使用极其方便而又高度安全,你会给他什么建议?
  3. 你能给出一些用来描述需求的不同技术么?它们各自适用于什么场景?
  4. 需求跟踪是什么意思?什么是向前追溯,什么是向后追溯?
  5. 你喜欢用什么工具跟踪需求?
  6. 你怎么看待需求变化?它是好是坏?给出你的理由。
  7. 你怎样研究需求,发现需求?有哪些资源可以用到?
  8. 你怎么给需求制定优先级?有哪些技术?
  9. 在需求过程中,用户、客户、开发人员各自的职责是什么?
  10. 你怎么对待不完整或是令人费解的需求?

功能设计

  1. 在功能设计中有哪些隐喻?给出几个成功的例子。
  2. 如果有些功能的执行时间很长,怎么能让用户感觉不到太长的等待?
  3. 如果用户必须要在一个很小的区域内,从一个常常的列表中选择多个条目,你会用什么控件?
  4. 有哪些方法可以保证数据项的完整?
  5. 建立系统原型有哪些技术?
  6. 应用程序怎样建立对用户行为的预期?给出一些例子。
  7. 如何入手设计一组数量庞大而又复杂的特性,你能举出一些设计思路吗?
  8. 有一个列表,其中有10个元素,每个元素都有20个字段可以编辑,你怎样设计这种情况?如果是1000个元素,每个元素有3个字段呢?
  9. 用不同的颜色对一段文本中的文字标记高亮,这种做法有什么问题?
  10. Web环境和Windows环境各有些什么限制?

技术设计

  1. 什么是低耦合和高聚合?封装原则又是什么意思?
  2. 在Web应用中,你怎样避免几个人编辑同一段数据所造成的冲突?
  3. 你知道设计模式吗?你用过哪些设计模式?在什么场合下用的?
  4. 是否了解什么是无状态的业务层?长事务如何与之相适应?
  5. 在搭建一个架构,或是技术设计时,你用过几种图?
  6. 在N层架构中都有哪些层?它们各自的职责是什么?
  7. 有哪些方法可以确保架构中数据的正确和健壮?
  8. 面向对象设计和面向组件设计有哪些不同之处?
  9. 怎样在数据库中对用户授权、用户配置、权限管理这几项功能建模?
  10. 怎样按照等级制度给动物王国(包括各种物种和各自的行为)建模?

结构

  1. 你怎样保证你的代码可以处理各种错误事件?
  2. 解释一下什么是测试驱动开发,举出极限编程中的一些原则。
  3. 看别人代码的时候,你最关心什么地方?
  4. 什么时候使用抽象类,什么时候使用接口?
  5. 除了IDE以外,你还喜欢哪些必不可少的工具?
  6. 你怎么保证代码执行速度快,而又不出问题?
  7. 什么时候用多态,什么时候用委派?
  8. 什么时候使用带有静态成员的类,什么时候使用单例?
  9. 你在代码里面怎么提前处理需求的变化?给一些例子。
  10. 描述一下实现一段代码的过程,从需求到最终交付。

算法

  1. 怎样知道一个数字是不是2的乘方?怎样判断一个数是不是奇数?
  2. 怎样找出链表中间的元素?
  3. 怎样改变10,000个静态HTML页面中所有电话号码的格式?
  4. 举出一个你所用过的递归的例子。
  5. 在哈希表和排序后的列表中找一个元素,哪个查找速度最快?
  6. 不管是书、杂志还是网络,你从中所学到的最后一点算法知识是什么?
  7. 怎样把字符串反转?你能不用临时的字符串么?
  8. 你愿意用什么类型的语言来编写复杂的算法?
  9. 有一个数组,里面是从1到1,000,000的整数,其中有一个数字出现了两次,你怎么找出那个重复的数字?
  10. 你知道“旅行商问题(Traveling Salesman Problem)”么?

数据结构

  1. 怎样在内存中实现伦敦地铁的结构?
  2. 怎样以最有效的方式在数据库中存储颜色值?
  3. 队列和堆栈区别是什么?
  4. 用堆或者堆栈存储数据的区别是什么?
  5. 怎样在数据库中存储N维向量?
  6. 你倾向于用哪种类型的语言编写复杂的数据结构?
  7. 21的二进制值是什么?十六制值呢?
  8. 不管是书、杂志还是网络,你从中所学到的最后一点数据结构的知识是什么?
  9. 怎样在XML文档中存储足球比赛结果(包括队伍和比分)?
  10. 有哪些文本格式可以保存Unicode字符?

测试

  1. 什么是回归测试?怎样知道新引入的变化没有给现有的功能造成破坏?
  2. 如果业务层和数据层之间有依赖关系,你该怎么写单元测试?
  3. 你用哪些工具测试代码质量?
  4. 在产品部署之后,你最常碰到的是什么类型的问题?
  5. 什么是代码覆盖率?有多少种代码覆盖率?
  6. 功能测试和探索性测试的区别是什么?你怎么对网站进行测试?
  7. 测试栈、测试用例、测试计划,这三者之间的区别是什么?你怎么组织测试?
  8. 要对电子商务网站做冒烟测试,你会做哪些类型的测试?
  9. 客户在验收测试中会发现不满意的东西,怎样减少这种情况的发生?
  10. 你去年在测试和质量保证方面学到了哪些东西?

维护

  1. 你用哪些工具在维护阶段对产品进行监控?
  2. 要想对一个正在产品环境中被使用的产品进行升级,该注意哪些重要事项?
  3. 如果在一个庞大的文件中有错误,而代码又无法逐步跟踪,你怎么找出错误?
  4. 你怎样保证代码中的变化不会影响产品的其他部分?
  5. 你怎样为产品编写技术文档?
  6. 你用过哪些方式保证软件产品容易维护?
  7. 怎样在产品运行的环境中进行系统调试?
  8. 什么是负载均衡?负载均衡的方式有哪些种?
  9. 为什么在应用程序的生命周期中,软件维护费用所占的份额最高?
  10. re-engineering和reverse engineering的区别是什么?

配置管理

  1. 你知道配置管理中基线的含义么?怎样把项目中某个重要的时刻冻结?
  2. 你一般会把哪些东西纳入版本控制?
  3. 怎样可以保证团队中每个人都知道谁改变了哪些东西?
  4. Tag和Branch的区别是什么?在什么情况下该使用tag,什么时候用branch?
  5. 怎样管理技术文档——如产品架构文档——的变化?
  6. 你用什么侗剧管理项目中所有数字信息的状态?你最喜欢哪种工具?
  7. 如果客户想要对一款已经发布的产品做出变动,你怎么处理?
  8. 版本管理和发布管理有什么差异?
  9. 对文本文件的变化和二进制文件的变化进行管理,这二者有什么不同?
  10. 同时处理多个变更请求,或是同时进行增量开发和维护,这种事情你怎么看待?

项目管理

  1. 范围、时间、成本,这三项中哪些是可以由客户控制的?
  2. 谁该对项目中所要付出的一切做出估算?谁有权设置最后期限?
  3. 减少交付的次数,或是减少每个每个交付中的工作量,你喜欢哪种做法?
  4. 你喜欢用哪种图来跟踪项目进度?
  5. 迭代和增量的区别在哪里?
  6. 试着解释一下风险管理中用到的实践。风险该如何管理?
  7. 你喜欢任务分解还是滚动式计划?
  8. 你需要哪些东西帮助你判断项目是否符合时间要求,在预算范围内运作?
  9. DSDM、Prince2、Scrum,这三者之间有哪些区别?
  10. 如果客户想要的东西太多,你在范围和时间上怎样跟他达成一致呢?
译文来自: http://www.infoq.com/cn/articles/programmer-interview

英文版: 100 Interview Questions for Software Developers
Hiring smart software developers is not easy. If you're not careful you might end up hiring a bunch of moronic mandrills, like I did last year. And you don't want that. Trust me. Stand-up meetings are very hard to do in a tree.

The key is to ask challenging questions that enable you to distinguish the smart software developers from the moronic mandrills. And to help you with that, I decided to publish my private list of 100 interview questions for software developers.

This list covers most of the knowledge areas as defined by the Software Engineering Body of Knowledge. Of course, if you're just looking for brilliant programmers, you may want to limit the topics to Construction, Algorithms, Data Structures and Testing. And if you're looking for architects, you can just consider the questions under the headings Requirements, Functional Design and Technical Design.

But whatever you do, keep this in mind:
For most of the questions in this list there are no right and wrong answers
!

My questions are simply starting points for interesting discussions. For example: there is a question about reasons to use static methods vs. singletons. If this triggers your candidate to start a tirade againt both static methods and singletons, there's a good chance you're dealing with a smart software developer! But if the candidate can produce nothing more than a blank stare and this sound, then he might very well be a moronic mandrill. Likewise, there are many correct ways to find out whether a number is a power of 2. But if the candidate suggests using the mod operator, well... you know what I mean. (And if you don't, no problem. Fancy a banana?)

Requirements

  1. Can you name a number of non-functional (or quality) requirements?
  2. What is your advice when a customer wants high performance, high usability and high security?
  3. Can you name a number of different techniques for specifying requirements? What works best in which case?
  4. What is requirements tracing? What is backward tracing vs. forward tracing?
  5. Which tools do you like to use for keeping track of requirements?
  6. How do you treat changing requirements? Are they good or bad? Why?
  7. How do you search and find requirements? What are possible sources?
  8. How do you prioritize requirements? Do you know different techniques?
  9. Can you name the responsibilities of the user, the customer and the developer in the requirements process?
  10. What do you do with requirements that are incomplete or incomprehensible?

Functional Design

  1. What are metaphors used for in functional design? Can you name some successful examples?
  2. How can you reduce the user's perception of waiting when some functions take a lot of time?
  3. Which controls would you use when a user must select multiple items from a big list, in a minimal amount of space?
  4. Can you name different measures to guarantee correctness of data entry?
  5. Can you name different techniques for prototyping an application?
  6. Can you name examples of how an application can anticipate user behavior?
  7. Can you name different ways of designing access to a large and complex list of features?
  8. How would you design editing twenty fields for a list of 10 items? And editing 3 fields for a list of 1000 items?
  9. What is the problem of using different colors when highlighting pieces of a text?
  10. Can you name some limitations of a web environment vs. a Windows environment?

Technical Design

  1. What do low coupling and high cohesion mean? What does the principle of encapsulation mean?
  2. How do you manage conflicts in a web application when different people are editing the same data?
  3. Do you know about design patterns? Which design patterns have you used, and in what situations?
  4. Do you know what a stateless business layer is? Where do long-running transactions fit into that picture?
  5. What kinds of diagrams have you used in designing parts of an architecture, or a technical design?
  6. Can you name the different tiers and responsibilities in an N-tier architecture?
  7. Can you name different measures to guarantee correctness and robustness of data in an architecture?
  8. Can you name any differences between object-oriented design and component-based design?
  9. How would you model user authorization, user profiles and permissions in a database?
  10. How would you model the animal kingdom (with species and their behavior) as a class system?

Construction

  1. How do you make sure that your code can handle different kinds of error situations?
  2. Can you explain what Test-Driven Development is? Can you name some principles of Extreme Programming?
  3. What do you care about most when reviewing somebody else's code?
  4. When do you use an abstract class and when do you use an interface?
  5. Apart from the IDE, which other favorite tools do you use that you think are essential to you?
  6. How do you make sure that your code is both safe and fast?
  7. When do you use polymorphism and when do you use delegates?
  8. When would you use a class with static members and when would you use a Singleton class?
  9. Can you name examples of anticipating changing requirements in your code?
  10. Can you describe the process you use for writing a piece of code, from requirements to delivery?

Algorithms

  1. How do you find out if a number is a power of 2? And how do you know if it is an odd number?
  2. How do you find the middle item in a linked list?
  3. How would you change the format of all the phone numbers in 10,000 static html web pages?
  4. Can you name an example of a recursive solution that you created?
  5. Which is faster: finding an item in a hashtable or in a sorted list?
  6. What is the last thing you learned about algorithms from a book, magazine or web site?
  7. How would you write a function to reverse a string? And can you do that without a temporary string?
  8. What type of language do you prefer for writing complex algorithms?
  9. In an array with integers between 1 and 1,000,000 one value is in the array twice. How do you determine which one?
  10. Do you know about the Traveling Salesman Problem?

Data Structures

  1. How would you implement the structure of the London underground in a computer's memory?
  2. How would you store the value of a color in a database, as efficiently as possible?
  3. What is the difference between a queue and a stack?
  4. What is the difference between storing data on the heap vs. on the stack?
  5. How would you store a vector in N dimensions in a datatable?
  6. What type of language do you prefer for writing complex data structures?
  7. What is the number 21 in binary format? And in hex?
  8. What is the last thing you learned about data structures from a book, magazine or web site?
  9. How would you store the results of a soccer/football competition (with teams and scores) in an XML document?
  10. Can you name some different text file formats for storing unicode characters?

Testing

  1. Do you know what a regression test is? How do you verify that new changes have not broken existing features?
  2. How can you implement unit testing when there are dependencies between a business layer and a data layer?
  3. Which tools are essential to you for testing the quality of your code?
  4. What types of problems have you encountered most often in your products after deployment?
  5. Do you know what code coverage is? What types of code coverage are there?
  6. Do you know the difference between functional testing and exploratory testing? How would you test a web site?
  7. What is the difference between a test suite, a test case and a test plan? How would you organize testing?
  8. What kind of tests would you include for a smoke test of an ecommerce web site?
  9. What can you do reduce the chance that a customer finds things that he doesn't like during acceptance testing?
  10. Can you tell me something that you have learned about testing and quality assurance in the last year?

Maintenance

  1. What kind of tools are important to you for monitoring a product during maintenance?
  2. What is important when updating a product that is in production and is being used?
  3. How do you find an error in a large file with code that you cannot step through?
  4. How can you make sure that changes in code will not affect any other parts of the product?
  5. How do you create technical documentation for your products?
  6. What measures have you taken to make your software products more easily maintainable?
  7. How can you debug a system in a production environment, while it is being used?
  8. Do you know what load balancing is? Can you name different types of load balancing?
  9. Can you name reasons why maintenance of software is the biggest/most expensive part of an application's life cycle?
  10. What is the difference between re-engineering and reverse engineering?

Configuration Management

  1. Do you know what a baseline is in configuration management? How do you freeze an important moment in a project?
  2. Which items do you normally place under version control?
  3. How can you make sure that team members know who changed what in a software project?
  4. Do you know the differences between tags and branches? When do you use which?
  5. How would you manage changes to technical documentation, like the architecture of a product?
  6. Which tools do you need to manage the state of all digital information in a project? Which tools do you like best?
  7. How do you deal with changes that a customer wants in a released product?
  8. Are there differences in managing versions and releases?
  9. What is the difference between managing changes in text files vs. managing changes in binary files?
  10. How would you treat simultaneous development of multiple RfC's or increments and maintenance issues?

Project Management

  1. How many of the three variables scope, time and cost can be fixed by the customer?
  2. Who should make estimates for the effort of a project? Who is allowed to set the deadline?
  3. Do you prefer minimization of the number of releases or minimization of the amount of work-in-progress?
  4. Which kind of diagrams do you use to track progress in a project?
  5. What is the difference between an iteration and an increment?
  6. Can you explain the practice of risk management? How should risks be managed?
  7. Do you prefer a work breakdown structure or a rolling wave planning?
  8. What do you need to be able to determine if a project is on time and within budget?
  9. Can you name some differences between DSDM, Prince2 and Scrum?
  10. How do you agree on scope and time with the customer, when the customer wants too much?
Posted by Picasa


从摄影里面用vegas提出来的照片。妞妞笑的样子,可爱吧。今天是她人生的六十六天。也终于找到了可以编辑SONY高清晰格式视频的工具--vegas。 发现功能是不少,就是不会用。抽时间,入门一下。
Posted by Picasa

2009年1月15日星期四

为梦想而坚持--走进而立之年的我

晚上想想千条路,早上起来走原路!这是很多人的处境,我也脱离不了。记得儿时的时候,每个人都对未来充满憧憬,那个时候最流行的八股文就是以『我的理想』命名的作文了,我认为。现在你还能记得你那时的理想吗,如果你记得,并且你现在为此奋斗,我认为你已经成功了,敬佩这样的人。反正我是记不太清楚了,并且都记不清楚了我改了多少次我要做什么?马拉松我也坚持下来了,但我要做什么我却始终没有坚持下去。
为梦想而坚持!能从现在做起吗?
今天晚上充满了激情,明天早上希望它余温尚存!虽然已经而立之年,什么也没有立,就立个梦想,立一个为梦想而坚持的心劲吧。就像标题一样,走进而立之年的我是什么样的,就是能做到为梦想而坚持,采取行动,给梦想一个实现的机会,而不是再次放飞梦想。梦想是什么就不说了,哈哈哈!

--EOF

我的妈妈,侄子,女儿




今天我的妞妞出生满两个月了。因为不能陪在她身边深感遗憾,但这就是生活,“冬天“的生活。不过看到了她们的照片,心里还是暖烘烘的,这就是家的感觉。更应该感谢我的老婆,她比我更明白我们的妞妞对她意味着什么。感恩,我们每个人都需要。
祝愿我的妞妞和可爱的侄子健康成长!
更祝愿两位母亲,我的妈妈&妞妞的妈妈---我的LP!
也鼓励一下自己,不要忘记了责任,坚持,梦想。这样才能更快乐,充实的活着。
Posted by Picasa

2009年1月10日星期六

十八项重要的工作 EQ

EQ Emotion Quotient 的英文缩写,意思是“情绪智慧”或“情绪智商,简称情商EQ 是一个人自我情绪管理以及管理他人情绪的能力指数,对一个人的生活,工作有着非常重要的影响。哈佛大学高曼教授(DanielGoleman)在《EQ》一书中提出了『十八项重要的工作 EQ』

第一项:自我察觉
  1、意识到自己情绪的变化:解读自己的情绪,体认到情绪的影响。
  2、精确的自我评估:了解自己的优点以及不足之处。
  3、自信:掌控自身的价值及能力。

第二项:自我管理
  4、情绪自制力:能够克制冲动及矛盾的情绪。
  5、坦承:展现出诚实及正直;值得信赖。
  6、适应力:弹性强,可以适应变动的环境或克服障碍。
  7、成就动机:具备提升能力的强烈动机,追求卓越的表现。
  8、冲劲:随时准备采取行动,抓住机会。

第三项:社交察觉
  9、同理心:感受到其它人的情绪,了解别人的观点,积极关心他人。
  10、团体意识:解读团体中的趋势、决策网络及政治运作。
  11、服务:体认到客户及其它服务对象的需求,并有能力加以满足。

第四项:人际关系管理
  12、领导能力:以独到的愿景来引导及激励他人。
  13、影响力:能说服他人接受自己的想法。
  14、发展其它人的能力:透过回馈及教导来提升别人的能力。
  15、引发改变:能激发新的做法。
  16、冲突管理:减少意见相左,协调出共识之能力。
  17、建立联系:培养及维持人脉。
  18、团队能力:与他人合作之能力;懂得团队运作模式。

8项属于自我情绪管理能力,后10项属于人际关系之管理能力。如果能做到上述中的几点那么在生活和工作中你也许就会展现出你耀眼的光芒。但实际上现实中又能做到几点呢!也许这只能成为我的或你的行动的指导原则,虽然很难达到,但是只要按着这种原则去生活,去工作,即使是屡败屡战,那也是有益的,改变就会悄悄的靠近你。贵在于用行动去坚持,而不是思想上的飞跃,行动上的爬行。道理虽然浅显,但路曲折漫长.............

我能做到吗?你能做到吗?わからない

2009年1月8日星期四

美国金融危机的成因和巨大危害

这半年来金融危机闹得人心惶惶,现在都深受其中了。不过对于平民老百姓来说,只要每月能发工资,有东西吃,才不去管什么经济,金融危机呢。我曾经也是这种“乐天派“中的一员。不过最近公司景气不在,准备涉足金融行业,给那些金融行业做个什么分析,优化,让他们避免风险,忽悠忽悠他们。也许这个在国内市场搞不通,不过面对日本鬼子,他们还真信。我也服了他们了。也许都是给金融危机吓破了胆,弄成了饥不择食了,只要你能忽悠,就是冒着被忽悠得风险,也让你TRY,估计是被risk给吓的,只记得架在脖子上的那把屠刀--金融危机,却感觉不到大腿上的肉被人家切了一块,就是知道,也愿意了。毕竟为了换脖子上的钢项圈,那点肉又算什么呢。
既然咱要做金融方面的分析了,虽然以前也自称在金融行业,其实那不过就是做个数据分析,弄个模型找一下什么样的顾客好,什么样的顾客坏,对金融知连皮上的毛都不知道什么样的。所以这段时间没少看一些这方面的资料,papers等。遇到不懂的概念,咱就维基(国内似乎上不去,我就纳闷了,这个也给Close,我还有点不相信。为此,还和我老婆争论了一次,我让她上wikipedia去查,她说上不去,我还以为她骗我呢!多了),谷歌,百度了。废话上说,给点有知识性的东西。下面的东西是从百度知道上搞下来的,现转载一下(我不知道原作者哪位,若知原出处,定追加,要是不需转载,得知定删除)。
转载地址如下URL:
http://zhidao.baidu.com/question/78305196.html

美国金融危机的成因和巨大危害

对金融危机最普遍的官方解释是次贷问题,然而次贷总共不过几千亿,而美国政府救市资金早已到了万亿以上,为什么危机还是看不到头?
有文章指出危机的根源是金融机构采用“杠杆”交易;另一些专家指出金融危机的背后是62万亿的信用违约掉期(Credit Default Swap, CDS)。那么,次贷,杠杆和CDS之间究竟是什么关系?它们之间通过什么样的相互作用产生了今天的金融危机?
为通俗易懂起见,我们使用了几个假想的例子。有不恰当之处欢迎批评讨论。

一、杠杆:
目前,许多投资银行为了赚取暴利,采用20-30倍杠杆操作,假设一个银行A自身资产为30亿,30倍杠杆就是900亿。也就是说,这个银行A以 30亿资产为抵押去借900亿的资金用于投资,假如投资盈利5%,那么A就获得45亿的盈利,相对于A自身资产而言,这是150%的暴利。反过来,假如投 资亏损5%,那么银行A赔光了自己的全部资产还欠15亿。

二、 CDS合同:
由于杠杆操作高风险,所以按照正常的规定,银行不进行这样的冒险操作。所以就有人想出一个办法,把杠杆投资拿去做“保险”。这种保险就叫CDS。
比如,银行A为了逃避杠杆风险就找到了机构B。机构B可能是另一家银行,也可能是保险公司,诸如此类。
A对B说,你帮我的贷款做违约保险怎么样,我每年付你保险费5千万,连续10年,总共5亿,假如我的投资没有违约,那么这笔保险费你就白拿了,假如违约,你要为我赔偿。
A想,如果不违约,我可以赚45亿,这里面拿出5亿用来做保险,我还能净赚40亿。如果有违约,反正有保险来赔。所以对A而言这是一笔只赚不赔的生意。
B是一个精明的人,没有立即答应A的邀请,而是回去做了一个统计分析,发现违约的情况不到1%。如果做一百家的生意,总计可以拿到500亿的保险金,如果其中一家违约,赔偿额最多不过50亿,即使两家违约,还能赚400亿。
A,B双方都认为这笔买卖对自己有利,因此立即拍板成交,皆大欢喜。

三、CDS市场:
B做了这笔保险生意之后,C在旁边眼红了。C就跑到B那边说,你把这100个CDS卖给我怎么样,每个合同给你2亿,总共200亿。B想,我的400亿要10年才能拿到,现在一转手就有200亿,而且没有风险,何乐而不为,因此B和C马上就成交了。
这样一来,CDS就像股票一样流到了金融市场之上,可以交易和买卖。实际上C拿到这批CDS之后,并不想等上10年再收取200亿,而是把它挂牌 出售,标价220亿;D看到这个产品,算了一下,400亿减去220亿,还有180亿可赚,这是“原始股”,不算贵,立即买了下来。一转手,C赚了20 亿。从此以后,这些CDS就在市场上反复的抄,现在CDS的市场总值已经抄到了62万亿美元。

四、次贷:
上面A,B,C,D,E,F....都在赚大钱,那么这些钱到底从那里冒出来的呢?从根本上说,这些钱来自A以及同A相仿的投资人的盈利。而他们的盈利大半来自美国的次级贷款。人们说次贷危机是由于把钱借给了穷人。
笔者对这个说法不以为然。笔者以为,次贷主要是给了普通的美国房产投资人。这些人的经济实力本来只够买自己的一套住房,但是看到房价快速上涨,动 起了房产投机的主意。他们把自己的房子抵押出去,贷款买投资房。这类贷款利息要在8%-9%以上,凭他们自己的收入很难对付,不过他们可以继续把房子抵押 给银行,借钱付利息,空手套白狼。
此时A很高兴,他的投资在为他赚钱;B也很高兴,市场违约率很低,保险生意可以继续做;后面的C,D,E,F等等都跟着赚钱。

五、次贷危机:
房价涨到一定的程度就涨不上去了,后面没人接盘。此时房产投机人急得像热锅上的蚂蚁。房子卖不出去,高额利息要不停的付,终于到了走头无路的一天,把房子甩给了银行。此时违约就发生了。
此时A感到一丝遗憾,大钱赚不着了,不过也亏不到那里,反正有B做保险。B也不担心,反正保险已经卖给了C。
那么现在这份CDS保险在那里呢,在G手里。G刚从F手里花了300亿买下了100个CDS,还没来得及转手,突然接到消息,这批CDS被降级, 其中有20个违约,大大超出原先估计的1%到2%的违约率。每个违约要支付50亿的保险金,总共支出达1000亿。加上300亿CDS收购费,G的亏损总 计达1300亿。虽然G是全美排行前10名的大机构,也经不起如此巨大的亏损。因此G濒临倒闭。

六、金融危机:
如果G倒闭,那么A花费5亿美元买的保险就泡了汤,更糟糕的是,由于A采用了杠杆原理投资,根据前面的分析,A赔光全部资产也不够还债。因此A立 即面临破产的危险。除了A之外,还有A2,A3,...,A20,统统要准备倒闭。因此G,A,A2,...,A20一起来到美国财政部长面前,一把鼻涕 一把眼泪地游说,G万万不能倒闭,它一倒闭大家都完了。财政部长心一软,就把G给国有化了,此后A,...,A20的保险金总计1000亿美元全部由美国 纳税人支付。

七、美元危机:
上面讲到的100个CDS的市场价是300亿。而CDS市场总值是62万亿,假设其中有10%的违约,那么就有6万亿的违约CDS。这个数字是 300亿的200倍。如果说美国政府收购价值300亿的CDS之后要赔出1000亿。那么对于剩下的那些违约CDS,美国政府就要赔出20万亿。如果不 赔,就要看着A20,A21,A22等等一个接一个倒闭。无论采取什么措施,美元大贬值已经不可避免。
以上计算所用的假设和数字同实际情况会有出入,但美国金融危机的严重性无法低估