Placement Forum
Photo of sunset

Ashish Prasad

CSE Developer

Year Of Graduation : 2015

  • Round 1 Written Test

    Experience :

    The online round had 4 programming based questions and was conducted on hacker-earth. The questions asked are:

    Q.1) Given two strings, check if they are anagram of each other.

    Q.2) You are given 2 numbers, no1 & no2. Reverse both no1 & no2, add them up and take the reverse of resultant number. Output the final resultant number.

    e.g. no1 = 12

    no2 = 36

    Output = Reverse(Reverse(12)+Reverse(36)) = Reverse(21+63) = Reverse(84) = 42

    Q.3) You are given a matrix of size mXn consisting only of 0 & 1's.

    The number of 1's in the any row of matrix is equivalent to row index of that matrix. All 1's occur at the start of matrix and thereafter trailing 0's follow. We have to find the total number of 1's in sub-matrix of size rXc .
    The 1-1 index pattern is followed i.e. first row and col is index as 1,1

    e.g.   
    Given: 3 5

    From the given matrix, we can conclude that matrix would look like

    Index 1 2 3 4 5

    1 1 0 0 0 0

    2 1 1 0 0 0

    3 1 1 1 0 0

    Now, for Input 3,2 , we will have sub-matrix as

    Index 1 2

    1 1 0

    2 1 1

    3 1 1

    Total number of 1's in sub-matrix = (1)+(1+1)+(1+1) = 5

    Q.4) For any given string, we have to find total maximum cost for processing the string. Sadly, I don't exact remember how the given cost was being calculated.
    Tips :

    When writing code, do think of corner cases. Even if you are not able to able to derive complete logic, write the code for partial part which you have derived. For each question, there are numerous test cases out of which some are simple and very few has corner cases included. So, even partial completion of test cases help you to yield better marks.
  • Round 2 Group Discussion

    Experience :

    No Group Discussion
  • Round 3 Technical Interview

    Experience :

    There were two different interview round to judge the candidate algorithm skills and approach towards the problem.

    Interview Round I

    The interview was telephonic based and I was asked 6 questions in total. 3 from DS/Algo, 2 Puzzle based problem and last abstract based question

    Q.1) Given a sorted array of random integers, find two numbers whose sum is equivalent to some number, let's say k. Then she modified the question as given a sorted array, find three numbers whose sum is equivalent to 0.

    Q.2) Given a singly linked list, reverse it using recursion.

    Q.3) For given any two nodes in a binary tree, find the number of nodes lying between them.

    Puzzle Based Problem:

    Q.4) There are three baskets sitting next to each other on a high shelf so that you cannot see the contents of any basket. Under the first basket is a sign that says APPLES. Under the second basket is a sign that says ORANGES, and under the thrid basket is a sign that says APPLES AND ORANGES. Each basket is incorrectly labeled. One basket contains all apples, one all oranges, and one a combination of apples and oranges. Is it possible to reach up on the shelf and without looking into any of the baskets select one piece of fruit and on the basis of knowing what that piece of fruit is correctly label all three baskets? Explain your reasoning.

    Q.5) Gold coin weighs one gram, counterfeit coin weighs 1.1 grams. You have 10 bags full of coins, nine of the bags are full of real gold but one bag is full of the counterfeit coins. Given a perfect scale (a pointer scale, for example) and ONE weighing can you determine which bag has counterfeit coins? If so how?

    Abstract Based Problem:

    Q.6) You are in a semi-constructed building. The building has a lift with a single button which takes you to a random floor. You enter inside the lift and press the random button. The lift takes you to some random floor. Now,without getting out of lift, how will you estimate that on which floor, you are standing right now.

    The question was basically meant to test your lateral thinking power during the interview.

    Interview Round II

    The interview start with one basic question from OS, then carried onto my projects and then gave me a coding based question to code on google doc.

    OS Based Question:

    Q.1) What do you mean by Zombie Process?

    Q.2) Tell me about yourself

    Some project related questions

    Q.3) Google Doc Based Coding Question

    You are given an array of numbers. Based on values present in the array, construct a binary tree.

    Input:

    Index 0 1 2 3 4 5

    Array -1 0 0 1 2 3


    In the array, first we will find -1, the index of -1 within the array will be root of our tree.

    Tree

    0

    Then find the root node value within the array. In the given example, they are present at index position 1 & 2.Now 1 & 2 will be our children. As 1 is less than 2, 1 should be our left child and 2 our right child

    Tree

       0
     /  \
    1    2

    Then, repeat the process for all children, in this case 1 & 2

    Final Tree:

       0
      /   \
    1      2
      \      \
        3    4
         \
         5

    3 become right child of 1 as there is only children of 1 possible. In such case, check if index value is greater than parent or not. If greater, the child would be right child else left child.

    The final output should be reverse level order traversal

    Output: 5 3 4 1 2 0

    Later on, the interviewer modified the problem as if you are required to produce the output without even creating the binary tree at all, how will you do it?
    Tips :

    All the Interviews went for 1-2 hrs each.Since I had 2.5 yrs experience before going to Amazon,so lots of questions were asked on previous project

    Interviews are not stress Interviews.Interviewers consistently help you to get the answer.Bar raiser is the one where you should focus more as if Bar raiser feels you are not better than 50& of existing employees then he can reject you & all other interviews stand null & void.

    Try to find more relevant interviewing experience of candidates on Internet as questions & no. of Interview rounds vary for experienced proffesional & a fresher.
  • General Tips

    Be Confident
  • Key Skills Tested



    Good Understanding of Algorithms

    Good at solving puzzle
    Average Communication Skills
  • Books

    Data Structure and Algorithm Made Easy - Karumanchi Narasimha
  • Websites

    geeksforgeeks.org
