rogerxu / rogerxu.github.io

Roger Xu's Blog
2 stars 2 forks source link

Front-End Interview #47

Open rogerxu opened 7 years ago

rogerxu commented 7 years ago

Front-End interview questions · Front-End Developer Handbook 2018

Twipped/InterviewThis: An open source list of developer questions to ask prospective employers

rogerxu commented 7 years ago

Interview Questions

Library

Questions

JavaScript Front End Interview Questions. – Medium

来自掘金的你——挖 "掘" 淘 "金" 之 前端闯关历险记学习资料汇总 · Issue #4 · jawil/blog

Front End Developer Questions - Markyun

30 Interview Questions and Answers (Frontend Engineer) – Medium

25 Essential Questions Asked in Top JavaScript Interviews | Toptal

21 Essential JavaScript Interview Questions | Codementor

Top 85 JavaScript Interview Questions & Answers |

JavaScript Interview Questions | Coding Interview Help | Interview Cake

rogerxu commented 7 years ago
rogerxu commented 7 years ago

10 Interview Questions Every JavaScript Developer Should Know – JavaScript Scene – Medium

Programming Paradigms in JavaScript

Functional Programming

Functional programming produces programs by composing mathematical functions and avoids shared states and mutable data.

Classical Inheritance and Prototypal Inheritance

Class Inheritance: instances inherit from classes (like a blueprint - a description of the class), and create sub-class relationships. Instances are instantiated via constructor functions with the new keyword.

Prototypal Inheritance: instances inherit directly from other objects. Instances are typically instantiated via factory functions or Object.create(). Instances may be composed from many different objects, allowing for easy selective inheritance.

Functional Programming vs Object Oriented Programming

OOP

Pros

Cons

FP

Pros

Cons

Prototypal Inheritance

"favor object composition over class inheritance"

It means that code reuse should be achieved by assembling smaller units of functionality into new objects instead of inheriting from classes and creating object taxonomies.

In other words, use can-do, has-a, or uses-a relationships instead of is-a relationships.

Two-way Data Binding vs One-way Data Flow

Two-way data binding - UI fields are bound to model data dynamically such that when a UI field changes the model data changes with it and vice-versa.

One-way data flow - The model is the single source of truth. Changes in the UI trigger messages that signal user intent to the model. Only the model has the access to change the app's state. The data always flows in a single direction, which makes it easier to understand.

Monolithic vs Microservice Architecture

Monolithic architecture

The app is written as on cohesive unit of code whose components are designed to work together, sharing the same memory space and resources.

Pros

Cons

Microservice architecture

The app is made up of lots of smaller, independent applications capable of running in their own memory space and scaling independently from each other across many separate machines.

Pros

Cons

Asynchronous Programming

Asynchronous programming means that the engine runs in an event loop. When a blocking operation is needed, the request is started, and the code keeps running. When the response is ready, an interrupt is fired, which causes an event handler to be run. In this way, a single thread can handle many concurrent operations.

rogerxu commented 7 years ago

Pure Function

Promise is not a pure function because it is eager to run. But we can wrap a function to return a function that returns the Promise object. This function is pure.

const getInfo = name => () => jQuery.get(`https://www.example.com/${name}`);

const fetch = getInfo('foo'); // this function is pure
fetch() // t his function is not pure
  .then(id => console.log(id))
  .catch(handleErrors);
rogerxu commented 7 years ago

Preparing

rogerxu commented 6 years ago

Cracking the front-end interview – freeCodeCamp

Front-end concepts

HTML and CSS

JavaScript Concepts

Design Patterns

Computer science concepts

Data Structures

Sorting

rogerxu commented 1 year ago

Resume

如何写一份有效的技术简历? - 阮一峰的网络日志 (ruanyifeng.com)