Live Mock Technical Interview - JavaScript

preview_player
Показать описание
We recently hosted a mock interview where an experienced interviewer conducted a mock technical interview with a candidate looking for a front-end developer job. It included algorithm questions, coding exercises, feedback, and audience Q&A.

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

We also have a great JS interview questions post for anyone interested!

Codementor
Автор

“I’ve been interviewing for 10 years and I’ll ask you some very basic web based questions... OK, explain to me how https works.” Seriously?

Markube
Автор

2:54 Self intro
*While writing code live, talk through what you're doing

-Learn how to .sort()
-Using hashmap instead of two for loops
-prototype
-== vs ===
- use strict
-how to test against NaN
-what is promise, how
-nodejs and threads (queuing code for execution )
-What is typically the first argument passed to a node.js callback handler and why do you think it is done that way
-How to check for data type
26:57 palandrome function
31:46 string differences function
38:37 return duplicate numbers from array
43:53 Asking questions about what he should focus on to better fit the role he is applying for

kylemedina
Автор

An interview should be tailored to each candidate and rely on the interviewer expertise to lead and explore the strengths of the candidate. This is the typical guy who has prepared questions and he is reading the answers.

mauriciotorrejon
Автор

The solution of question at 38:40



def bt(strNum, idx, cur, res):
if idx == len(strNum):
res.append(cur)
return

i = idx + 1
while i <= len(strNum):
sub = int(strNum[idx: i])
if sub <= 26 and sub > 0:
temp = chr(sub + ord('a') - 1)
bt(strNum, i, cur + temp, res)
i += 1


def main(num):
res = []
bt(str(num), 0, '', res)


return res


print(main(12258))

scottchen
Автор

My solutions:

function isPalindrome(value) {
return value ==
}

function countChar(str, letter) {
return str.split(letter).length - 1;
}

LBF_NotGnome
Автор

A W E S O M E ! after only 4 months of JS I was called to an interview, for full-stack jr... definitely, I am not prepared to deal with algorithms & data structures problem solving. Thanks for sharing !

lbayout
Автор

btw, the palindrom function should have returned === 'level'.split('').join(). otherwise it would return just the string that they've put in

HDMensur
Автор

All this is fine, but NOTHING beats an audition project to build and put on GitHub for scrutiny. THAT is how you see what a person is capable of. They have a timeframe to build it, they use their tools, their environment, their methodologies and there is very little pressure as it's not done live, just by a deadline. Most interviews that consist ONLY of what you've shown here do not give you the full picture. Likely you'll wind up with a bookworm who knows C.S. fundamentals but can't actually build anything out to production.

nilfux
Автор

How do you think you know node when you don’t even know how http works and that’s the tool for the client and server to talk to each other...

Trellyy
Автор

The interviewee looks like Jin Yang from Silicon Valley

naufal-yahaya
Автор

Very helpful video for overcoming interview stress. Thank you!

orkuntuzel
Автор

Answer to the last question (which I believe is asymptotically optimal, though some pruning could be done for the best case):

function translateNum(num) {
let pars = // get parenthesizations
let valid = pars.filter(par => par.every(n => n >= 1 && n <= 26)); // (implicit conversion of str to num)
console.log(pars);
console.log(valid);
return valid.map(par => par.map(n => translate(n)).join(''));
}

// ex: '1234' => [['1', '2', '3', '4'], ['12', '3', '4'], ['1', '23', '4'], ['1', '2', '34'], ['12', '34']]
function getStringPars(str) {
const splitAndRecurse = (str, i) => {
let [prefix, rest] = splitAt(str, i);
return memoStrPars(rest).map(par => [prefix, ...par]);
}
const memo = {}
function memoStrPars(str) {
if (memo[str]) return memo[str]; // don't duplicate work
if (str.length === 0) return [[]];
if (str.length === 1) return [[str]];
return memo[str] = splitAndRecurse(str, 1).concat(splitAndRecurse(str, 2));
}
return memoStrPars(str);
}

const alphaBaseCode = 'a'.charCodeAt(0);
const translate = (n) => + (+n) - 1);
const splitAt = (str, i) => [str.slice(0, i), str.slice(i)];


inordirections
Автор

Maybe I missed it, but he never did expand upon what are the down side of closures did he?

markvalentine
Автор

The fact that he wasn't saying out loud his thought process will get him turned down by all big tech companies

jeffkanma
Автор

last task can be solved by walking from end of digits array and permutaring with already computed subarray at i+1 and i+2 if 2-digits letter available:
1, 2, 2, 5, 8
[_ _ _ _ _]
[_ _ _ _ [h]]
[_ _ _ [eh] [h]]
[_ _ [beh yh] [eh] [h]]
[_ [bbeh byh veh] [beh yh] [eh] [h]]
[[abbeh abyh aveh lbeh lyh] [bbeh byh veh] [beh yh] [eh] [h]]

Acid
Автор

as for the occr question you can do something like this as well:
var occr = function(str, char) {

return str.split(char).length - 1;
}

mabos
Автор

I have an interview in a few days I feel like these questions are gonna help wish me luck :)

abdelrhmanshokr
Автор

the problem with the findDup function is that when a number occurs more than twice, then the array will be filled with that number more than once. here is what I did :

function findDup(arr) {
const obj = {};

for (const [index] of arr.entries()) {
if (!obj[arr[index]]) {
obj[arr[index]] = 1;
} else {
obj[arr[index]] += 1;
}
}

for (const [key, value] of Object.entries(obj)) {
if (value === 1) {
delete obj[key];
}
}

return Object.keys(obj);
}

this works no matter how many times a number occurs in the array.

theartist
Автор

18:53 typeof NaN is not a string, typeof NaN is actually of type number

moraryou