JavaScript interview with a Google engineer

preview_player
Показать описание
Watch someone try to solve the Longest Common Subsequence of Two Strings problem in Javascript with a Google engineer. This is a mock interview - see if the candidate solves the problem!

Рекомендации по теме
Комментарии
Автор

I'm 5 seconds in and I already feel the anxiety myself

coolmanjack
Автор

I can feel the adrenaline locking his mind.

thcoura
Автор

Interviewer - "Talk me through how you'd solve this problem"
Me - "I'd probably Google it..."
Interviewer - "Welcome to the team!

mcbpete
Автор

When the interviewer said "What language would you like to use?" I said "English" in my head" dam im dumb.

t-rexdabeast
Автор

First day at the job: can you please change the background of this button to blue?

IgorLinkin
Автор

At first i was like "wow thats easy" but after understanding the task, i started to question my coding skills.

TruthMV
Автор

It's like watching a horror movie.

sanjayaekanayake
Автор

Me: I love to code.
Them: Write code to return longest common subsequence of s1 and s2

Me: I love to eat an apple.

gene_Code
Автор

Fucken love these comments. Programming always makes me feel stupid, but I'm always comforted by the fact that I'm not alone lol.

BearMetro
Автор

Holy moly watching this gave me flashbacks of my technical interview at a different company. They gave me multiple problems increasing in difficulty and, even on the first one which I had seen before in class, I totally blanked on where to even start. Fortunately the interviewers were very aware of the fact that I was just locking up in that moment and due to what I had done in my past I should have no problem solving it. They gave me time and I solved some of them and talked through the rest and proved more so what I could do just through competence in technical conversation. Just a good lesson that just because you lock up at the start of the interview doesn't mean you will get denied instantly. Just try to calm down and they will be more interested in the end product than your initial reactions. :) Of course some companies are more strict than others but its never the end of the world if you mess one interview up. Just means you'll be better prepared for the next one you get!

pitbullshark
Автор

10:44
Seems like Google sent ambulance to this guy's location in case he gets heart attack during the interview.

GenuineCoder
Автор

The ending lmao..

"Thank you so mu-"
"Yeah, BYE!"
"bye.."

ionel
Автор

The geek version of "so, tell me about yourself"

DeeDee-uurt
Автор

Wow looks like i will be a jobless engineer

bahadrgokce
Автор

if this was me in the interview, my biggest challenge would be: "How fast can i google search the questions and how fast can i find a source code that i am looking for in stackoverflow"

theturkishrider
Автор

When they tell you that you should not worry about performance initially they really expect the brute force solution in the first iteration. Generate all possible subsequences from the s1 and look for each of them in s2. Pick the longest one.
To generate all subsequences you can do a recursion. In the recursion method at each level you go to the next index in s1. As you go you build the subsequence by either adding or skipping the character at the current index (there are 2 path in the recursive method). When you get to the end of s1 you have the current subsequence that you can look for in s2.
An alternative to the recursive method is to imagine a number with the number of bits the same as the number of characters in s1 and start a variable with 1 and increment by 1 at each step. Generate the subsequence from this variable assuming that each bit tells you if to include or not in the subsequence the character at that index.
To search for each subsequence in s2 I think it is enough to do a greedy search and just iterate for the characters in the current subsequence and look for the same character in s2 (first) starting from the last match.


To optimize, you can start searching in s2 as you do the first recursion to generate the subsequences. The trick is to be able to backtrack faster when you can't find a match.
Also, you can stop once the possible remaining subsequences are smaller than the current max subsequence.

alexandruindrei
Автор

"You can go for the naive solution first"
"Alright first thing I’ll do is think about edge cases"

visintel
Автор

1st native solution would be probably to search in google for solution haha

RandomPotatoDev
Автор

I didn't take the time figuring up the circumstances or the authenticity of this interview, but I stopped the video just after the interviewer finished explaining the objective. As a former CS student sitting at my home PC, it took me about a good 45 minutes to write a divide-and-conquer recursive function that would give the desired results. Completely without preparation and only googling functions bc. my JS splice, index and substr abilities got kinda rusty.

One really has to cut this guy some slack. The task has probably as much to do with the day-to-day job of a google engineer as my private car resembles a ferrari, but it certainly requires abstract logical thinking and reasoning. On top of that, it's an exceptional situation facing that guy. Most people, including me would probably black out before even having your head wrapped half around the exercise. Great stuff!

DominicSt
Автор

I think he did pretty well, go from naive and optimize it, of course if you did this before you can straight up given best DP solution, but not reflect your actual thinking process, purpose of interview is not review your practiced problem, is to show how you approach the problem. Of course I know right now people doing hundreds of leetcode problems and can tackle most of interview, but that not reflect the interviewee's actual problem solving ability

grantl