潇's profile老肖的地盘PhotosBlogListsMore Tools Help

Blog


    November 06

    死牛肉

        今天无意中在网上瞄到google的一些面试题,其中有一道考察软件工程师的题目,死牛肉的意义。下面参考答案大谈死牛肉如何的无意义,然后怎么变废为宝云云。一声叹息,遂在网上搜了一些死牛肉,与这个题目有关的答案都是这样。悲剧啊,悲剧啊,你说他谷堂堂一个大公司,有必要给你玩啥脑筋急转弯吗?而且那个题目是考察软件工程师,我想他谷对软件工程师肯定要求很高很高,这个题目肯定是考察一个程序员的基本功和钻研能力,于是我将正确答案写在这里,供一些不明真相的群众围观,免得有些人的高谈阔论误人子弟。

        死牛肉,DEAD BEAF,这样一写,对程序员来看就亲切不少,很容易观察到,每个字母都是A-F之间,那么很容易就联想到,他应该是一个16进制的记号,那么这个记号在哪里使用呢?在MAC平台下,堆的开辟会在堆开始的地址和结束的地址中加上DEAD BEAF,中间的区段就是堆实际的内容,加上这些标志位,可以确定堆的开始和结束之处,方便了OS对堆的定位,另一方面,在堆释放的时候,OS会去检查这些标志位是否正常,如果不正常,这会采取一些措施以免恶意的程序破坏操作系统。

        同样,还有一些其它的一语双关的单词,比如坏食物,BAAD F00D,坏线BADCAB1E,这些东东都可以16进制数展现出来,在某些地方发挥着神奇的作用。

        写这篇文章想说明两点,第一,软件工程师的思维是严谨的,这个题目的目的很能测试出这一点,试想像网上大侃特侃的回答,只能显示出那个人的浅薄,和作为一个程序员的不合格。第二,尽信网不如无网,虽然这个时代我们有了我度,还有他谷,但是怎样去看待这些信息资源,和怎样去消化这些资源,是我们每个人都应该思考的,科技让人更聪明,而不是让人更傻瓜。

    Comments (1)

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Kevin Sagewrote:
    牛A和牛C之间的人
    Nov. 23

    Trackbacks

    The trackback URL for this entry is:
    http://seanxiaoxiao.spaces.live.com/blog/cns!7677365E5B9342DE!692.trak
    Weblogs that reference this entry
    • None