Giter Site home page Giter Site logo

interview-questions's Introduction

Interview Questions

An ever expanding list of possible interview questions.

General Questions

JavaScript/TypeScript

  • Explain the difference between const, let and var?
  • What are some JavaScript primitive types?
  • number, boolean
  • What is a prototype? What is it used for?
  • Describe how scope resolution in JavaScript works?
  • Explain bind and why you would us it?
  • What is a Promise?
  • How do you handle errors with promise? How is an exception handled?
  • Explain your understanding of async/await?
  • What do all async functions return?
  • What might be a situation where you'd use a promise over await?
  • Parallel execution (Promise.all) or your target environment doesn't support async/await
  • What is destructuring? When might you use it?
  • Syntactic sugar around assignment that allows you directly assign a variable from an object or an array.
  • let {a, b} = JSON.parse("..."); let [value1, value2] = Promise.all(...)
  • What is a decorator? When might you use it?
  • A way to change the behavior of a function/class without making changes to the function/class itself.
  • Use cases: logging, security, validation
  • What is the spread operator? When might you use it?
  • ... aka spread operator allows an iterable to be expanded in place
  • Useful for array concatenation/copying, extending objects/copying, calling function (replace apply)

JavaScript WebAPI

  • JavaScript interacts with HTML on a webpage using what API?
  • DOM
  • In a web browser how do you retrieve data from a web server using JavaScript?
  • The older XMLHttpRequest (XHR) api is an event based API for creating async requests.
  • The newer fetch api is a promised based API that simplifies retrieving data
  • WebSockets is also a possibility and is well suited for applications requiring two way communication

Web Architecture

  • What frameworks have you used?
  • What do like about framework X? What do you not like?
  • If you had to choose a front end framework, which would you choose?
  • If you had to choose a server framework, which would you choose?
  • Are you familiar with OAuth? Can you explain at a high level how it works?
  • Why would you choose to use WebSockets over HTTP or Server Side Events?
  • Explain the same-origin policy. How do you get around same-origin policy limitations? Explain how CORS works.

Networking

  • What are the two most common transport layer protocols built on top of internet protocol?
  • Explain the difference between UDP and TCP? What are some benefits and drawbacks of each?
  • What transport layer protocol does HTTP use? How about WebSockets? WebRTC?
    • TCP
    • TCP
    • SDP

Ops

  • How have you managed things like passwords in your code?
  • What tools have you used for secrets management?
  • Have you heard of the 12 factor app?
  • Can you explain your understanding of the 12 factors?

Functional

  • Explain map. Explain flatMap
  • Explain reduce

Project/time management

  • How have you handled a project that you thought you could get done by a certain date but as the deadline approached, you realized you would be unable to complete it?
  • How do you balance writing tests with a strict project deadline?

Exercises

Prefix searching

Suppose that you need to search a list of words to find all words that begin with a search term. Assume you are given the words in array.

E.g. Given an english dictionary, "sup" => ["superior", "superlative", "supine" ...]

Q1: Implement an naive solution

const dict = ["one", "two", "three", "four"];

function search(prefix) {
  const results = [];
  results.forEach(word => {
    if(word.startsWith(prefix)) {
      results.push(word);
    }
  });
  return results;
}

// or perhaps
const search = (prefix) => dict.filter(word => word.startsWith(prefix));
What is the runtime of your solution? (big O)

Example code is O(NM) where N is the number of characters in prefix and M is the length of the dictionary

Q2: What are some possible optimizations you might make to the above solution?

TODO: finish

Find the length of a Line String

TODO: implement

Triangle Counting

Given N nonparallel lines, implement a function that calculate the number of triangles produced by intersecting lines. Intersections points are infinitely small and therefore no three lines intersect at the same point.

TODO: solution

interview-questions's People

Contributors

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