📣 黑五价提前开抢|VIP一年通行证5折,蓝莓、Offer多多同步特惠
12
返回列表 发新帖
楼主: zhaorui1991
跳转到指定楼层
上一主题 下一主题
收起左侧

LinkedIn 面经 2014.01.07

🔗
 楼主| zhaorui1991 2014-1-10 13:20:15 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
MYcolting 2014-1-11 23:34:42 | 只看该作者
全局:
linkedin他家的题目重复度很高啊

补充内容 (2014-1-11 23:37):
Supervised Learning?怎么还问了machine learning的东西?楼主面的职位是啥?
回复

使用道具 举报

🔗
devinwang 2014-1-11 23:44:45 | 只看该作者
全局:
能详细说下第一题是什么的么?谢谢
回复

使用道具 举报

🔗
 楼主| zhaorui1991 2014-1-12 04:58:03 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
 楼主| zhaorui1991 2014-1-12 05:03:52 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
nju_happy 2014-1-12 06:15:27 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
 楼主| zhaorui1991 2014-1-12 06:29:28 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

🔗
johnnywsd 2014-4-15 11:13:37 | 只看该作者
全局:
我的解法。编译能够通过。
  1. """
  2. public void printFactors(int n)
  3.   example:
  4.   input:12
  5.   output:
  6.     1 * 12
  7.     2 * 6
  8.     2 * 2 * 3
  9.     3 * 4

  10.   input:24
  11.   output:
  12.     1 * 32
  13.     2 * 16
  14.     2 * 2 * 8
  15.     2 * 2 * 2 * 4
  16.     2 * 2 * 2 * 2 * 2
  17.     2 * 4 * 4
  18.     4 * 8
  19. """


  20. def _get_factors_aux(n, k):
  21.     """
  22.     get facotrs without (1, n)
  23.     """
  24.     i = k
  25.     res = [[1, n]]
  26.     while i <= n / i:
  27.         if n % i == 0:
  28.             tmp = _get_factors_aux(n / i, i)
  29.             for item in tmp:
  30.                 if item[0] != 1:
  31.                     res.append([i] + item)
  32.                 elif item[0] == 1:
  33.                     res.append([i] + item[1:])
  34.         i += 1
  35.     return res


  36. def get_factors(n):
  37.     return _get_factors_aux(n, 2)


  38. def print_factors(n):
  39.     num_list = get_factors(n)
  40.     for item in num_list:
  41.         tmp = [str(x) for x in item]
  42.         print ' * '.join(tmp)
复制代码
这里是测试用例
  1. import unittest
  2. from solution import get_factors
  3. from solution import print_factors


  4. class Test(unittest.TestCase):

  5.     def test1(self):
  6.         n = 32
  7.         res = get_factors(n)
  8.         print len(res)
  9.         print res
  10.         print_factors(n)

  11.     def test2(self):
  12.         n = 12
  13.         res = get_factors(n)
  14.         print len(res)
  15.         print res
  16.         print_factors(n)

  17.     def test3(self):
  18.         n = 4
  19.         res = get_factors(n)
  20.         print len(res)
  21.         print res
  22.         print_factors(n)

  23.     def test4(self):
  24.         n = 9
  25.         res = get_factors(n)
  26.         print len(res)
  27.         print res
  28.         print_factors(n)

  29. if __name__ == '__main__':
  30.     unittest.main(verbosity=2)
复制代码
回复

使用道具 举报

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

本版积分规则

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