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

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, 在学校也搞过正儿八经的研究. 这个带起来应该能很快起飞, 但已经等不到了, 今天是在该公司的最后一天, 只能祝福着这位"带不动同事", 平静地离开了.

19998 次点击
所在节点    程序员
173 条回复
deepred
2019-07-18 13:25:51 +08:00
哪有这么好的同事,还帮辅导你 c++
fhsan
2019-07-18 13:25:54 +08:00
哦,以前交接的时候劝退过好几个新同事,吓得我以后交接的时候不敢讲太多。
Vegetable
2019-07-18 13:26:00 +08:00
楼主好人
515576745
2019-07-18 13:29:06 +08:00
做笔记是最好的学习方式。
jdhao
2019-07-18 13:32:57 +08:00
楼主的英语表达不错,你的同事水平太差,不值得你费劲,这些问题自己自学应该就能搞定
tankren
2019-07-18 13:37:49 +08:00
楼主好人
VoidChen
2019-07-18 13:38:01 +08:00
话说 c++入门确实不好弄,之前工作需要要写一点,边看资料边写,结果一个地方传完参数忘了回收,结果就内存溢出了(压测对的时候才发现)。。。
wsseo
2019-07-18 13:38:05 +08:00
我怎么没遇到这样的好人。
Skypemifan
2019-07-18 13:39:22 +08:00
确实好人
geelaw
2019-07-18 13:39:42 +08:00
抬个杠:不存在 single-choice question 这种表达,直接说 multiple-choice question 就行。
zxq2233
2019-07-18 13:40:48 +08:00
楼主是小姐姐
Skypemifan
2019-07-18 13:42:27 +08:00
c++ primer 确实又多又杂 哈哈哈哈 明天我也要离职了
LxExExl
2019-07-18 13:42:45 +08:00
惭愧 cs 科班出身 工作 2 年

现在一个题都做不出来了
crisfun
2019-07-18 13:43:38 +08:00
英语真简单啊
msaionyc
2019-07-18 13:47:51 +08:00
态度问题,这题只要两个月没全部划水,怎么说几个选择题能选出来吧
yueqiuge
2019-07-18 13:54:54 +08:00
@geelaw 如果要说明是多选的话就说 multiple choice with multiple answers 吗
atom234
2019-07-18 13:56:21 +08:00
建议楼主去辅导我的以为新同事,手动🐶头
kidlfy
2019-07-18 13:57:44 +08:00
emmmm 最近也在看这本书 惊觉我和那位大兄弟竟然一样的学习方法....在书里勾勾画画....所以有大神给个答案吗
janus77
2019-07-18 13:57:52 +08:00
你还辅导?要是我就一句话:自己弄懂,到时候要考,不过就走人吧
然后看不看随他了,反正又不是我被开
fy1993
2019-07-18 14:02:54 +08:00
楼主真心好人, 不过感觉你这同事不值得你这么费心的去带

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

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

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

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

© 2021 V2EX