Photo of sunset

Abhishek Mittal

CSE Developer

Year Of Graduation : 2015

  • Round 1 Written Test

    Experience :

    The online round had 4 programming based questions and was conducted on hacker-earth. The questions asked are:

    Q.1) Given two strings, check if they are anagram of each other.

    Q.2) You are given 2 numbers, no1 & no2. Reverse both no1 & no2, add them up and take the reverse of resultant number. Output the final resultant number.

    e.g. no1 = 12

    no2 = 36

    Output = Reverse(Reverse(12)+Reverse(36)) = Reverse(21+63) = Reverse(84) = 42

    Q.3) You are given a matrix of size mXn consisting only of 0 & 1's.

    The number of 1's in the any row of matrix is equivalent to row index of that matrix. All 1's occur at the start of matrix and thereafter trailing 0's follow. We have to find the total number of 1's in sub-matrix of size rXc .
    The 1-1 index pattern is followed i.e. first row and col is index as 1,1

    e.g.   
    Given: 3 5

    From the given matrix, we can conclude that matrix would look like

    Index 1 2 3 4 5

    1 1 0 0 0 0

    2 1 1 0 0 0

    3 1 1 1 0 0

    Now, for Input 3,2 , we will have sub-matrix as

    Index 1 2

    1 1 0

    2 1 1

    3 1 1

    Total number of 1's in sub-matrix = (1)+(1+1)+(1+1) = 5

    Q.4) For any given string, we have to find total maximum cost for processing the string. Sadly, I don't exact remember how the given cost was being calculated.
  • Round 3 Technical Interview

    Experience :

    Interview Round I

    1. Determine whether a given array can be partitioned into two subsets such that the sum of elements in both subsets is same?
    http://www.geeksforgeeks.org/dynamic-programming-set-18-partition-problem/

    2.)a. Write a function to check whether two given strings are anagrams of each other or not?
    A string is anagram of another string if it contains same characters, only the order of characters can be different. For example, “abcd” and “dabc” are anagram of each other.

    http://www.geeksforgeeks.org/check-whether-two-strings-are-anagram-of-each-other/

    b). Then modified it, Now i have to print all the pairs of strings which are anagrams of each other from a given set of 1 lakh strings?
    Note:-For this part whether you give an exact solution or not does not matter, the thing which matter is the way you approach the solution what methods you adopt to reduce complexity or to eliminate useless comparison among strings or any different data structure for it.

    Interview Round II (50 min)

    1.) What did you do in your website project(minor 1)? What part of it was implemented by you and how did you implemented it?(This discussion lasted for 15 min)

    2.) How will you clone a binary tree in which every node has three pointers(leftchild*,rightchild*,random*) random pointer points to any random node of the binary tree and can even point to NULL ?

    http://www.geeksforgeeks.org/clone-binary-tree-random-pointers/

    3.)Write a function to convert number into words ?

    eg- for 101 you have to give "one hundred and one" as output

    4.)Given a rope of length n meters, cut the rope in different parts of integer lengths in a way that maximizes product of lengths of all the parts?

    http://www.geeksforgeeks.org/dynamic-programming-set-36-cut-a-rope-to-maximize-product/

    Now DBMS

    5.)Write a SQL query to find the second highest employee on the basis of their salary?

    As I did my internship in RDBMS

    6.)Benefits of Indexing in SQL table?How does it help in making a search query faster?How will you implement it?Difference between clustered and non clustered indexing?