Monday, November 30, 2015

LinkedIn Interview Experience

Round 1 (Telephonic)
Data Structure

1.  Write code to find maximum contiguous sum in an array of integers.
2.  Write code to find maximum contiguous product in an array of integers.
3.  Given a nested listed of integers, return the sum of all integers reverse weighted by their depth.
     When I started taking time for it, question was simplified to find weighted by their depth.
     For ex: {{1,1}, 2, {1,1}} should return (1*2+1*2) + (2*1) + (1*2+1*2) = 10

Round 2 
Whiteboard Coding Round

1. Given a list of tuples representing intervals, return the range these intervals covered.
For ex: [1,3], [2,5], [8,9] should return 5.

2.  There is a list of Points given , let's say:
     {0,3}, {0,6}, {0,9}, {1, 8}, {1,5} . Find out 3 points whose distance is minimum from a given Point P {1,3}. Focus was to optimize on time complexity.

Round 3 
Whiteboard Coding Round

1. Find out maximum no of collinear points in a plane. Also find out the line formed by them.

Round 4
Design Round

1.  There is a set of let's say 10 servers which are receiving thousands of client request per second.
There is a function given isMalicious( String ip) which returns true of an ip is malicious.
Server should drop the ip if it is malicious.  Design such a system so that call to function isMalicious() is minimum.

Round 5
Host Manager Round

1. Tell me about yourself
2. Describe about the current project and various question on it like what were the challenges faced etc.
3. What are the steps that you will follow if you are assigned some task.

Round 6
Technical Communication

1. Talk about any interesting project that you have done in your career.
2. Lots of questions on project like how it will work in multithreaded environment, why certain design or technology was adopted. Could we have done something better ? etc. etc.






Snapdeal Interview for SSE

Round 1
Data Structure

1.  Given a column title as it appears in excel sheet, find the column no pertaining to that.
For ex. A -> 1
             B ->2
             AA -> 27 etc.

2.  Given a list of words. Find if two words can be joined to form a palindrome.

3.  You have 3 data points: Date, City, temperature. You can preprocess the data and keep it so that following query can be returned immediately.
  1) on 9th November, what was the temperature of Bangalore
   2) on 9th November, Give 5 hottest or coldest cities name.

Round 2
Java

1. Design elevator system along with UML diagram.
2. What is singleton and write singleton pattern.
3. Questions on other design patterns like decorator, strategy , builder etc.
4) What is advantage of using SPRING and REST etc.

Round 3
Hiring Manager

1. Why Snapdeal and what type of work excites me?
2. Where do you see yourself in next 5 years?
3. You have two classes. 1. Registry service 2. Client class and single JVM
Design a class in such a way that all the client classes register themselves to registry service when they are loaded.



Ola Interview for SDE II

               
Round 1
Machine Coding Round

Design Bowling game and write Java code for it using OOPS concept. Focus was on to check coding skills and design pattern being used.

Round 2
(Data Structure + Java Round)

1.  Rotate an array k times

2.  Reverse a linked list
http://www.geeksforgeeks.org/write-a-function-to-reverse-the-nodes-of-a-linked-list/

3. Level Order Traversal of a Tree
http://www.geeksforgeeks.org/level-order-tree-traversal/

4. Spiral Order Traversal of a tree
http://www.geeksforgeeks.org/level-order-traversal-in-spiral-form/

5. What is singleton pattern and write a singleton class

6. Why is singleton preferred over static class


Round 3
(Data Structure + Design Round)

 1. Given a binary tree in which each node contains a number. Find maximum possible sum from one leaf to another.
http://www.geeksforgeeks.org/find-maximum-path-sum-in-a-binary-tree/

2.  Lots of other technical questions like how to calculate shortest path b/w 2 Nodes etc.


Round 4
Hiring Manager Round

1. Lots of questions related to project and why certain technique was used.

2. There is a online shopping site which is receiving multiple requests at any point of time.
Design your system in way so that 
a) 10% of Requests are shown discount coupon "ABC"
b) 25% of Requests are shown discount coupon "MNO"
c) 65% of Requests are shown discount coupon "XYZ"