Skip to content

Instantly share code, notes, and snippets.

@eshrinivasan
Last active May 28, 2018 08:47
Show Gist options
  • Save eshrinivasan/cb5dce322891c6c606c9cd5871296d0d to your computer and use it in GitHub Desktop.
Save eshrinivasan/cb5dce322891c6c606c9cd5871296d0d to your computer and use it in GitHub Desktop.
UI questions
<h2> Javascript</h2>
What are the differences between null and undefined?
What are the differences between == and ===?
What is reflow? What causes reflow? How could you reduce reflow?
What is repaint and when does this happen?
What does defer and async keyword does in a script tag?
What is the difference between .call and .apply, .bind?
Explain "this" in javascript
Explain prototypal inheritance in javascript
<h2> JQuery </h2>
What is the difference between jQuery find and children?
Is it possible to include multiple versions of jQuery on the same page? How
do you avoid conflicts that may occur between jQuery vs other javascript libraries?
Name some of the jQuery selectors?
<h2> Angular </h2>
List a few ways to improve performance in an AngularJS app.
What is data binding in AngularJS?
broadcast vs emit
Difference between service and factory in AngularJS
Explain what are directives ? Mention some of the most commonly used directives in AngularJS application ?
@eshrinivasan
Copy link
Author

eshrinivasan commented Jun 2, 2017

Prep for UI Dev Interviewer technical questions:

Name some design patterns in javascript and explain one of them with examples

https://scotch.io/bar-talk/4-javascript-design-patterns-you-should-know

Difference between Angular 1 and 2?

The latest version of Angular 2 gives many advantages over AngularJS 1.x including better performance, lazy loading, simpler APIs, easier debugging and considerably more.

  • AngularJS is two-way data-bound and has watchers listening to make that happen. Angular 2 is one-way data-bound and only is two-way data-bound with use of ngModel.
  • AngularJS installs like most JS frameworks, and Angular 2 installs with a “batteries included” philosophy, giving you a hot-reloading server and a primed readiness for Observables to be used.
  • AngularJS is a regular JavaScript framework. Angular 2 is in TypeScript.
  • AngularJS is not as componentized as Angular 2. With Angular 2, you generally have a separate folder for every component with the HTML, CSS, and business logic all in there (can be separate files or all in one file).

broadcast vs emit in AngularJS

emit:The event life cycle starts at the scope on which $emit was called. The event traverses upwards toward the root scope and calls all registered listeners along the way. The event will stop propagating if one of the listeners cancels it.

broadcast:The event life cycle starts at the scope on which $broadcast was called. All listeners for the event on this scope get notified. Afterwards, the event traverses downwards toward the child scopes and calls all registered listeners along the way. The event cannot be canceled.

on: It listen on events of a given type. It can catch the event dispatched by $broadcast and $emit.

prototypal inheritance in angularjs

  • A child scope normally prototypically inherits from its parent scope, but not always. One exception to this rule is a directive with scope: { ... }

  • ng-repeat, ng-switch, ng-view, ng-include and ng-if create child scopes that does not inherit parent scope for primitives (e.g., number, string, boolean)

@eshrinivasan
Copy link
Author

eshrinivasan commented May 17, 2018

@eshrinivasan
Copy link
Author

JS Dev:

Coding challenges:

  • Create a for loop that iterates up to 100 while outputting "fizz" at multiples of 3, "buzz" at multiples of 5 and "fizzbuzz" at multiples of 3 and 5
  • duplicate([1,2,3,4,5]);// [1,2,3,4,5,1,2,3,4,5]
  • sort numbers in javascript(special case, requires callback function return a - b)
  • max using apply in javascript
  • [2, 5, 7] to [4, 10, 14] using array map
  • [3, 5, 6], [5, 8] => output 5 in javascript

Understanding of concepts

https://www.quora.com/How-do-you-judge-a-JavaScript-programmer-by-only-5-questions

  • I have an HTML table with five cells in it. Each cell has a button and a field. You do not have control over the HTML or naming conventions used for IDs, etc. Write an event handler that can be applied to each button which will call a function and write the result of that function to the field that is in the cell of the button that was clicked. Do not iterate over the cells of the table.
  • Explain to me how OOP works in JavaScript. This is going to involve a conversation about prototype inheritance, closures, and lexical scoping.
  • Give me an example of something that you would use a closure for - explain the closure you’ve written.
  • Describe how you would develop a single-page application without using a framework (this one is more of a discussion and covers performance and the memory leaks Dean mentioned).
  • JavaScript is a functional programming language. Give me an example of how you can use higher order functions in JavaScript to iterate over and apply a function to every element in an array. Do not use a for or while loop.
  • I need to be able to store a DOM element so that it may, based on the results of a LATER event be moved from one container element to another. For example, I need to create a button which removes an LI from an OL or UL. The element needs to be stored during the current session so that - based on the result of ANOTHER event, I can then either attach it to the second container, move it back to the first container, or discard it. (I’m interested in their knowledge of scoping in the session.. if they recommend a global, I’ll say ok, if we don’t want to use a global variable what other options do we have? This is not an over difficult question, but it allows you to see how they think when the obvious answer isn’t the best choice).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment