interview experiences and tips

8
I’m putting my detailed interview experiences here and also a few tips to help prepare for interviews. 1. Amazon round 1: 1. Design the most optimal data structures for an LRU cache. 2. Convert a sorted array to balanced binary search tree. 3. Reverse a singly linked list in groups of k inplace. 4. Design the most optimal data structure for storing a word and its meaning. Note that a word could have multiple meanings. 2. Amazon round 2: 1. Write a recursive routine to calculate a ^ n. 2. Design the most optimal data structure for a never ending stream of numbers. It should be optimized for insertion, deletion, searching, finding kth largest and kth smallest. 3. Akamai round 1: 1. Program to swap kth and kth to last element of a singly linked list in one pass. You are not given the length of the linked list before hand. 2. Program to reverse the ordering of words in a sentence. 3. Program to find the intersection point of two singly linked lists in O(n). 4. Program to reverse a singly linked list both recursively and iteratively. 5. There are 12 balls which are identical in size and appearance but one is an odd weight (could be light or heavy). Find it in minimum number of weighings using a balance. 4. Akamai round 2: 1. Program to reverse a singly linked list in groups of k recursively. 2. Program to find the length of the longest substring without repeating characters in a string. 3. You are given two cubes. Represent the date of a month (01 31) using both the cubes by placing numbers on the given cubes. 4. Given an array containing repeated characters, find the character repeated most number of times. 5. Akamai round 3 1. Trace the output of a C/C++ code snippet containing extensive pointers and references. 2. Explain segmentation fault. 3. Explain BFS and DFS.

Upload: sumanth-s-murthy

Post on 21-Jul-2016

115 views

Category:

Documents


2 download

DESCRIPTION

Collection of interview questions from top Product companies

TRANSCRIPT

Page 1: Interview Experiences and Tips

I’m putting my detailed interview experiences here and also a few tips to help prepare forinterviews.

1. Amazon round 1:

1. Design the most optimal data structures for an LRU cache.2. Convert a sorted array to balanced binary search tree.3. Reverse a singly linked list in groups of k in­place.4. Design the most optimal data structure for storing a word and its meaning. Note that a wordcould have multiple meanings.

2. Amazon round 2:

1. Write a recursive routine to calculate a ^ n.2. Design the most optimal data structure for a never ending stream of numbers. It should beoptimized for insertion, deletion, searching, finding kth largest and kth smallest.

3. Akamai round 1:

1. Program to swap kth and kth to last element of a singly linked list in one pass. You are notgiven the length of the linked list before hand.2. Program to reverse the ordering of words in a sentence.3. Program to find the intersection point of two singly linked lists in O(n).4. Program to reverse a singly linked list both recursively and iteratively.5. There are 12 balls which are identical in size and appearance but one is an odd weight (couldbe light or heavy). Find it in minimum number of weighings using a balance.

4. Akamai round 2:

1. Program to reverse a singly linked list in groups of k recursively.2. Program to find the length of the longest substring without repeating characters in a string.3. You are given two cubes. Represent the date of a month (01 ­ 31) using both the cubes byplacing numbers on the given cubes.4. Given an array containing repeated characters, find the character repeated most number oftimes.

5. Akamai round 3

1. Trace the output of a C/C++ code snippet containing extensive pointers and references.2. Explain segmentation fault.3. Explain BFS and DFS.

Page 2: Interview Experiences and Tips

4. Which traversal would I prefer for finding a cycle in a graph?5. Explain time and space complexities of hashmap.6. Design the underlying data structure behind a login page.

6. D.E Shaw round 1

1. Give the full form of BIOS.2. Mention any five operating systems which have been derived from UNIX.3. Differentiate between HTTP and HTTPS.4. Mention any five file compression extensions.5. Explain indexing mechanism in DBMS.6. Give a real world application of linked lists.7. What is a torrent? What are seeders and leechers?8. What is P2P network?9. How would I defend myself if I were to get caught for having downloaded torrents?10. Throw some light on what is happening inside Large Hadron Collider in CERN.11. What do I know about Higgs boson?12. Differentiate between LED, LCD, and Plasma TV.

7. Microsoft round 1

1. Given two sorted arrays, say A and B, find A ­ B. Here, A ­ B means all those elementspresent in A but not in B. The expected time complexity was O(m + n), if A is of size m and B isof size n.

8. Microsoft round 2

1. Write a routine to output the elements of the inorder traversal of a binary tree one by one in itseach call.eg: Assuming the inorder traversal is 1, 2, 3, 4, 5, the routine should return 1 in its first call, 2 inits second call and so on.2. Given a set of courses along with the prerequisite courses for these courses, write a programto find the minimum number of semesters required to wrap up all the courses.

