Code Monkey home page Code Monkey logo

interview's Introduction

Interview for frontend

JS

Basic

what will be printed in console

if (true) {
    const name = 'john';
    let number = '123';
    var email = '[email protected]';
}

console.log(email, number, name);

what will be printed in console

for (var i = 0; i < 5; i++) {
    setTimeout(() => {
        console.log(i);
    })
}

arrays

const persons = [
    {
        name: 'John Doe',
        email: '[email protected]',
        salary: '100000',
    },
    {
        name: 'Jane Doe',
        email: '[email protected]',
        salary: '90000',
    },
];
  1. How to get array of names const names = ['John Doe', 'Jane Doe']

  2. How to get Object map const nameMap = { [email protected]: 'John Doe', [email protected]: 'Jane Doe' }

  3. How to get items where salary is higher than 1000 const result = persons.filter(item => item.salary > 1000);

  4. How to cache upper search result for later use

const createSearch = () => {
    const cache = {};

    return (amount) => {
        if (!cache[amount]) {
            cache[amount] = contacts.filter(item => item.salary > amount);
        }

        return cache[amount];
    }
};

inheritance

  1. describe how can inheritance be achieved
const Vehicle = function (color, wheelCount) {
    this.color = color;
    this.wheelCount = wheelCount;
};

Vehicle.prototype = {
    getColor: function () {
        return this.color;
    },

    getWheelCount: function () {
        return this.wheelCount;
    }
};

const Car = function (color) {
    Vehicle.call(this, color, 4);
};

Car.prototype = Object.assign({}, Vehicle.prototype);
Car.prototype.constructor = 'Car';

const car = new Car('red');

console.log(car instanceof Car);
  1. How to add to new method to Array Array.prototype.reduce = function() {}

promises

  1. what is callback hel, describe, how to fix it

  2. What is going to be the sequence of the requests

fetch('//google.com')
    .then(function () {
        fetch('//yandex.ru')
    })
    .then(function () {
        fetch('//facebook.ru')
    })
    .then(() => {
        fetch('//twitter.ru')
    });

  1. Will the thens after throw error work, what is going to be after catch
fetch('//google.com')
    .then(function () {
        throw new Error('some error');
    })
    .then(function () {
        fetch('//facebook.ru')
    })
    .then(() => {
        fetch('//twitter.ru')
    }).catch(() => {
        console.error('error occured');        
    }).then(() => {
        fetch('//yandex.ru');    
    });
  1. convert promise to async await
fetch('https://google.com')
    .then((json) => {
        return json()
    })
    .then((data) => {
        return data
    }) 

CSS

  1. Tell about box model
  2. inline, block, inline-block
  3. Flex box, Grid, any differences
  4. transition, transform, animations
  5. Preprocessors
  6. Custom fonts, font sizing
  7. Mobile first
  8. Print css

React

  1. Virtual DOM
  2. setState sync or async function
  3. Profits of react, UNIT test, components just functions, performance with virtual dom
  4. jsx what is it
  5. what is state and props, props are immutable,
  6. arrow function in react
  7. refs
  8. Pure Component
  9. HOC, why are they needed
  10. flux
  11. reducer, Store, action,View

Redux

  1. Explain flux
  2. Explain Actions, Store, Reducer, Container
  3. Middleware
  4. How we go back in time

Tools

  1. Git, release-1.0, master, need to send bugfix to release-1.0.1
  2. Bundling tools, webpack, rollap, gulp, grunt
  3. npm 5, 6 anything, custom packages inhouse or smth about that
  4. CI/CD tools, any experience
  5. linting tools, eslint
  6. testing tools, jest or others, talk about unit tests

General

  1. what is session
  2. what is cookies
  3. authorization process

interview's People

Contributors

midan888 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.