Front End Mock Interview | Online Interview on JavaScript, CSS, and React , Questions and Answers

Поделиться
HTML-код
  • Опубликовано: 18 ноя 2024

Комментарии • 235

  • @e4r281
    @e4r281 6 лет назад +233

    I went for a job interview and the manager said, "We're looking for someone who is responsible."
    "Well I'm your man," I replied.
    "In my last job, whenever anything went wrong,
    they said I was responsible."

  • @jmooree30
    @jmooree30 6 лет назад +57

    The anxiety of wanting to tell him his last if statement in fizzbuzz should of been the first was to much for me to handle. Sweet video, love your work.

    • @ralexand56
      @ralexand56 5 лет назад +7

      Yeah, but I liked his solution of concatenating the string. It fits the elements of the problem. DRY, why introduce a 3rd condition when the first two handles it. I also like dividing by 15, I usually break that out into two separate conditions.

  • @j2ee123
    @j2ee123 5 лет назад +9

    body {
    box-sizing: border-box;
    }
    .squares {
    display: flex;
    }
    .square {
    width: 50px;
    height: 50px;
    border: 1px solid;
    display: flex;
    justify-content: center;
    margin: 5px;
    }
    .square .circle {
    width: 20px;
    height: 20px;
    border: 1px solid;
    border-radius: 10px;
    margin: auto;
    }

  • @evgeniimarkov7479
    @evgeniimarkov7479 4 года назад +19

    last question:
    function getLast(kids, toys, start){
    let last = (start + toys -1 )%kids
    return last || kids
    }
    console.log(getLast(3,5,1))

  • @nomtijorti
    @nomtijorti 6 лет назад +24

    your content is the best man. Your javascript tutorials and javascript interview videos helped me get two job offers. Incidentally a question about self invoking functions came up right after i watched the video for it.
    Keep up the good work, friend!

  • @dhnjay100
    @dhnjay100 5 лет назад +30

    Please do a small favour for us.
    While mocking interview, please try to show answer i.e. output in debugger tool or anywhere.
    It will be very helpful for us. If possible, please do it

  • @edgarbarajas1477
    @edgarbarajas1477 5 лет назад +3

    A simple solution to the kids/toys algorithm:
    const kids = 3;
    const toys = 5;
    const startPosition = 1;
    const toyReciever = Math.floor((toys / kids) + startPosition);

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      Nice solution :)

    • @mariaab.1154
      @mariaab.1154 5 лет назад +1

      4 kids, 3 toys, startPosition 1, the result should be 3 and not 1

    • @miteshkvaghela
      @miteshkvaghela 4 года назад

      @@mariaab.1154 right

  • @diegochicurel4724
    @diegochicurel4724 6 лет назад +7

    Last problem doesn't need the if-else
    getLastKid = (n, k, i) => (k + i - 2)%n + 1;
    It could be just (k + i -1)%n but this fails when the kid is the last because mod is 0. So it can also be:
    last = (k + i -1)%n ; return last == 0 ? n : last ;

    • @vasanthanprabhagaran2
      @vasanthanprabhagaran2 4 года назад

      can you pls explain how it works

    • @ruhan23
      @ruhan23 3 года назад

      same thing here ,
      const lastToy = (Children,noOfToys,indexOfFirstChild) =>{

      return (noOfToys % Children) + (indexOfFirstChild-1)
      console.log(Children)
      }
      console.log(lastToy(7,1,7))

  • @gopalchavan306
    @gopalchavan306 2 года назад +4

    I really liked the way you interview, helped him/giving hints on what can be done and also telling if there are better ways of doing it

  • @zeno_aratus
    @zeno_aratus 6 лет назад +9

    Too many people commenting using the luxury of hindsight.

  • @MichaelSalo
    @MichaelSalo 4 года назад +6

    I would like to hear this music play while I'm solving interview problems.

  • @HardeepSingh-kw3wu
    @HardeepSingh-kw3wu 5 лет назад +5

    Regarding the solution provided by the interviewee for greatest divisor , the solution won't fail but there is an overhead here. Instead of starting from mid of max we should start from mid of min. We are talking about "greatest COMMON divisor". Key is common. Means it should be a divisor of min also along with max. And divisor of min cannot be greater than half of min.

    • @Techsithtube
      @Techsithtube  5 лет назад

      Good Point Hardeep. thanks for sharing!

    • @georgsoldier
      @georgsoldier 2 года назад

      I don't understand why mid is needed in the first place. I have solved it in a function, by checking which parameter is greater and lesser and assigning them to max and min variables respectively. Then checking if they are both positive or one of them is negative with an if statement, If they are both positive I would run them through a for loop counting from MAX down to 1 and in the for loop code block - an IF statement checking if the remainder from dividing max%index && min%index === 0. If so return the index. And if either of the parameters are negative then just reverse the for loop.

  • @nuwanthuduwage6869
    @nuwanthuduwage6869 2 года назад +1

    Hi TechSith, thank you for all the support by sharing your experience and thoughts. For the question of Creating two adjacent squares with a centered circle problem, I have tried the same in a different way. Can you review it, please?
    HTML:




    //CSS
    .square{
    width: 50px;
    height: 50px;
    border:1px dashed red;
    padding:0;
    display:inline-block;
    margin:10px;
    }
    .circle{
    width: 10px;
    height: 10px;
    border:1px solid black;
    border-radius:50%;
    margin:20px auto;
    background-color:red;
    }
    Thank you very much.

  • @fotiem.constant4948
    @fotiem.constant4948 2 года назад +2

    I love how friendly the interview is, nice one. thanks for the amazing interview man

  • @sgrpnwr
    @sgrpnwr 3 года назад +1

    Find my solution below for the toys problem: I used i=(i+1)%lengthofarray approach to iterate through a circular array.
    const a=3;
    const k=5;
    var index=0;
    const c=[];
    const d=[];
    for(let i=1;i

    • @ozzyfromspace
      @ozzyfromspace 2 года назад +1

      const getLastChild = (n, k, i) => (k + i - 2) % n + 1; ....does the same thing in O(1) time

  • @not_enoughmana
    @not_enoughmana 6 лет назад +16

    The hold music is soooooo soothing XD

  • @maksym8195
    @maksym8195 4 года назад +4

    Your knowledge of JS is pretty good BUT the last task didn't complete. The solution is wrong and returns incorrect values. e.g (3, 5, 3) returns 4.

  • @tamannamakkar1839
    @tamannamakkar1839 6 лет назад +1

    I would like to suggest the alternative for 2nd css query
    /***** HTML *****/



    /***** css *****/
    .parent-square {
    display: flex;
    flex-direction: row;
    }
    .square {
    flex: 1;
    border: 1px solid #000;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    }
    .square span {
    flex-basis: 50px;
    border-radius: 100%;
    height: 50px;
    border: 1px dotted;
    }
    Note : as flex feature introduced, you can use flex instead of floats, and to vertically and horizontally center the
    element, you can use align-items: 'center' or justify-content:'center'' rather then absolute,transform and all those

  • @MrABCLynch
    @MrABCLynch 5 лет назад +1

    It's worth noting that `.sq:first-child` is prone to breaking. If you add a div above the , it'll stop selecting.
    It's trying to select an element that has a class of `sq` AND is the first child of its parent.
    Also, if you use the same class name elsewhere and it too is a first child of its parent, it'll be selected.
    To fix it you'd need to raise the specificity on it.

  • @22pradeeppathak
    @22pradeeppathak 6 лет назад +6

    Today I went for an interview and I was able to crack this round. Waiting for final round. Thanks for your videos. Still waiting for your response regarding mock interview

    • @naveenkamath2882
      @naveenkamath2882 3 года назад +3

      I have a doubt
      In a web dev interview or react js interview
      For Ds algo round , can we use java for writing our code instead of js.
      And for other rounds i will use js.
      I mean they will provide multiple languages options right in ds algo round ?

    • @vandanamehra8800
      @vandanamehra8800 3 года назад

      Hello please tell me how many rounds are there in front end developer interview

  • @katyasorok9536
    @katyasorok9536 5 лет назад

    HTML:






    CSS:
    .container{
    display:grid;
    grid-template-columns:50px 10px 50px;
    }
    .square{
    height:50px;
    border:1px solid black;
    }
    .circle{
    position:relative;
    width:20px;
    height:20px;
    border-radius:50%;
    border:1px solid black;
    left:25%;
    top:25%;
    }

  • @modibosanogo3491
    @modibosanogo3491 5 лет назад +3

    The question regarding getting the greatest common divisor between two number could be simplified as follows:
    function getTheGreatestCommonDivisor(x,y){
    let maxPara=Math.max(x,y);
    let Array=[]
    for (let i=1;i

    • @Techsithtube
      @Techsithtube  5 лет назад

      Modibo, good solution. you can also make it recursive .

    • @RobertWilliams-nd5ux
      @RobertWilliams-nd5ux 5 лет назад

      we dont need to push to array since were looking for Greatest means 1, we can just use GreatestCommonDivisor = i;

    • @gojo55x
      @gojo55x Год назад

      function findTheBiggestOne(a, b) {
      let min = a > b ? b : b;
      let max = a > b ? a : a;
      for (let i = max; i > 0; i--) {
      if (max % i === 0 && min % i === 0) {
      return i;
      }
      }
      }
      console.log(findTheBiggestOne(2, 3));
      i think this way is more better............

  • @anupriyasaxena9013
    @anupriyasaxena9013 5 лет назад +1

    The following solution to kids toys problem worked for all the cases I tried:
    function lastKidWithToy(k, t, p) {
    if(pt){
    var position = t + p - 1
    } else {
    var position = t%k + p -1
    }
    console.log(position > k ? position-k : position);
    } else {
    console.log("Invalid position");
    }
    }
    lastKidWithToy(7,8,7);

    • @Techsithtube
      @Techsithtube  5 лет назад

      great solution Anupriya. Thanks for sharing

    • @77y7
      @77y7 5 лет назад

      @@Techsithtube Wouldn't this still fail tho for example the numbers were 3, 3, 1. Because 3%3 = 0, 0 + 1 - 1 = 0

  • @adamajs3836
    @adamajs3836 3 года назад

    My take on the first function.
    function fizzy(num){
    let str = '';
    if(num===0){
    return;
    }
    if(num>0){
    if(num%3==0){
    str+='Fizz'
    }
    if(num%5==0){
    str+='Buzz'
    }
    console.log(num+' '+str)
    return fizzy(num-1);
    }
    }
    fizzy(59);

  • @MecegguemMohamed
    @MecegguemMohamed 3 года назад

    i have did different approche :
    let temp = 0;
    let arr;
    function distributeToys(n, k, i){
    let t = k;
    if(!t) { temp = 0; return
    }
    if(temp < k){ arr = new Int16Array(n); temp = k }
    for(let index = i; index < n; index++){
    if(t == 0) return
    arr[index] += 1;
    t--
    }
    distributeToys(n,t,0)
    }
    if we did : distributeToys(3, 5, 0) we get : Int16Array(3) [2, 2, 1]
    this algorithm returns an array of how much each kid get of toys

  • @ifElseReality
    @ifElseReality 6 лет назад +4

    This series is good.... it would be much better if you can create a series on polyfills. Like how to create all es6 or 7 syntax with es5(example: class, extend etc.). it will help some people to deep dive in prototypes and its uses.

    • @Techsithtube
      @Techsithtube  6 лет назад

      Yes I think that would be interesting. I will consider it. Thanks for suggestion .

  • @ajaykumarsana
    @ajaykumarsana 5 лет назад

    Last question Solution for all Cases:
    function callme(kids,toys,position)
    {
    let lasttoy;
    if(toys>=kids)
    lasttoy = (toys%kids)+position-1;
    else if(toys==kids)
    lasttoy = position-1;
    else
    lasttoy= toys+position-1
    return lasttoy>kids ? lasttoy-kids : lasttoy;
    }
    callme(6,3,6)

  • @muhammadrashad2560
    @muhammadrashad2560 3 года назад

    const gcd = function (a, b) {
    if (b === 0) return a;
    return gcd(b, a % b);
    };
    gcd(5,25)

  • @anupal779
    @anupal779 3 года назад

    Disclaimer: i paused the video and write my answer
    First loop through the given range
    Okay first check if a number is multiple of both 5 and 3 then return fizzbuzz
    Else if check for multiple of only 3 then return fizz
    Else if check for multiple of 5 then return buzz
    Else return the number...
    You can use in built-in functions as well but above answer is easy to understand when you are a beginner

  • @chandrimabasuroy2
    @chandrimabasuroy2 4 года назад +1

    hi! Can we do the css problem other way? I have done it other way.









    .squares {
    border: 2px solid black;
    width: 50px;
    height: 50px;
    text-align: center;
    display: inline-block;
    margin-right: 10px;
    }
    .squares div {
    border: 2px solid black;
    width: 20px;
    display: inline-block;
    height: 20px;
    margin: 10px;
    border-radius: 10px;
    }
    .outerline {
    text-align: left;
    }
    .squares:last-child {
    margin-left: 0px;
    }
    I think that without box-sizing and transform property, this works perfectly.

  • @mikecaldwell8417
    @mikecaldwell8417 5 лет назад +6

    I have been a developer in Silicon Valley for over 25 years and I have been a lead UI developer and built many products. I have always been 1 of the top front end developers at every company I have worked at. These interview questions are worthless and stupid. They tell you nothing about how good a developer this guy really is. Writing some dumb little function in 5 minutes is not what makes the best developer valuable. The best developers can build a product from the ground up and understand how to design the code for maintainability and make it scale over the years. This interviewer guy in this video must be one of those consulting hacks that build some garbage and then leaves the company onto his next hacking project where he builds garbage that someone else has to clean up. You want to know if someone is a good developer, then look at some source code they have written and see how well it is commented, how well it is written and what it does. Stupid functions printing out multiples of 5 and 3 or whatever is dumb

    • @Techsithtube
      @Techsithtube  5 лет назад

      Mike thanks for the feedback. You are right, its really not necessary to ask these questions, I live in the valley and I have given many interviews. Unfortunately , most of them would ask such questions and you need to be prepared for it

    • @mikecaldwell8417
      @mikecaldwell8417 5 лет назад +4

      @@Techsithtube Yes you are right that these are the type of questions many fools ask candidates but it is ridiculous to think these questions have any correlation to a developer's ability to develop good software. I worked with many developers who could answer these questions easily and when you hire them they write garbage. Then you have developers who get nervous when these questions are asked on interviews but you work with them and you see they are very good. It is time for experienced developers to ask smart questions during interviews not these coding questions designed to humiliate some people

  • @katyasorok9536
    @katyasorok9536 5 лет назад

    function gcd(a,b){
    if (a === 0)
    return b;
    return gcd(b % a, a);
    }

  • @Albertmars32
    @Albertmars32 6 лет назад +3

    ca you please please make a couse/tutorial on the whole firebase sdk? specifically on cloud functions and storage ?

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      Sure I think that would be a good tutorial series. I will try to make it soon.

  • @tiffanys_life374
    @tiffanys_life374 5 лет назад +9

    Excellent mock video! Thanks for sharing. May I know what kind of software are you using for the mock? The one that can shows the css layout and the javaScript FuzzBuzz.

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      I usually use Jsfiddle for css, html and js interviews. For only js interviews I use coderpad

  • @RicardoBuquet
    @RicardoBuquet 5 лет назад +3

    I have been a software engineer for 25 years mostly focused on UI. And I noticed you laugh when you say "don't use tables or anything like that".
    There is a HUGE misconception on tables, but not only in the people who use them, but also in the people who don't use them. Tables are there for a reason, and its tabular data. I know you can arrive at similar solutions using other entities and CSS. But that doesn't mean tablets are evil.
    I understand that in this particular case tables are an obviously bad choice.
    But never the less, if I'm interviewing someone if they don't know which is the place for tables. That is a really bad sign.
    My two cents :)

  • @pengtong1001
    @pengtong1001 6 лет назад +2

    I don't think the last function is quite right. (3 kids , 7 apples, from position 7.) This video is quite interesting anyway.

    • @Techsithtube
      @Techsithtube  6 лет назад

      I am glad you like it peng. If you know the right solution . Please do share!

  • @harshtiwari2150
    @harshtiwari2150 3 года назад

    for the last toy kid problem can we do like this?
    function lastKid(n, k, i) {
    if (k < n) {
    console.log(k)
    }
    else {
    console.log(k % n)
    }
    }
    lastKid(3, 5, 1)

  • @toluwalaseogunsola4972
    @toluwalaseogunsola4972 2 года назад

    really great video but the logo at the middle of the screen is kinda obstructing a few things

  • @shyarkhalil6549
    @shyarkhalil6549 5 лет назад

    const gcd = function(a, b) {
    if (!b) {
    return a;
    }
    return gcd(a % b);
    };
    console.log(gcd(6, 4)); // 6

  • @fdc_8507
    @fdc_8507 6 лет назад +2

    I like it :)
    I hope one day making such interview like this here I'm sure i'll be great because i love this field so much
    thanks techsith
    and thanks to the man on the other side

    • @emmmdrole9461
      @emmmdrole9461 2 года назад +1

      How was it ? Did you accomplish your dreams?

  • @interrelated6667
    @interrelated6667 4 года назад +4

    who wants to remember this shit when things are available on the internet, You have to improvise and put in your logic and variables.

  • @CulbuleBoys
    @CulbuleBoys 6 лет назад +4

    Nice video ...plz continue the series

  • @cryptocurrencylatestupdate7113
    @cryptocurrencylatestupdate7113 5 лет назад

    For toys problem. Simple just: k%n ex: 5%3 = 2, 3%5 = 3 if i=1 case

  • @jintudas7088
    @jintudas7088 4 года назад

    i smell eloquent JavaScript

  • @uchennachukwuba
    @uchennachukwuba Год назад

    Here's my solution
    First of all, think about the order and write the Fizz buzz at the top of the condition
    function nums(){
    for (let i = 1; i

  • @itmandar
    @itmandar 5 лет назад +3

    What about mock interviews for senior frontend developers?

  • @thesufi
    @thesufi 2 года назад

    Not at all representative of how modern programmers work. Getting the interviewee to talk through some code they had previously written would be much more instructive.
    function getLastKid(n, k, i) { while (k>0) { k -= 1; if (k==0) {return i;} i += 1; if (i > n) {i = 1;} } }

  • @yangliu3754
    @yangliu3754 3 года назад

    The first javascript function fizzbuzz is actually easy ...

  • @RavishKumarVsGodiMedias
    @RavishKumarVsGodiMedias 4 года назад

    Hello sir,
    I have some question in my mind that recently i have left my first job within 10 month bcz of some internal team politics ,and they forced me to leave my job,But when i will go for the next job interview what should be the best answer for me when Interviewer ask, why did you left your job.??

  • @canepaper967
    @canepaper967 2 года назад

    I followed along with all the interview questions and didn't really have any issues except I struggled with the the toy algorithm, and I feel really dumb for it lol. Especially considering there's guys in the comments doing it with 1 line...

  • @ozzyfromspace
    @ozzyfromspace 2 года назад

    For the toy problem, here's my O(1) one-liner: const getLastChild = (n, k, i) => (k + i - 2) % n + 1;
    For the common divisor problem, my recursive solution is:
    function getGCD(num1, num2) {
    const biggerNum = Math.max(num1, num2);
    const smallerNum = Math.min(num1, num2);
    if (num1 === num2) return 1;
    if (smallerNum === 0) return 1;
    const remainder = biggerNum % smallerNum;
    if (remainder === 0) return smallerNum;
    return getGCD(smallerNum, remainder);
    };
    edit: getGCD is inspired by Euclidean algorithm. It's not magic.

    •  Год назад

      Nice solutions. One more improvements for getGCD function should be that the calculation of smallerNum = num1 + num2 - biggerNum; instead of using Math.min function which may take much more time accordingly

  • @rushikeshchoche2815
    @rushikeshchoche2815 6 лет назад +2

    Display flex(parent element) and margin auto(child element) can be the best solution to centre anything?

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      Yes Flex would an easy choice however sometimes in an interview they might ask you to avoid flex.

  • @praveentiwari2951
    @praveentiwari2951 5 лет назад

    Very good channel.Very good tutorial. Always keep on making such videos.

  • @SnoopCatts
    @SnoopCatts 3 года назад +2

    who else would have failed the on-the-spot greatest common divisor question?😄👋🏽👋🏽

    • @Techsithtube
      @Techsithtube  3 года назад

      It is a hard one , especially if you have to come up with a quick solution. Usually people with math background gets it quickly.

  • @francosql
    @francosql 4 года назад

    The first condition should validate both multiple

  • @77y7
    @77y7 5 лет назад +1

    The last question is wrong... if you had the example as 6, 4, 1 the expected result would be kid 4. However, with his else statement, you will get 6 which is not correct. They did not go through and check other use cases which is why this is wrong. Now his answer for the top case is correct. If anyone has a good answer to fix the bottom case, then post a response. Otherwise, this is my recursive method.
    function getLastKid(_numKids, _numToys, _start) {
    if (_numToys === 1) {
    return _start;
    } else {
    let start = null;
    if ( _start === _numKids ) start = 1;
    else start = _start + 1;
    return getLastKid(_numKids, _numToys - 1, start);
    }
    }

    • @Techsithtube
      @Techsithtube  5 лет назад

      Scott, you are right. I did miss that error. Thanks for pointing it out.

  • @ruhan23
    @ruhan23 3 года назад

    // it does not work only in one case when noOChildren ==noOfToys and indexOfFirstChild =1
    const lastToy = (Children,noOfToys,indexOfFirstChild) =>{

    return (noOfToys % Children) + (indexOfFirstChild-1)
    console.log(Children)
    }
    console.log(lastToy(7,1,7))

  • @hatrick3117
    @hatrick3117 6 лет назад

    greater comon diviser exercise:
    function foo(a,b){
    let val = Math.min(a,b);
    for(let i=val;i>0;i--){
    if(a%i==0 && b%i==0){
    return i;
    }
    }
    }
    console.log(foo(8,24));
    Can I sold it like this?

  • @nishazahrazaidi8078
    @nishazahrazaidi8078 5 лет назад +1

    nice work. .can u please continue the series it wll help me more

    • @Techsithtube
      @Techsithtube  5 лет назад +1

      Yes I have will start releasing from next week.

  • @untildawn5714
    @untildawn5714 3 года назад

    So I am freelancer and if I have a front end interview actually I can do this in 2 minutes using function probramming so you can put a number argument. at the end I ALWAYS FIRE FROM INTERVIEW.

  • @laxmisinghdeo6914
    @laxmisinghdeo6914 5 лет назад

    Kindly make some more videos for javascript interview ?

  • @tikamikas3245
    @tikamikas3245 5 лет назад

    For the CSS question, correct me if I'm wrong, but wouldn't this be a more efficient way of doing this?
    .sq {
    width: 50px;
    height: 50px;
    border: 1px solid red;
    display: inline-block;
    position: relative;
    margin: 0 5px;
    box-sizing: border-box;
    }
    .sq:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50% ,-50%);
    background-color: yellow;
    min-width: 20px;
    min-height: 20px;
    border-radius: 50%;
    }

  • @bibekgurung9075
    @bibekgurung9075 3 года назад

    How should you answer that react question?

  • @manjiripanchal6226
    @manjiripanchal6226 3 года назад

    Thank you for front end interview

  • @manasdwivedi336
    @manasdwivedi336 4 года назад

    What is "null" and why is its data type an object for no reason at all since its just an assignment value or we can say "an unintentional absence of any object value" !!

  • @daniivanov4554
    @daniivanov4554 2 года назад

    no i didn't learn anything :D it just made me feel good about my skills at that point

  • @atlasmaxima1418
    @atlasmaxima1418 6 лет назад

    My solution to the circles in squares - codepen.io/atlasxmaxima/pen/rZoxwp

  • @theartist8835
    @theartist8835 4 года назад

    the last exercise is not right ! take 5 kis, four toys and start from position 3 . the function he wrote will yield 7 the answer is 1 .
    I wrote this :
    function getPosition(kids, toys, position) {
    for (let i = toys; i > 0; i -= 1) {
    if (position >= kids) {
    position = 0;
    }
    if (i === kids) continue;
    position += 1;
    }
    return position;
    }

  • @bhavikakapadia2462
    @bhavikakapadia2462 6 лет назад +5

    Please continue with interview series

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      WIll keep doing it. thanks for watching!

  • @mvskiran4727
    @mvskiran4727 4 года назад

    In Kids program challenge, As per the solution given there, it will fail if(n%k==0) - it should return n in that case.

    • @Techsithtube
      @Techsithtube  4 года назад

      Thanks for correcting it. Yes you are right.

  • @trycatch1168
    @trycatch1168 2 года назад

    function lastKidPosition(t,k){
    var position = (t%k);
    if(position===0){
    console.log(k);
    }else{ console.log(position);}
    }
    lastKidPosition(5,3);
    this gonna work perfect i guess
    /* t- no. of toy
    k- no of kid */

  • @critzilla9722
    @critzilla9722 5 лет назад

    Vary smart xDDDD Hare in Bulgaria front end interns are smarter than the interviewer

  • @anonymoususer5836
    @anonymoususer5836 5 лет назад

    function findGCD(m,n) {
    let divisor = Math.ceil(Math.max(m,n) / 2);
    while(divisor > 0) {
    if(m % divisor === 0 && n % divisor === 0 ) {
    console.log(divisor);
    return divisor;
    }
    divisor--;
    }
    }

    • @Techsithtube
      @Techsithtube  5 лет назад

      Interesting solution . thanks for sharing

  • @spartacode7372
    @spartacode7372 5 лет назад +1

    Great video... Thanks.

  • @arcosd63
    @arcosd63 2 года назад

    Are you still creating videos in 2021?

  • @amankant9734
    @amankant9734 3 года назад

    on which platform you are running your code?

  • @bhaskarcjm
    @bhaskarcjm 4 года назад

    Content is not clear, Can you recheck the video

  • @slaviklox2
    @slaviklox2 6 лет назад

    hey techsith can you add the answers to your questions? I cant seem to find them in the description

  • @millionthreejs
    @millionthreejs 4 года назад

    We could use continue.

  • @naveenkamath2882
    @naveenkamath2882 3 года назад +2

    I have a doubt
    In a web dev interview or react js interview
    For Ds algo round , can we use java for writing our code instead of js.
    And for other rounds i will use js.
    I mean they will provide multiple languages options right in ds algo round ?

  • @kevinliu8034
    @kevinliu8034 2 года назад

    I think that the last solution may get a wrong result when input is 3,8,3

  • @prashanthikrishna971
    @prashanthikrishna971 5 лет назад

    Can we expect these questions for a product based company?

  • @billybobgeo
    @billybobgeo 5 лет назад

    great series -- i've watched 3 so far and all candidates fail on being verbal enough to explain their coding while they are coding... since interviews are looking for how you approach problems along with the correct solutions, candidates do themselves a dis-service by not speaking their thoughts...

    • @Techsithtube
      @Techsithtube  5 лет назад

      True that, most people knows lot of stuff , however they are either unable to explain/elaborate or dont find a need to do so. I think that is a grave mistake , often that is the reason they fail interviews.

  • @Abhishek-dp5tc
    @Abhishek-dp5tc 3 года назад

    4 years of experience and can't do fizz buzz!

  • @eloforfree
    @eloforfree 6 лет назад

    Nice video, thanks for the interviews.
    Would you say that i will need to know all the code by hard from the css section? Also is there a general guideline, when to use flex or grid and when to use the whole transform and so on, because i could write it in flex or like the interview participant, but i am not sure when to use what?

    • @Techsithtube
      @Techsithtube  6 лет назад +1

      Yes for CSS, you need to have all the syntax in your head so that you can smoothly code. You should use flex or grid but always talk to your interviewer so that they know why you are using this.

    • @eloforfree
      @eloforfree 6 лет назад

      okay, thank you for the quick answer.

  • @nayanjyotisharma1451
    @nayanjyotisharma1451 3 года назад

    The solution to last problem is not correct , don't forget position can be anything , we are not starting from initial all the time

  • @vinayakbappanadu9843
    @vinayakbappanadu9843 5 лет назад

    big fan sir

  • @parvezmd6455
    @parvezmd6455 6 лет назад

    if(true)
    {
    var y=8;
    console.log(y);
    let y=9;
    }
    o/p:'y' is already been declared
    MyQuestion:is it run time error or compile time error.
    I know javascript execute code line by line why it does not printing y=8 ??then throw error

    • @Techsithtube
      @Techsithtube  6 лет назад

      JavaScript doesnt allow you to declare same variable twice inside the same block. that is why the error.

  • @HIghtowerSever
    @HIghtowerSever 4 года назад +1

    It's interesting...

  • @MrAmarJK
    @MrAmarJK 5 лет назад +1

    kid>=toy ? toy : (toy%kid)+(start-1)

    • @Techsithtube
      @Techsithtube  5 лет назад

      Nice Solution:)

    • @martinbenavides4777
      @martinbenavides4777 5 лет назад

      if the start position is 3, then the first kid will receive the last toy, position 1. This algorithm will return 4 instead. Are we not returning the position of the last kid??

  • @Lohithnimmala
    @Lohithnimmala 5 лет назад +1

    Please don't use background music.

    • @Techsithtube
      @Techsithtube  5 лет назад

      I only used in this video.

    • @Lohithnimmala
      @Lohithnimmala 5 лет назад

      @@Techsithtube yupp, I observed it, thanks for your video tutorials

    • @Lohithnimmala
      @Lohithnimmala 5 лет назад

      @@Techsithtube yupp, I observed it, thanks for your video tutorials

  • @asimgiri4269
    @asimgiri4269 4 года назад

    function findLastKid(n, k, start) {
    let kids = [];
    let toys = [];
    for (let i = start; i

  • @AndyRosaDesign
    @AndyRosaDesign Год назад

    const lastKid = (n, k, i) => (i + k - 1) % n;

  • @shauryaverma8780
    @shauryaverma8780 4 года назад +1

    It's good

  • @ojolowoboluwatife1716
    @ojolowoboluwatife1716 2 года назад

    Nice

  • @SnoopCatts
    @SnoopCatts 3 года назад

    On the 1st 1 I think he just got nervous cuz he's being interviewed on the spot. Which is NOT FAIR because that is NOT how people develop at jobs.

    • @Techsithtube
      @Techsithtube  3 года назад

      That is true. but its unfortunate that interviews always ask thinks that you don't uses on daily bases. That is why you need to be always prepared.

  • @leomonz
    @leomonz 4 года назад

    Last Question k%n + i - 1

    • @Techsithtube
      @Techsithtube  4 года назад

      thanks for sharing your solution!

  • @malikasultanova9950
    @malikasultanova9950 3 года назад

    I dont see solutions

  • @meetshujah
    @meetshujah 6 лет назад +1

    Thanks brother Allah bless you Ameen

    • @Techsithtube
      @Techsithtube  6 лет назад

      Thank you for watching Shuja!

    • @LowFrequency
      @LowFrequency 3 года назад

      @@Techsithtube hey bro, is math required in javascript that much?

  • @xplodivity
    @xplodivity 2 года назад

    if any of are curious about the topics to review before any Frontend developer interview, then check this out: ruclips.net/video/K0GtyweTbTw/видео.html