9. Cisco round 1

1. How many interviews have I attended before?2. What value would I add to Cisco?3. What do I know about Cisco?4. Am I ready to work as an IT manager?5. Mention the layers in OSI stack.6. When would I go for a router to make two computers communicate?7. Mention the number of bits in IPv4 and IPv6 addresses.

Page 3: Interview Experiences and Tips

8. What is the need for IPv6?9. How many clients are possible for a /24 address?. What is the network address andbroadcast address here?10. What is the difference between anycast, unicast, and multicast?12. What is virtual memory? What is its size in relation to main memory?11. How do I rate myself in C, web technologies on a scale of 10?12. What are my strengths?13. The classical 3l, 5l puzzle.

10. Netapp round 1

1. Give a few technical differences between Windows and UNIX.2. Give a few differences between NTFS and FAT.3. Mention the layers in OSI stack.4. Explain in detail the concept of NAT and DHCP.5. What is the difference between hub, switch, and router?6. What is collision domain? How does bridge segregate collision domains?7. Given a routine which sorts only positive numbers, write a wrapper around it to sort bothpositive and negative numbers.8. Suggest a suitable combination of array and hashmap to design the underlying data structuresbehind an educational institution’s website. The website supports selection of a particulardepartment, a particular course in the department, a particular student in the course.9. Give the design considerations for a client server system wherein the client gets a virtualoperating system on the fly through the network from a server consisting of several suchoperating systems.10. What are the different types of virtualization?. I was asked to differentiate between systemand process virtualization.12. Explain VMware’s virtualization on a multicore machine.13. Pack 51 apples in minimum number of packets such that with the packets I have made, Ishould be able to give any number of apples between 1 and 51.

11. Netapp round 2

1. Write a program to implement strstr.2. From an incoming stream of numbers, construct a binary tree such that it is almost balanced.3. How would I implement the autocomplete feature for search queries?

12. Netapp round 3

1. What is a semaphore?2. Code the P and V operations of a semaphore.3. Explain REST web service4. Is HTTP a stateless or stateful protocol?

Page 4: Interview Experiences and Tips

5. What is shared memory?6. What motivates me in life?

13. Netapp round 4

1. Explain the alignment issues in structures.2. I am given two files viz. f1.c, f2.c, both having a call to malloc(). Can the address of thelocations returned by these two be same?3. Explain memory management unit.4. What is a socket?5. I was asked in detail the concept of type casting in C.6. Can I declare a structure called ‘a’ which contains a structure called ‘b’ and ‘b’ in turn contains‘a’?7. How do I find the offset of a member of a structure object? How would I do the same if I amnot allowed to create the object at all?

14. Netapp round 5

1. I was asked to tell something about me that was not in my resume?2. What are my strengths?3. What do I know about Netapp?4. What do I think about higher studies?5. What is my family background? Do I have any siblings?6. My preferences regarding the various job profiles they had to offer?

15. Ittiam round 1

1. Design a data structure for dictionary.2. Time complexity of various operations on hashmap.3. Implement memcopy in C.4. Can I increment a void pointer?5. I was also asked a couple of simple puzzles.

Practo coding test

1. Program to find the number of trailing zeros in a factorial.2. Program to invert all bits from the leftmost set bit in an integer.3. Program to invert the case of the last letter in each word of a sentence.4. Given numbers in range 1 to 1000000006, find the minimum number such that the product ofits digits modulo 1000000007 is equal to itself.

16. Practo round 1

Page 5: Interview Experiences and Tips

1. I was asked to optimize the last program mentioned above.2. I was asked in detail about my internship experience and projects.3. I was asked why I did not contribute to any open source projects.

17. Practo round 2

1. I was asked to explain the code of my android app from my dropbox account.2. The usual HR questions followed after that.

18. Paypal round 1

1. Which is my dream company?2. What is my biggest achievement till date?3. How would I handle conflicts with my team members?4. I have saved money from a year and bought my dream bike. It is the last round of Paypalinterview today. I am on my way on the bike and it breaks down in a no parking zone. Suggest awin­win situation so that I don’t lose both interview and bike.5. What is success according to me?

19 Paypal round 2

1. I was asked to write a code snippet from my project.2. Program to implement Dijkstra’s algorithm.3. Program to reverse a singly linked list.4. Which algorithm would I use to sort a linked list and why? Subsequently, I was asked toexplain the logic of merge sort.5. Suggest as many methods as possible for finding the nth largest element in an unsortedlinked list.

