Friday, February 25, 2011

今天有个Qualcomm的面试

是第一轮,直接和hiring manager谈的。别的都还好,有两个问题。
1. White-board coding of factor function.
---
int factor(int n)
{
    int result;

    if (n == 1)
        return 1;
    else if (n > 0)
        result = factor(n - 1); /* should be result = n * factor (n - 1); */
    else
    {
        printf("input must be positive");
        return -1;
    }

    return result;
}
---
惭愧的是,这么个简单的白板写code都没有答对,非要等到manager说“Where is the multiplication?”我才想起来。

2. What is a thread deadlock?
这是我的死穴,以前工作中没有遇到过,也没有什么这方面的知识。一定要补一下。看来以后空闲的时候不能光看围棋,水木的C/C++版面也得经常去学习一下。要不碰到面试还真的没辙。

估计这次面试后,进入第二轮的希望不大。

No comments:

Post a Comment