Friday, August 31, 2012

Google Interview Questions: Product Marketing Manager


  • Why do you want to join Google?
  • What do you know about Google’s product and technology?
  • If you are Product Manager for Google’s Adwords, how do you plan to market this?
  • What would you say during an AdWords or AdSense product seminar?
  • Who are Google’s competitors, and how does Google compete with them?
  • Have you ever used Google’s products? Gmail?
  • What’s a creative way of marketing Google’s brand name and product?
  • If you are the product marketing manager for Google’s Gmail product, how do you plan to market it so as to achieve 100 million customers in 6 months?
  • How much money you think Google makes daily from Gmail ads?
  • Name a piece of technology you’ve read about recently. Now tell me your own creative execution for an ad for that product.
  • Say an advertiser makes $0.10 every time someone clicks on their ad. Only 20% of people who visit the site click on their ad. How many people need to visit the site for the advertiser to make $20?
  • Estimate the number of students who are college seniors, attend four-year schools, and graduate with a job in the United States every year.

Monday, August 20, 2012

Amazon Interview question

Amazon interview questions:

Given a Binary Search Tree, write a program to print the kth smallest element without using any static/global variable. You can?t pass the value k to any function also.


What are the 4 basics of OOP?


Define Data Abstraction. What is its importance?


Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 2 numbers. Find the missing numbers.


Given an array of size n. It contains numbers in the range 1 to n. Find the numbers which aren?t present.


Given a string,find the first un-repeated character in it? Give some test cases


You are given a dictionary of all valid words. You have the following 3 operations permitted on a word: delete a character, insert a character, replace a character. Now given two words - word1 and word2 - find the minimum number of steps required to convert word1 to word2. (one operation counts as 1 step.)


Given a cube of size n*n*n (i.e made up of n^3 smaller cubes), find the number of smaller cubes on the surface. Extend this to k-dimension.


What is a C array and illustrate the how is it different from a list.


What is the time and space complexities of merge sort and when is it preferred over quick sort?


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.


Given n red balls and m blue balls and some containers, how would you distribute those balls among the containers such that the probability of picking a red ball is maximized, assuming that the user randomly chooses a container and then randomly picks a ball from that.


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.


Given an array of size n, containing every element from 1 to n+1, except one. Find the missing element.


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same


Explain polymorphism. Provide an example.


Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)


You are given some denominations of coins in an array (int denom[])and infinite supply of all of them. Given an amount (int amount), find the minimum number of coins required to get the exact amount. What is the method called?


Given an array of size n. It contains numbers in the range 1 to n. Each number is present at least once except for 1 number. Find the missing number.
 

Amazon Interview Question


Given an N arrays of size K each.. each of these K elements in the N arrays are sorted, each of these N*K elements are unique. Choose a single element from each of the N arrays, from the chosen subset of N elements. Subtract the minimum and maximum element. Now, this difference should be least possible Minimum.. Hope the problem is clear :) :)
Sample:
N=3, K=3

N=1 : 6, 16, 67
N=2 : 11,17,68
N=3 : 10, 15, 100
here if 16, 17, 15 are chosen.. we get the minimum difference as 17-15=2.

Amazon Interview question

A random link list is a linked list where every node contains 2 links, one like a normal node which points to the next node. The other link points to a random node in the list, even itself. You are to write a function to perform a deep copy of this random link list.

Amazon Telephonic interview


Amazon Interview Round 2

The second round was also telephonic. It went for almost 1.5 hours though scheduled for one hour. The main reason for that i think is that i was solving questions and each time i was asked to re-look at the solution I used to improve it further.

Question 1: Shuffle pack of cards
Solution 1: It is one of the most common questions that are being asked in Amazon (Though I came to know this only after the interview:-D). I started with using Sets again but the complexity turned out to be very bad. I assumed that there is a random function with time complexity O(1) and I call this random function to get values from 1...52. Once i get that random function i will add that value in a SET. So in end I will have all the numbers from 1...52 in a random fashion. The catch in my solution was that if the random function returns number x, m times than for each number we will call this function m times and for 52 numbers it will be (m power 52). This is huge. I tried giving another solution but was no better. In the end he moved to next question. Check out here for solution.

