Coding Interview | Software Engineer @ Facebook

Coding Interview | Software Engineer @ Facebook

Keep On Coding

5 лет назад

60,852 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@enriquewilliams8676
@enriquewilliams8676 - 04.06.2022 11:19

So I should learn java rather than phyton... Right...?

Ответить
@Basta11
@Basta11 - 06.05.2022 18:40

BFS level by level requires 2 while loops.
The outer loops as long as there are nodes in the queue.

The inner while loop goes through the current level. Either keep a count at the beginning or use another queue for the current level. Or add the children nodes in another queue.

The second problem is better with BFS. BFS from each gate. The first BFS will be exhaustive for the entire map.

The subsequent BFS from other gates will stop when they can’t improve the number (with lower numbers) of the cells. Basically, we BFS from each gate until we can’t improve the cells anymore meaning there is a gate closer in those cells.

Ответить
@ayoubkhalil1
@ayoubkhalil1 - 03.05.2022 05:27

These two problems are quite straigt forward. I doubt that the Facebook interview questions are this easy.

Ответить
@kelvinxg6754
@kelvinxg6754 - 23.03.2022 11:55

is this on the phone?

Ответить
@SirAlex61G8008S
@SirAlex61G8008S - 08.02.2022 22:46

How many leetcode problems did you solve?

Ответить
@user-lm8px8eg4v
@user-lm8px8eg4v - 14.06.2021 04:29

调距对焦速度的关系,每放大0.001倍,距离,对焦速度加快2%以上,需要计算

Ответить
@ajalbani
@ajalbani - 26.05.2021 00:51

shortest distance in a matrix is always bfs :)

Ответить
@5p3cia1Kay
@5p3cia1Kay - 20.05.2021 20:16

I think i would have made a Map fuction with the key as the depth and the items as the numbers. then just average each map index.

Ответить
@hakooplayplay3212
@hakooplayplay3212 - 25.03.2021 20:28

donw saw the end solution of 2nd problem, but its clear that you can stop dfs if you find a lower path number same as you hit a wall

Ответить
@RippanCSGO
@RippanCSGO - 01.03.2021 12:27

If you've seen the question before, just let me know and I can give you another one
"...sure ;)"

Ответить
@deathbombs
@deathbombs - 01.03.2021 09:07

BFS is the more optimal approach, since we want the SHORTEST results

Ответить
@Oscar-ig2gm
@Oscar-ig2gm - 20.02.2021 11:22

I think you could optimize the last problem even it uses dfs by adding a line after if... {} else if (input[row][col] == depth) { return }
or am I wrong?

Ответить
@actzful
@actzful - 06.02.2021 15:00

the solution to the first question is wrong if there are multiple branches. on each level, he’s only doing an average of the one parent. right solution is to keep a list of list on each level. add each level, append it to the that list of list. then loop at the end to find the average. how i was able to solve it? i did a similar problem before. not a fang engineer, but ~120 leetcode questions so far. keep going guys, we all gonna get into fang!!

Ответить
@stealthypirate318
@stealthypirate318 - 19.12.2020 08:19

this is like watching a title fight . Pure gold. thank you.

Ответить
@felipealmeida7772
@felipealmeida7772 - 13.10.2020 19:28

Under the impression that your solution for the first question won’t work on binary trees with more than 2 levels. You’re only checking for the both node child’s (left and right) as they were the hole level, but that ain’t true for all cases. Despite it was in this example

Ответить
@lahaale5840
@lahaale5840 - 11.10.2020 01:54

too many ads makes super annoy!

Ответить
@blink182lives100
@blink182lives100 - 30.09.2020 21:09

"If youve seen the question before just le me know and I can give another one" LMAO yea OK SURE

Ответить
@onurislak
@onurislak - 22.09.2020 19:23

to work in google,amazon,facebook is hard.

Ответить
@haydenmalcomson9967
@haydenmalcomson9967 - 17.06.2020 06:41

Elon Musk on leetcode

Ответить
@rahulreddy9063
@rahulreddy9063 - 15.06.2020 10:56

Bro I am very passionate in coding and problem solving but I feel like I’m struck while problem solving and some questions hard to understand even ! For example : Matrix problem i didn’t even understand

Ответить
@rahulreddy9063
@rahulreddy9063 - 15.06.2020 10:48

I’m trying to understand 2nd que ! Can someone help ! Thank you !

Ответить
@my3m
@my3m - 24.04.2020 04:45

Thanks Sam. Any cons to using DFS for the second question? Why did you select BFS?

Ответить
@krishnareddykalli6068
@krishnareddykalli6068 - 17.04.2020 22:56

Really liked your approach in solving problems, I cleared initial round of interview with Facebook and scheduled further rounds in next week.. Can you help me with the process and next steps?

Ответить
@zeeshanmohammad6296
@zeeshanmohammad6296 - 06.04.2020 01:56

The second question looks really really hard. How are you so good at translating your concepts into perfect code? Whenever you write some code you only need syntax corrections but your logic needs no correction. You write near 99% correct code in terms of logic. How can a person improve upon their ability to translate their ideas into code?

Ответить
@killerside1
@killerside1 - 30.11.2019 06:10

Check you instagram sam, got a question for ya, thanks

Ответить