WDE 2 LinkedIn ( Front End )
Anonymous User
5395

YOE: 4

Round 1 - Initial Screening

function Foo(x) {
	function bar() {
		return x;
	}
	this.baz= function() {
		return x;
	}
}
Foo.prototype.baz = function() {
	return x;
}

//
let y = new Foo();
y.baz() // equals ?
y.bar() // equals ?

Discussed on prototypical inheritance, closures, function expressions, constructor functions and this. Asked how we could make above code work on all scenarios ?

Q2: Implement Standard memonization function

Q3: Implement People you may know component .Image link :
People you may know
This needs to be done in plain CSS, JS , HTML. Pay attention to semantic tags.Asked about CSS . The working code needs to be implemented in coderpad . Clicking see more, should trigger API call and append more nodes. Closing / clicking Connect should close that node.
Tip: They would definitely ask about how you can optimize event handlers . Talk about event delegation and tradeoffs on putting event handler at root container vs child container

Round 2: Pragmatic Coding

Implement this screen

It was a tooltip over a link.

  • Asked to do it with plain CSS and HTML initially .
  • How you would center the caret character? ( transform: translateX(-50%) css positions etc.
  • How would you do it with Javascript ? How can tooltip be placed dynamically on top , left, right and bottom based on which position the lionk is located ? ( ie window.offset* properties. Write pseudo code.
  • How you would do it without introducing an extra node for tooltip ?
  • If you have an array of links how would you optimze it using event delegation ? How can you do it with just one tooltip node that would dynamically be placed for all components ?
  • Assuming your web app is lite weight how would you clean up event listeners ?

Round 3 DS Algo

Max Subarray Sum
Return the start and end index as well for above problem

Implement String.repeat(times) function . The repeat should get repeat str x times.

  let str = 'string';
  console.log(str.repeat(3)) // stringstringstring

Came up with O(n) initially . Then asked to optimize it . Using recusrion did it in O(log(n)) . Also said you can ignore the complexity of template literal concatenation .
There was also discussion abour this , call, apply and bind

Round 4 JS

This was the round which I expected to make max impact but it ended up opposite.
Implement tuple function which would take string and convert it as a tuple and then it should support an operation multiply(n) which would multiple ith item of each tuple.

 const str = `(1, 2, 3) , (4, 5, 6) ,  (7, 8, 9) `; // Convert it into  [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
 const x = tuple(str);
 console.log(x.multiply(2)); // Multiples 2nd item in each tuple . ie 2 * 5 * 8

Was not sure how to use regexp and str.split() function as I usually google such questions . Wrote a function which would parse that string and convert it to 2-D array . ie iterate through strnig , if character is ( do this , else do that ...

Q2

console.log(1 + function x() { alert("Hi")}) 

What would be output of above function ?
I knew some sort of type coercion would happen and some strings would be printed . Just said like that as I have never added a function to a number in 4 years of my career .
They wanted output to be modified to :
1start:function x() { alert("Hi")}:end.
The task was to override toString method based on revealing module pattern using IFFE and closures. Took about 30 minutes to do this and lot of hints from interviewers . With this one question they gave a negative feedback on my JS round

Round 5 UI design

Design a calculator that supports undo feature.
ie it can undo to any depths . ie `

3+4= 7 
7*2 = 14

If we are at 14 , pressing undo button should go upto intial state .
Then asked it to convert it to kind of 3rd party util to be consumed at LinkedIn feeds.
Its straight forward stack data structure. Implemented it just as an HOC , which would accept the callback function that needs to be executed on undo.
The library also should support direct undo to state i;

Round 6 Technical Sense

Asked about current work accessibility, performance, responsiveness . How they were implemented ? How you analyze user data, XD inputs, PM discussions etc . Then about apps that I use daily , how they could be improved ...

Round 7 Managerial

Usual behaviural questions, mentoring experience, tell about a project which gave high business impact, which you are proud off , how you handle conflicts etc.

HR called and said got mixed feedbacks from interviewers . Did well in DS , design and HTML / CSS rounds, but need to improve JS ( with just that 1 question ) . Ultimately decided to not continue :) .

Comments (13)