美文网首页北美求职面经程序员
2016-04-03-Collective Health Hac

2016-04-03-Collective Health Hac

作者: 番茄晓蛋 | 来源:发表于2016-04-04 07:30 被阅读55次

Collect Health Software Engineer OA
要求在20分钟内完成所有的题目,不能copy 和paste答案。题目都比较基础,现场搜google 有点来不及。还是靠自己平时的积累。里面有好几套题。我因为时间紧张,就选第一套来完成了。

  1. 时间复杂度
func removeChar (String input, String illeagePattern) {
     for (char x : illeagePattern) {
         input.remove(x);
     }
}

选项有
O(n), O(2n), O(nm), O(nlogn)
我选的 O(nm);

  1. unit test
"signal failure within a unit test"  
题干没记全,这题没把握,我选的是 assert  

参考:
Wikipedia: It is generally possible to perform unit testing without the support of a specific framework by writing client code that exercises the units under test and uses assertions, exception handling, or other control flow mechanisms to signal failure

  1. coding question
var add: () -> Int = {
  var counter = 0;
  return {counter = counter + 2; return counter}
}()
print(add())
print(add())

运行输出结果是 ?
备选项有
2
4
我给的答案是 None of above

  1. HTTP
    From the list of http methods please select ALL that are reasonable to alter data:
    我给的是 post, put, delete

  2. coding question

func multiplyPriors(n: Int) -> Int {
  switch n {
  case 0:
    return 1
  case 1:
    return 2
  default:
    return multiplyPriors(n-1) * multiplyPriors(n-2)
  }
}

算法复杂度是____
选项是 O(n), O(2n), O(n^2), O(nlogn)

  1. 分析上述程序,可能的结果
    我选的是 stack overflow when large n

  2. 计算结果 multiplyPriors(4)=_____
    我的答案是 8

  3. n/a

  4. 给出orders表

 ----------------------------
name             |  type
orderNumber (pk) |  number
Status           |  varchar50
 ----------------------------
-- Status = 'Shipped'
-- 求所有没有shipped订单数
select count(*) from ORDERS where status <> 'Shipped';  
  1. 求top 5的没有shipped的订单
    select * from ORDERS where status <> 'Shipped' limit 5;

相关文章

  • 2016-04-03-Collective Health Hac

    Collect Health Software Engineer OA 要求在20分钟内完成所有的题目,不能co...

  • 集群

    负载均衡的分类: (1)负载均衡集群 (2)HAC (3)并行计算(Hadoop/Spark) HA集群(HAC)...

  • GitHub Atom

    Atom is a texteditor that's modern, approachable, yet hac...

  • AMOR APUNTE 5

    desde hacía muchos años no aceptaba un compromiso social ...

  • Aprender el español con dicciona

    Que timido,remilgo。 Que tiene genialidad o dones para hac...

  • HEALTH

    no zuo no die,why you try. 是的,经常性不吃早饭,跑了趟医院。 胃镜+B超=胆返胃炎。 ...

  • Health

    Health has always been the greatest wealth in life, but a...

  • HEALTH

    My research topic will be on health. The question I will ...

  • Health

    Everyone knows health is very important for us but almost...

  • health

    健康习惯-早上排毒:一杯温开水、排便、吃早餐,将一整夜的毒素排出体外,早餐不吃容易导致胆汁淤积,沉淀产生结石

网友评论

    本文标题:2016-04-03-Collective Health Hac

    本文链接:https://www.haomeiwen.com/subject/rnbulttx.html