20 Paypal round 3

1. How would I explain the concept of prime number to an illiterate?2. Give a few test cases for a bank transaction.3. Design classes for educational institutions in a city.

21 Infibeam round 1

1. I was asked to derive the time complexity of my code from the written test. It was to print theelements of a binary tree in spiral order.2. Program to swap two pointers.2. Program to determine whether a given binary tree is binary search tree. I was asked to solvethis in two different ways.3. Two DBMS queries involving aggregate functions.

Page 6: Interview Experiences and Tips

22 Infibeam round 2

1. Program to implement Dijkstra’s algorithm.2. Program to implement Floyd­Warshall’s agorithm.3. Program to print the elements of a matrix in spiral order recursively.4. Given an unsorted array of numbers, find two numbers which add up to the given sum in O(n).5. Explain indexing in DBMS.6. Explain B and B+ trees.

23 Infibeam round 3

1. Given a binary tree, write a program to determine whether there exists a root to leaf pathhaving the given sum.2. Program to find the lowest common ancestor of two nodes in binary search tree as well asbinary tree. I was also asked to give the brute force approach for the same.3. Program to print all ancestors of a node in a binary tree.4. Given an array arr[ ] of n integers, construct a product array prod[ ] such that prod[ i ] is equalto product of all the elements of arr[ ] except arr[ i ]. I was asked to solve this without usingdivision operator and in O(n).

24 Cisco round 1

1. Program to print the elements of a binary tree in spiral order.2. Explain what happens underneath when you enter a URL in the browser.3. Explain why MAC addresses are required despite having IP addresses.4. Solve the classical bridge and torch puzzle.5. Explain my internship project.

25. Cisco round 21. What is an arraylist in Java?2. What is the difference between an arraylist and a linkedlist in Java?3. “Java is not a pure OO language”. Justify (the answer expected was that the primitive typesare not objects in Java!)4. What is the difference between an object oriented and object based language?5. Explain inheritance and abstraction with a concrete example.

26. Cisco round 31. Why would I want to work for Cisco?2. Why would I want to transition from web development to system level coding? (my internshipwas on Ruby on Rails)3. What’s my take on higher studies?

Page 7: Interview Experiences and Tips

4. What is the difference between C, C++, and Java?5. Do I like Ruby or Java more?6. This was followed by a brief scan of my resume.

Intuit written test1. Given a word and dictionary, write a program to calculate the total number of valid wordspossible from the given word.2. Explain the solution to the classical 25 horses and 5 lanes puzzle.3. Write a program to find the GCD of a set of numbers. (Euclid’s algorithm)4. Design the most optimal data structures for an LRU cache.

27. Intuit round 11. Program to insert an element into a sorted linked list.2. Program to delete a node in a singly linked list given only a pointer to the node to be deleted.3. Given an array of n elements which contains elements from 0 to n­1, with any of thesenumbers appearing any number of times. Find these repeating numbers in O(n) and using onlyconstant memory space.4. For what all purposes is the virtual keyword used in C++?5. Explain a project listed on my resume.

28, 29. Intuit round 2 and 31. A thorough scan of my resume and in depth coverage of all the projects and technologieslisted on it.2. Difference between C, C++, and Java3. Which domain would I be interested to work in? (desktop apps or web apps)4. Difference between Web 2.0 and Web 1.0.5. Difference between IAAS, PAAS, SAAS. (cloud computing was listed on my resume)

Tips to help prepare:Aptitude Round:1.Quantitative ­ Quantitative Aptitude (R S Aggarwal), Quantum CAT(S K Verma)2.Verbal and Non Verbal ­ A Modern Approach to Verbal and Non Verbal Reasoning (R SAggarwal)3.Logical ­ The Great Book of Puzzles and Teasers (George Summers)4.Technical ­ MCQs in Computer Science(Timothy J Williams)

Technical Interview Round:1.Books ­ Cracking the Coding Interview (Gayle Laakmann), Programming Interviews Exposed(John Mongan et al.), Programming Pearls(Jon Bentley)2. Websites ­ GeeksforGeeks ­ A computer science portal for geeks,Programming InterviewQuestions | CareerCup, LeetCode,3.  Puzzles ­ techinterview

Page 8: Interview Experiences and Tips

Resume and HR:1. Books ­ Google Resume (Gayle Laakmann)

This is an extremely exhaustive list. It will stand you in a very good stead for any top tiercompany (technical or nontechnical) that may visit the campus. It's no different from a semesterfull syllabus. Just think that way and ace it. All the best!