回复: 22
跳转到指定楼层
上一主题 下一主题
收起左侧

Yelp onsite 已跪

全局:

2014(10-12月) 码农类General 本科 全职@Yelp - 校园招聘会 - Onsite  | | Fail |

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
1) Generate 一個掃雷遊戲的 board
[size=12.8000001907349px]








[size=12.8000001907349px]用一個 2D array 來表示 board,給出 board 的長(L)寬(W) 和地雷數量(M),隨機地把 M 個地雷放在 L*W 個格子裏面,並在沒有地雷的格子中標記格子周圍地雷的數量。要求:絕對的 Random,並且避免發生 collision(generate 出同樣的 random number after processing)

[size=12.8000001907349px]def generateBoard(L, W, M):
[size=12.8000001907349px]    """ return a 2D array representing the game board """

[size=12.8000001907349px]2) Implement

[size=12.8000001907349px]


[size=12.8000001907349px]給你一個 2D board,裏面包含 game 的 initial state;黑點代表 alive,白色代表 dea
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
What are the differences? How could different processes communicate with each other?


[size=12.8000001907349px]What is deadlock? How to prevent deadlock?

[size=12.8000001907349px]Tell me what happens when you enter a URL on your web browser and hit enter. Explain the process of getting a web page back, as detailed as you can.

[size=12.8000001907349px]What are TCP and UDP? What are the differences between them? If TCP is better than UDP, why would people still use UDP? In what situation would you ever want to use UDP, and why?

[size=12.8000001907349px]What's the difference between 'range' and 'xrange' in Python?

[size=12.8000001907349px]Explain the differences between C++ and Python. Particularly, explain the different memory management scheme in each, and describe how you would implement a garbage collection procedure for Python.

[size=12.8000001907349px]... 其他的我記不清了。。。



补充内容 (2015-1-31 07:53):
Sorry for the "[size=12.8000001907349px]", I didn't see any of them before I posted, but it came out of nowhere after I hit the submit button...

评分

参与人数 5大米 +112 收起 理由
neomiracle + 3 感谢分享!
豌豆开心果 + 100
cjlm007 + 3 感谢分享!
wuluoluo + 3 感谢分享!
ycsung + 3 感谢分享!

查看全部评分


上一篇:A家面筋
下一篇:fb onsite之后三周还没出结果。。。

本帖被以下淘专辑推荐:

  • · Yelp|主题: 11, 订阅: 3
推荐
 楼主| rwei 2015-3-14 11:34:23 | 只看该作者
全局:
您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 100 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限 或 查看其他获取积分的方式
Unlock interview details and practice with AI
Popular Interview Questions from Top Companies
回复

使用道具 举报

推荐
池大侠 2015-3-14 02:26:46 | 只看该作者
全局:
get a bruce force to solve the first problem how to you do it without bruce force?
  1. import random
  2. def miner(L,W,M):
  3.         if M>L*W:
  4.                 return None
  5.         board=[['.' for i in range(W)] for j in range(L)]
  6.         rowm=random.sample(range(L),M)
  7.         colm=random.sample(range(W),M)
  8.         for row in rowm:
  9.                 for col in colm:
  10.                         board[row][col]='m'
  11.         def check(x,y):
  12.                 return x>=0 and x<L and y>=0 and y<W and board[x][y]=='m'
  13.         def bruce(x,y):
  14.                 rownbr=[0,-1,-1,-1,0,1,1,1]
  15.                 colnbr=[-1,-1,0,1,1,1,0,-1]
  16.                 count=0
  17.                 for k in range(len(rownbr)):
  18.                         if check(x+rownbr[k],y+colnbr[k]):
  19.                                 count+=1
  20.                 if board[x][y]!='m':
  21.                         board[x][y]=count
  22.         for row in range(L):
  23.                 for col in range(W):
  24.                         bruce(row,col)
  25.         return board



  26. print miner(12,14,2)
复制代码
回复

使用道具 举报

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

使用道具 举报

🔗
fsc111 2015-1-31 07:49:23 | 只看该作者
全局:
lz投的什么职位,为啥一直让实现GUI
回复

使用道具 举报

🔗
 楼主| rwei 2015-1-31 07:52:17 | 只看该作者
全局:
This one:

http://www.yelp.com/careers?jvi=oDOmWfwt,Job

I added the image to demonstrate what they wanted me to do, but all that they asked was to fill in the function body, of which the interfaces have been defined and provided.
回复

使用道具 举报

🔗
Primer 2015-1-31 08:18:16 | 只看该作者
全局:
lz多久出结果的?
回复

使用道具 举报

🔗
 楼主| rwei 2015-1-31 08:59:52 | 只看该作者
全局:
Primer 发表于 2015-1-31 08:18
lz多久出结果的?

1 week from onsite interview
回复

使用道具 举报

🔗
broccoli 2015-1-31 09:06:44 | 只看该作者
全局:
感谢lz分享!
回复

使用道具 举报

全局:
LZ面试一定要用python吗。。。可不可以用Java
回复

使用道具 举报

🔗
 楼主| rwei 2015-2-2 00:48:10 | 只看该作者
全局:
Yelp 是一家以 Python 為主的公司,onsite 的四輪當中有兩輪被要求一定要用 Python,剩下兩輪隨便什麼語言。
回复

使用道具 举报

🔗
arthur1233 2015-2-17 05:16:00 | 只看该作者
全局:
感觉题都不简单啊,楼主拿到没有
回复

使用道具 举报

🔗
brian8759 2015-2-20 04:30:37 | 只看该作者
本楼:
全局:
好难。。。。。。。。。。
回复

使用道具 举报

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

本版积分规则

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