Question 2: Count number of lines, characters and words in a file (Given that we don’t have much access to flashy java methods like readline, String methods like indexOf etc.)
Solution 2: The constraint given above simply means that one has to read character by character. I started with a basic program of reading character by character and passing that character to switch statement and doing some logic when ever i got ' ' , '\t', '\n','\r' . But the problem with this solution was that whenever i used to get some odd input like empty file, a file with just '\n' or a file with just a space then i used to patch my earlier solution. Then as i was giving solutions to problems i was asked if I could store some "state". I tokk that lead and provided another solution: -

Store a "state" variable. i.e. when ever a NON- special character (i.e. character apart from ‘ ‘ , ‘\n’ , ‘\r’, ‘\t’ , EOF comes then make the state 0. Whenever a special character comes make state 1. So whenever we go from state 0 to 1. Increase word count. Whenever we get \n or EOF we increase line count. And each time we increase character count.
After this solution no clarification was asked for.

Question 3: Write USE case for Auction model where you have a seller, an item and a buyer.
Solution: This was more generic design question and was just asked to write use-case. Not seq diagram etc.

Learning points 1: Have a nice grip on time complexity. They will make you calculate for each of the solutions you give.
Learning points 2: Concentrate real hard for that 1.5 hours and if you are not clear of the problem then don't hesitate in asking it again.
Learning points 3: You will be asked to write proper code.(even you will be asked to communicate the same through phone)
Learning points 4: The questions will be very generic and never specific to some language.
Learning point 5: Used a variety of test cases to check one's solution before presenting the same to interviewer.

Saturday, August 18, 2012

Amazon Interview questions


Interviewed in Bangalore (India) (Jun 2012 - took 1+ week)

Recruiter reached me with a schedule in a weekend for f2f interview. I think around 20 candidates were there. Had 4 rounds of technical discussions in a day. Each took 45minutes to 1hour. Mostly targeted with 2 major questions per round. If you totally mess up in one round, don't worry you might get another round as a chance.
Think in broad way. Avoid brute-force approach and give the best solution u think in the beginning itself. If you think about multiple efficient solutions explain all of them briefly. And explain the complexities (time/space).
Practice writing code in a paper. Interviewers will need it for reference and they'll take notes during your interview (they might be typing while you explain). You can ask them to stop it if it disturbs you. Its easy if you practice data structures and algorithms.

Interview Questions

You have a list of sentences/words. How to find out the sub list that consists of a specific prefix?
Ex:
input: prefix="he", list = ["hello", "world", "hello world", "hey dude", "galaxy"....]
output: ["hello", "hello world", "hey dude"]
Imagine a sequence like this: a, b, c...z, aa, ab, ac...zz, aaa, aab, aac.... aax, aaz, aba, abc... (Its same as excel column names).
Given an integer (n), generate n-th string from the above sequence.
Ps: Don't generate the full list of sequence till n. It'll be definitely bad approach :)
Find the intersection of two array of integers.
Design a system and API that should support 50 instances of custom designed Queue. Basically the question is about how you'll make use the given block of memory, to achieve the above requirement.
How would you design a "recommended products for you" module of amazon.com. Design a zoo.
Find whether the strings in a file are anagrams
Write a program to check whether a binary tree is a binary search tree

Negotiation Details

I got the package that I asked :)

Other Details

I got the interview through a Recruiter and the interview consisted of Phone Interview1:1 Interview,Skills TestPersonality Test and Background Check.

Amazon Interview Experience

My resume was given to Amazon by a search firm. I got a call from Amazon Chennai office Recruiter and was told about the job profile and the interview rounds. I had two phone rounds, first with the Sr.Manager-HR, based at Hyderabad office, to which the position would report. This interview happened as per schedule, except for 15 mins delay. Lots of situation based questions and team issues handling, managing a team, mix of FTEs and Contractors, How would you rate a campus, planning skills etc. I got instant call from Chennai HR of Amazon after my first phone interview that I will have one more phone interview, next day at 11.00 am. Next day, I did not get any call till 11.25 am and then I mailed the Amazon Chennai Recruiter, who checked with the interviewer and came back after 2 hours that I will have a call in the evening as the interviewer got busy with some urgency. This call was also situation based but as this position was a replacement for her position, she was a realistic interviewer. Again, mostly campus experience based questions, planning, team management. This was the most engaging interview and I realised, I spoke to someone, well cultured, who respects candidates and was aware of corporate image of Amazon. I got feedback from Chennai Recruiter and was asked to visit Amazon, Hyderabad and Chennai offices in next 2 days; schedule was sent that had plans and details of interviewers, title, location, interview time, all details to perfection. This plan had even details of final interview at Amazon, Bangalore as well with Head of HR and GM- Operations.