This was a Apple iCloud team phone interview problem
Tuesday, April 27, 2021
React Tic Tac Toe Game
Labels:
Atoms,
Game,
Interview,
Javascript,
React,
Web development
Monday, April 26, 2021
Implement getElementsByClassName
See the Pen Implement getElementsByClassName by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Dropbox Interview Problem
Implement getElementsByAttribute
See the Pen poRGdrN by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Sunday, April 25, 2021
Mock API layer data using promises, async/await, setTimeout
See the Pen Mock API layer data using promises, async/await, setTimeout by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Labels:
API Client,
async,
await,
Javascript,
Promise
BST insertion
See the Pen BST insertion by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Next greater element i
See the Pen Next greater element i by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Saturday, April 24, 2021
More LinkedList functions in JS
See the Pen RwKvbEY by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Friday, April 23, 2021
Find corresponding Node of a second tree, given the node of a tree
See the Pen Corresponding DOM Node in 2nd DOM Tree by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Apple Phone Interview Question
Someone recently asked me what's the point of such questions where you get something from one tree and find something based on it in a second tree. Such kind of algorithms are useful for libraries like React. React is a UI development library that has optimized rendering for the browser.
The browser renders HTML in the form of DOM (Document Object Model) tree. Any update to the DOM is cascaded down this tree (involves tree processing complexity) and then the browser re-paints the changes. And these operations on the DOM tree are all pretty expensive.
What React does is to create a copy of the HTML DOM - this copy DOM tree is called the Shadow DOM. Any update you make to the DOM is first made on the Shadow DOM and then all the updates are batched together and sent to the actual HTML DOM. As a result, the number of times the browser re-paints the DOM is highly reduced. Thus using React provides you with faster/optimized renderings.
In order for React to do what it does with it's own shadow tree and the HTML DOM Tree, it needs to do things with one tree and transfer it to the other tree.
Classes & functions in JS
See the Pen Classes & functions by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Interview details: Salesforce Manager Coding round
Labels:
Class,
EventListeners,
Interview,
Javascript,
OOP
Thursday, April 15, 2021
Implementing Custom Event listeners
See the Pen Implementing a class with event listeners by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Labels:
Class,
EventListeners,
Interview,
Javascript,
OOP
Wednesday, April 14, 2021
Maximum Depth of Binary Tree
See the Pen Maximum Depth of Binary Tree by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Tuesday, April 13, 2021
Pangram
Labels:
Algo,
Interview,
Javascript,
React,
Web development
Monday, April 12, 2021
Closures with let and var lexical context
See the Pen Closure behavior with let and var by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Subdomain visit count
See the Pen Subdomain Visit Count by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Intersecting clickstream data
See the Pen Intersecting Clickstream data by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Thursday, April 8, 2021
Most Frequent Subtree Sum
See the Pen Most Frequent Subtree Sum by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Tree Path Sum
See the Pen Tree Path Sum by Dhiviya Dhanasekar (@dhiviyadhanasekar) on CodePen.
Monday, April 5, 2021
Sunday, April 4, 2021
Subscribe to:
Posts (Atom)