新同事的考核, 一题也不会

2019-07-18 13:22:16 +08:00
 justou

因为要离开现公司, 两个月前招到一个来接替我的小伙子, 此子只用过 C, 做了半年嵌入式, 我对他进行了两个月的 C++培训, 带着他看 C++ primer 这本书(这本书既厚又杂,想着有我帮着梳理的话亦可事半功倍, 感觉这本书不太好, 但是又没找到可替代的又是中文版的 C++入门书), 让他完成一些编程任务, 帮他 debug 并解惑, 更多的是解释原理: 为什么是这样的.

现在到考核期了, 公司要求用英文出题考核他, 题如下:

C++ Questions

Single Choice

(3 points each, 15 points total)

  1. Which one of the following C++ codes is correct C++11 expression?

    • [ ] A. const int i{3.14};
    • [ ] B. int & i = 233;
    • [ ] C. const int& i{3.14};
    • [ ] D. constexpr double pi{3.14};
  2. which one of the following is valid lambda expression usage?

    • [ ] A.

      int i = 10;
      auto f = [](){ return i+1;};
      f();
      
    • [ ] B.

      int i = 10;
      auto f = [](int i){ return i+1;};
      f();
      
    • [ ] C.

      int i = 10;
      auto f = []{ return i+1;};
      f();
      
    • [ ] D.

      int i = 10;
      auto f = [i]{ return i+1;};
      f();
      
  3. What does public inheritance mean?

    • [ ] A. Implementation details
    • [ ] B. Private interfaces
    • [ ] C. Composition
    • [ ] D. Is-a relationship
  4. What does private inheritance mean?

    • [ ] A. Implementation details

    • [ ] B. Private interfaces

    • [ ] C. Composition

    • [ ] D. Is-a relationship

  5. Suppose we have two classes(both with default constructors): class Base{...};, class Derived: public Base {...};, which one of the following usage is correct?

    • [ ] A. Derived* d = new Base;
    • [ ] B. Derived* d = new Base{};
    • [ ] C. std::unique_ptr<Base> ptr = std::make_unique<Derived>();
    • [ ] D. std::unique_ptr<Derived> ptr = std::unique_ptr<Derived>(new Base);

Answer the following questions

(5 points each, 25 points total)

  1. Use range for syntax to add 10 to each elements of the following vector:

    auto numbers = std::vector<int>{1, 2, 3, 4, 5};

    
    
  2. Use std::for_each to answer the previous question.

    
    
  3. Suppose Buffer* create_buffer() is some library function to allocate resources, and bool release_buffer(Buffer* buffer) is the counterpart to free the allocated resources, use std::unique_ptr to manage the resources.(hint: when the std::unique_ptr object is out of scope, the allocated resources are automatically released.)

    
    
  4. Suppose class Object must have a copy constructor, a copy assign operator, a move constructor, a move assign operator and a destructor, write down their signatures .

    
    
  5. RAII is a key C++ programming technique, write down your understanding of RAII (not the literal meaning)

    
    

我参考当初他问过的问题以及给他的解答出的, 当然考核只是个形式, 所以我直接把题给他先看看, 让他先尝试着做, 结果一题不会! 苦口婆心两个月 == 0.

有一些想法:

  1. 想 21 天精通 C++, 得参考某张漫画里面来, 一时找不到图了, 就是最后发明时光机穿越回到学 C++第 21 天, 然后捅死自己那张漫画;
  2. 新同事学习方法很有问题, 每次我跟他讲一些原理的时候让他记一下, 他说这个很显然啊, 没必要记, 然后下次问他相同问题, 对方回答无非是"搞忘了", "你跟我讲过这个吗?" ,根本带不动!
  3. 不梳理知识, 只在书里面随便勾勾画画, 当然这本书等于没看;
  4. 题可能出得太难了, 不适合 C++初学者, 但是平时这些主题讲得特别多, 现在看来对方的"嗯嗯, 理解了"明显是在敷衍我了, 其实那根本是在敷衍自己;
  5. 英文太差, 其实一开始题都没读懂, 我一个个地解释了一遍, 还是不会做;
  6. 搜索引擎对他来讲是摆设.
  7. 人不笨, 但是思维方式已经出现严重问题了, 想甩锅给他之前受过的应试教育. 平时给他讲了很多学习方法跟思考方式, 估计也早成耳边风了.

考核肯定是过不了的了, 最后估计会留在公司打杂, 因为最近又招了个新的人, 还没来报道, 看简历是个硕士, 虽然没写过 C++, 但会 python 跟 java, 在学校也搞过正儿八经的研究. 这个带起来应该能很快起飞, 但已经等不到了, 今天是在该公司的最后一天, 只能祝福着这位"带不动同事", 平静地离开了.

20063 次点击
所在节点    程序员
173 条回复
justforlook44444
2019-07-18 14:45:09 +08:00
@justou
看 C++ primer 第三版我觉得好点。
Woood
2019-07-18 14:46:15 +08:00
从你提离职到你可以走,就一个月时间,带的人能不能接手雨女无瓜
perfectlaugh
2019-07-18 14:46:34 +08:00
没人推荐 cppreference.com 🐎
sangleft
2019-07-18 14:48:11 +08:00
@perfectlaugh 第二是 D 吧?
Aoerz
2019-07-18 14:49:06 +08:00
perfectlaugh
2019-07-18 14:50:33 +08:00
@sangleft 这是 closure 不是一般的函数 closure 可以拿当前函数的变数
perfectlaugh
2019-07-18 14:53:02 +08:00
xswl 这个图
cxyfreedom
2019-07-18 14:53:20 +08:00
凭以前 C 的经验,前四个应该是 DDDC 吧,后面不知道了
legiorange
2019-07-18 14:54:15 +08:00
@justou 还招 java 吗。。kotlin groovy 都会的那种。。
perfectlaugh
2019-07-18 14:55:10 +08:00
@sangleft 完了 应该是 D
perfectlaugh
2019-07-18 14:55:21 +08:00
写太多 rust 导致错乱
perfectlaugh
2019-07-18 14:56:39 +08:00
justou
2019-07-18 14:58:12 +08:00
@Woood 学到个新词: 雨女无瓜. 今晚公司要开欢送会, 发现出场人员名单没他, 然后问了下之后怎么安排他, 听说是辞退, 原来又新招的人是替他的了_(:з」∠)_
RorschachZZZ
2019-07-18 15:01:18 +08:00
我在上家公司交接工作,吓跑了俩新同事。。最后负责我原来工作的新同事也在交接完成后不久就走了。。。
RockOrRoll
2019-07-18 15:07:37 +08:00
教练,我想学 C++
maguazhou
2019-07-18 15:07:39 +08:00
选择题,蒙阿
zjddp
2019-07-18 15:08:38 +08:00
这么好的前辈上哪找去
justou
2019-07-18 15:09:28 +08:00
@bzshow1
@legiorange 发个公司链接 http://zhiqiankeji.cn/

不过我已经走了, 公司也没人会写 C++了, 用 C++是必须的. 进来好处是太多空闲时间, 随意充实自己, 人都很好相处, 二十几岁的小姐姐不少, 有几个还是单身; 坏处也是太多空闲时间, 没啥具体的事干, 还有个坏处是已经没人带了, 进来只能自己摸索, 也许会荒废自己.

已经没利益相关了, 靠情怀推广一下
sangleft
2019-07-18 15:13:38 +08:00
@perfectlaugh 触及盲点。。敲了一下 AC 是同样的错没有捕获到变量 i,B 是调用时缺少参数,D 是啥错了呢。。
justou
2019-07-18 15:14:32 +08:00
记得公司好像一直想搞移动端的服务, 也需要会 java 的童鞋, C++是算法组必须的, 软件组 C#, java 应该都需要

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/584098

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX