回复: 16
收起左侧

[facebook实习面试题目]F intern interview review, first round

本楼:   👍  0
0%
0%
0   👎
全局:   42
100%
0%
0

() @ - -   | | |

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
chatting for a long time at the beginning T_T

1. add sibling pointer to the left sibling of each node in a tree
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
is the challenge to support cost based optimization in Hive.

上一篇:[intel实习面试]Intel Second Round Phone Interview Review
下一篇:[facebook实习面试题目]f intern interview review, second round
wwwyhx 2011-10-14 03:39:08 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   177
88%
12%
25
本帖最后由 wwwyhx 于 2011-10-14 03:43 编辑

12分钟

struct NODE
{
        NODE* pLft;
        NODE* pRgt;
        NODE* pLSib;

        NODE() : pLSib(NULL), pLft(NULL), pRgt(NULL) {}
};

NODE* _link_parent(NODE* pChld, NODE* pParent)
{
        assert(pParent);
        if (NULL == pChld) return;

        NODE* pIter = pParent;
        while (pIter != NULL)
        {
                if (pIter->pRgt != pChld)
                        return pIter->pRgt;
                else if (pIter->pLft != pChld)
                        return pIter->pLft;
                else
                        pIter = pIter->pLSib;
        }

        return NULL;
}

void LinkSib(NODE* pRoot)
{
        if (NULL == pRoot) return;
        
        if (pRoot->pRgt != NULL)
        pRoot->pRgt->pLSib = _link_parent(pRoot->pRgt, pRoot);

        if (pRoot->pLft != NULL)
        pRoot->pLft->pLSib = _link_parent(pRoot->pLft, pRoot);

        LinkSib(pRoot->pRgt);
         LinkSib(pRoot->pLft);}
回复

使用道具 举报

wwwyhx 2011-10-14 03:46:11 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   177
88%
12%
25
根本没时间检查, 一大堆bug
回复

使用道具 举报

 楼主| Imbalism 2011-10-14 05:44:30 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   42
100%
0%
0
just got the email that I've passed(4 hours later)

Action without delay.
回复

使用道具 举报

wwwyhx 2011-10-14 07:40:19 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   177
88%
12%
25
just got the email that I've passed(4 hours later)

Action without delay.
Imbalism 发表于 2011-10-14 05:44



    过了把第二轮的经验也贴上来, thanks
回复

使用道具 举报

thunderfyc 2011-10-14 08:56:42 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   3334
98%
2%
77
电面么。。。四个小时。。。
看来我真的被默拒了。。。。。。
回复

使用道具 举报

 楼主| Imbalism 2011-10-14 10:04:55 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   42
100%
0%
0
不是,on campus的,跟电面不一样。因为明天直接2面
回复

使用道具 举报

darksteel 2011-10-14 10:25:49 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   32
100%
0%
0
回复 1# Imbalism
我记得这题以前有人发过,用了挺久才想清楚,15分钟太少了
回复

使用道具 举报

wwwyhx 2011-10-14 10:44:00 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   177
88%
12%
25
回复  Imbalism
我记得这题以前有人发过,用了挺久才想清楚,15分钟太少了
darksteel 发表于 2011-10-14 10:25



    我以前发过, 后来其他人答上来了, 可以挖坟找找
回复

使用道具 举报

darksteel 2011-10-14 10:49:30 | 显示全部楼层
本楼:   👍  0
0%
0%
0   👎
全局:   32
100%
0%
0
回复 9# wwwyhx
对,我记得看到过一个可行的想法,自己还试了半天,才算理清头绪。最后编出个东西都懒得测了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表