Live Mock Technical Interview – JavaScript




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.

Book a mock interview with Dan: https://www.codementor.io/blackmind?utm_source=youtube&utm_medium=social&utm_campaign=outreach&utm_term=office-hours-20161020&ref=OH-youtube-JS-mock
More live events: https://www.codementor.io/learn/office-hours?utm_source=youtube&utm_medium=social&utm_campaign=outreach&utm_term=office-hours-20161020&ref=OH-youtube-JS-mock

Original source


44 responses to “Live Mock Technical Interview – JavaScript”

  1. 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.

  2. 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))

  3. // 1 2 2 5 8

    let letters = "abcdefghijklmnopqrstuvwxyz";

    function f1 (input, string = "") {
    if (input.length === 1) {
    let i1 = parseInt(input);
    if (i1 > 0) {
    console.log(string + letters[i1-1]);
    return 1;
    } else {
    return 0;
    }
    } else if (input.length > 1) {
    let count = 0;
    let i1 = parseInt(input.substring(0,1));
    if (i1 > 0) {
    count += f1(input.substring(1), string + letters[i1-1]);
    }
    let i2 = parseInt(input.substring(0,2));
    if (i2 > 0 && i2 < 27) {
    count += f1(input.substring(2), string + letters[i2-1]);
    }
    return count;
    } else {
    console.log(string);
    return 1;
    }
    }

    console.log(f1("12258"));

  4. function translateToStrings(number) {
    var firstLetterCode = "a".charCodeAt(0);
    function translate(numStr, pos, result) {
    if (pos == numStr.length)
    return result;
    var strings = [];
    // could iterate 2 times, but iterating to end to allow 0's
    for (var i = pos + 1; i <= numStr.length; i++) {
    var letterIndex = parseInt(numStr.slice(pos, i)) – 1;
    if (letterIndex >= 0 && letterIndex < 26) {
    var letter = String.fromCharCode(firstLetterCode + letterIndex);
    strings = strings.concat(translate(numStr, i, result + letter));
    }
    }
    return strings;
    }
    return translate(number.toString(), 0, "");
    }
    console.log(translateToStrings(12258)); // ["abbeh", "abyh", "aveh", "lbeh", "lyh"]
    console.log(translateToStrings(122580001)); // ["abbeha", "abyha", "aveha", "lbeha", "lyha"]

  5. var printChars = function(str, position, output){

    if(position == str.length) console.log(output);
    if(position >= str.length) return;

    printChars(str, position + 1, output + String.fromCharCode(96 + parseInt(str.substr(position, 1))));
    if(parseInt(str.substr(position, 2)) <= 26)
    printChars(str, position + 2, output + String.fromCharCode(96 + parseInt(str.substr(position, 2))));

    }
    printChars("12258", 0, "");

  6. The solution he did for the palindrome should split on a space not an empty string. Also the duplicate finder will not work if you have more than one repeat in a row. But I love this video, these are the exact type of stupid questions I'm asked during interviews. lol and you need to know them not matter how silly they seem. Half the battle is just talking through it, even the novice programmer can psuedo code and then brute force the solution with for loops, like he said, coming up with solutions that perform well are key to standing out in interviews.

  7. Don't you think, calling node as single threaded is a bit wrong? Node is built on the top of Libuv, i.e C++ library to handle HTTP requests. All the FileSystem module operations, Crypto module operations(eg. PBKDF2 function) uses multi-threads, isn't it? And moreover we have a global variable called UV_THREADPOOL_SIZE, which could be set to any number (the number of threads you want). We could even utilize the whole cores of a system, by using OS module's cores() function, to get the number of cores, and set the threadpool size accordingly. So, in my opinion, node isn't "single threaded".

  8. 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]]

  9. Letting the grasshopper off easy with the palindrome code, aren't we? I mean, if you'd asked for a function that reverses a string, then he get 10/10.

    Interviewer replied to the string reversal function with,"Yep! Perfect!"

    Interviewer needs to be interviewed!

  10. const fun = (char, str) => {
    return str.split('').filter(ch => char === ch).length;
    }

    const findDup = (arr) => {
    let mem = {};
    arr.forEach(n => mem[n] = mem[n] ? mem[n]+1 : 1);
    return Object.keys(mem).filter(key => mem[key] > 1)
    }

Leave a Reply