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

买它PE挂经

全局:

2022(4-6月) 码农类General 硕士 全职@meta - 猎头 - 技术电面  | 😐 Neutral 😐 Average | Fail | 应届毕业生

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

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

x
挂了好失望,问题我全部都粘贴在下面了,

1. 代码部分

# Imagine you are given a plain text, ASCII, English document, something like a
# book from Project Gutenberg. Develop a concordance for the book -- the number
# of times each word appears -- and then print the top N most frequent words and
# how many times they occur. N can be either hardcoded or a parameter.
'''
# what is the input format of the string?
The input could be any ASCII string
Could you give some examples?
It could be a book, a news article, any possible ASCII string could be input.
So a csv file right?  you can assume the input to the function will be a python str
Concordance: frequency of each word
Input: string
Output: top N most frequent words and their respective frequencies
Pseudocode:
1. extract words from string and get list of words
2. loop through words and count the frequency by recording in a dictionary: word -> frequency
3. use heap to extract top N most frequent words from the dictionary
4. return words extracted from the heap
Jeffrey: This sounds like a reasonable approach if you want to start coding it up
'''
def N_most_frequent_words(str, n):
    # let n denote the length of the string
    sentence = str.remove(',','.',':') # scans str once O(n)
    words = sentence.split(' ') #enumeration here so O(n)
    d = {}
    for word in words:  #iteration through list so O(m) where m is the length of the list
        word = word.lower()
        if word in d:
            d[word] += 1
        else:
            d[word] = 1
    heap = [(frequency, word) for word, frequency in d.items()] # dictionary iteration so O(k) where k is the number of keys
    n_most_frequent_words = heapq.nlargest(n, heap) #heapify operation is O(n logn)
    for frequency, word in n_most_frequent_words: #another iteration over a list so O(l) where l = len(n_most_frequent_words)
        print(word, frequency)
# What if my input string is "The the THE ThE". Then the output should be "the: 4". But your current solution will not handle that
# to render words capital/lowercase invariant, one could utilise regular expressions, but I am not too familiar with regex commands
# Can you think of another way besides using regex to normalize the words?
# I know another solution
# transform all capital letters to lowercase using .toLowerCase() if I remember the method correctly
# Yes this is a good idea. I think the method in python is just .lower(). Can you modify your solution above to handle this?
# What if my input string is "The, the. THE; ThE?". Then the output should be "the: 4". But your current solution will not handle that
# in the event where the delimiters between words are all different, my approach would be to use .remove() to delete all non-letter instances
# and then use .split(' ') using white space as the delimiter
# Sounds good, do you want to modify your solution to handle this case?
# I don't remember if .remove() permits multiple arguments,  
# That's fine, I get the idea.
# I think the solution works now! What is the time complexity of this solution?
# Time complexity analysis looks good! I have no further questions on this one, are you ready to move on to the next coding problem?
# Yes
# Ok, this next question is based off of the game Minesweeper.
# In the game of Minesweeper you are given a Two Dimensional grid with a variable number of
# mines randomly located within the grid.
# Write a function that generates a game grid with mines placed at random. The function should take arguments for
# Length, Width and Number of Mines.
# The function should return the constructed 2D grid.  Place at most one mine per cell
'''
Input: length, width, number of mines
Output: matrix
Pseudocode:
let -1 denote that the matrix entry is a mine
let 0 denote that the matrix entry is not a mine
Let's use 0 for no mine and -1 for a mine. You will see why later. ok
The issue here is randomness, if the mine locations are indeterminate, then what approach should I take to simulate randomness?
There are built in functions in python to generate randomness. Are you familiar with python rand library?
The most I know is the random number generator. I could use that, but do not recall the name of the RNG method
I believe it is rand.randInt(lo, hi) which will generate a random number between lo (inclusive) and hi (exclusive)
1. generate random coordinates (x, y) for mines 1, ..., n
2. use list comprehension to intialize a matrix of zeros
3. change zeros to -1 for each mine coordinate given in step 1
Sounds good
'''
def generate_grid(length, width, n):
    mines = set()
    while len(mines) < n:
        x = rand.randInt(0, width)
        y = rand.randInt(0, length)
        mines.add((x,y))
    grid = [[0 for column in range(width)] for row in range(length)]
    for row in range
您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
使用VIP即刻解锁阅读权限或查看其他获取积分的方式
游客,您好!
本帖隐藏的内容需要积分高于 188 才可浏览
您当前积分为 0。
VIP即刻解锁阅读权限查看其他获取积分的方式
Unlock interview details and practice with AI
Curated Interview Questions from Top Companies
required to run
-check if I/O slow by using the pidstat -d -p to check the io delay
------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Hi Daniel, given we have only 2 minutes left, let's stop here. Please use the remaining time for any questions you have for me :)
ok,
1. My question is about working on-call as a production engineer. Is it exhausting? or is it fun?
At Meta, every SWE or PE team member is oncall for the things their team owns. We have a "you write it, you own it" kinda philosophy, so PE and SWE have an oncall scenario that looks alike. Some PE teams do oncall jointly with their SWE partner teams, while some PE teams own a non-overlapping area that they do oncall independently for. Oncall load largely depends on the maturity state of the area your team owns, your alerting quality, documentation, etc and there is no one-size-fits-all answer to this question due to this reason. Most good teams make oncall maturity a priority and hence it is fun as you get to focus on challenging problems while automating the non-interesting parts of the oncall.
Any other questions?
In production engineering, what is the career growth like at Meta, are production engineers going to be working on maintaining the security and reliability of the Metaverse that is to come?
Career growth is same as that for SWEs, I believe it is easier to find lot of examples about SWE growth at Meta on public forums and you can imagine the same will apply to PE.
Yes there are PE teams in the Reality labs space, if you are specifically interested about the Metaverse work. In general, Metaverse will be powered by multiple teams/orgs including infra and product teams, and they all will eventually have some scope for reliability, scalability, efficiency, security work that PEs specialize in. PEs are already playing an important role in AI space that is crucial for Metaverse. There are also PE teams in AR/VR space.
Hope that answers the question. We are at time, so we can wrap up unless there are more questions.
Thank you for your answers. I was interested in working on the Metaverse so your previous answer definitely gave me some much needed motivation.
I wish you a wonderful rest of your evening.
Thank you, and hope you have a good rest of the day too! Thanks for taking the time to interview with us, and all the best! I will disconnect now.
Great, see you!











































































评分

参与人数 2大米 +18 收起 理由
匿名用户-JR943 + 17
Reincarnation + 1 很有用的信息!

查看全部评分


上一篇:cisco ng oa
下一篇:巨硬组面

本帖被以下淘专辑推荐:

地里匿名用户
🔗
匿名用户-KTN5G  2022-4-29 12:25:33 来自APP
心疼楼主!
想问问什么时候面的?多久后给的回复呢?
谢谢!
回复

使用道具 举报

🔗
Reincarnation 2022-4-29 17:07:40 | 只看该作者
全局:
哇! 超级详细,已加米!我觉得楼主答得挺好的啊为啥没过。。 以及ng的pe vo只有一轮coding + 一轮system吗? 谢谢!
回复

使用道具 举报

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

使用道具 举报

地里匿名用户
🔗
匿名用户-5GLKC  2022-4-30 04:46:15
本楼:
PE是几?
回复

使用道具 举报

🔗
 楼主| 微信用户_92937b7 2022-5-1 04:56:52 | 只看该作者
全局:
PE 是 Production Engineer
回复

使用道具 举报

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

本版积分规则

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