How many problems u solved bro???
Yeah saw your questions in that thread. BTW thanks.
I had solved 4 problems complete and 5th partially.
Thank you 
I also gave the interview.
He asked me three questions
- count the number of bits required to store it.
- Find the number of distinct words that can be made from DUPLICATES.
- Given a positive number n ( 1<=n<=10^9). Find the number of x that satisfies the following equation: x +s(x) + s(s(x)) =n. Where x is a positive integer and s(x) is the sum of digits of x.
How did you solved the last question?
Seriously bro, 3rd one’s tough.
My guess: Max possible s(x)=81, Max possible s(s(x))=16. Now bruteforce within these constraints
Digit DP I guess. But I couldn’t have come up with a Digit DP solution in a 30 min interview.
I wouldn’t know, never solved a digit DP myself, but I’ve read that is of the type - find the number of numbers or sum of numbers or sum of digits or something else in range L to R, L and R are huge numbers.
But I’ve also read in some book that digit DP is never asked in interviews
Same problems was asked to me.
I tell hie Brute force solutions for the last problem.
But he was kept saying tell me optimised solutions.
Then he gave me hint about range of s(X) and also corrected my code at one point.
Are there any chances of rejection if I was not able to think problem 3 and solved above 2 in max 5 min??
It totally depends on the interviewer. He just has to say Yes or No. Most of them are friendly and questions are easy but for a few of them, the questions were of moderate level. So in the end, it’s up to the interviewer. Good Luck, buddy.
Had my interview on 23rd.
Q1-Given an array A find all pair (i,j) i < j such that A[i]*A[j]>A[i]+A[j]. Solve this in linear time and const space.
Q2-Given 2 strings find if one is subsequence of other or not?
I have not got my result till now.I have visited my dashboard but there is only mention that the result will be announced on 22nd oct. Is there any body else who has not got the result
My friend solved 2 question and got personal interview mail. but I have not any information regarding my result.I solved 3 questions
Is there anyone who also has not got any result??
I got confused a bit at start of the interview due to some technical faults which was occuring … but later I answered every question correctly as per to my knowledge … will it affect my interview ??
Depends totally on who is asking.
wouldn’t be surprised if a Google interviewer asks it. Nevertheless, it’s more efficient to just traverse over the range of s(x) then to use Digit DP(even if the problem is solvable using DP, its still an overkill).
I gave my interview today at 11 am. Let me share with you my experience.
it started with an introduction.
then he asked me 2 basic mathematical questions and 1 programming question.
question 1: Find the minimum number of bits required to write a number N in the base x system?
Answer: \left \lfloor log_{x}(N) \right \rfloor + 1
question 2: Find the number of permutations that can be formed ‘DUPLICATES’ while all vowels must be together at first place of all permutations?
Answer: \ 6! \ .\ 4! (taking all 4 vowels together will become a single unit and now total units = 7 and we have 7 slots for these 7 units but first slot is booked by vowels then we have only 6 slot to play with, so 6! for these 6 slots and 4! for arranging vowels.
Coding Question: You are given an NxN grid and this grid can have rocks and the remaining part is empty. Now a person wants to throw a laser ray from the bottom row to a wall on the right of the grid. There is a condition that you can throw a laser ray up in a column. So you can put mirrors(tilted at 45 degrees) at an empty cell to rotate laser to the right side. And one more thing is that a laser can not pass through the rock. So Find all the locations in the grid where you can out the mirror that allows you to throw a laser ray to the wall on the right side.
Answer : First I told bruteforce solution ( O(\N^3)), then he told me to optimize it with a hint. And told me to implement the same( O(\N^2)). I implemented and got the correct answer.
Then he told me that your interview was quite good and he will send good feedback to InterviewBit.
I hope it will help. Thank you…
plz explain your approach for 3rd question
For first question, traverse from right to left and keep a count of numbers greater than 1 and then for each element >1 add the count till there to the answer…?
How had you approached this question? And were there any hints from the interviewer?