- 0 Answers Conversion of Java to C++
How can I convert Java source code into C/C++?- suhara July 13, 2018
| Flag | PURGE
- 0 Answers Running time for a video question
Hi all,- iosdevresume July 13, 2018
On one of the video Gayle presents the following problem -
"Given p number of people with their birth year and their death year, return the year with the maximum population".
At the same video she also states the best possible solution is O(P+Y) s.t. P is the number of peoples and Y is the length of the array of the years from the minimal birth year to the maximal death year, Can't the optimal solution be O(P)?
Here's how -
Generally she achieved a solution of O(P+Y) since she iterate through all the peoples in the input getting the minimal year and the maximal year that is O(P) which gives her Y the total number of years all the people was living in, then she instantiate an array on the size of Y that is O(Y), then she goes through every person in the input, add +1 for birth and -1 for deaths so that is O(P) and lastly she goes through all the array of years summing up the number of +1\-1 to that point which is giving her the number of people living in that year so again O(Y), all together it's O(P+Y+P+Y) => O(P+Y)
However - using a TreeMap (a hashmap that uses an inner tree to sort the dataset) we can achieve O(P), here's how -
traverse the people input and for every person p on the people list add +1 for the person birth year and -1 for the person death year that will end up with a tree with total (MAX) of 2*p nodes and traversing the tree to every year can yield that same result as traversing an array on the size of Y (however using a tree with 2p nodes is much memory efficient than using an array with potentially a-lot of unused 0's) while traversing the tree we can also keep int max which is the year with the max alive people in it.
Isn't that a better solution? or am I missing something?
| Flag | PURGE
- 0 Answers Implement a rate-limiter-like iterator and how to improve the space complexity
Given a <Word, TimeStamp> pair data type iterator as input. Implement an iterator based on it which can ignore the item if the same word has occurred in the past 10 seconds.- sun2gz July 05, 2018
My implementation is to use a HashMap to memorize the word and its latest timestamp + 10s. For each new item, it will be checked against the HashMap to see if it has duplicated word occurred in the past 10s.
The interviewer asked me how to improve the space complexity if the string value varieties are infinite. He mentioned some boundary stuff.
Could anyone share some thoughts?
| Flag | PURGE
- 0 Answers Linked List addition with reversal, Google Interview
Given 2 Linked Lists containing single digit as data representing number with most significant digit at head and least significant at the tail return the addition of both.- niklabh811 June 21, 2018
The solution must not reverse the given linked lists and do it in O(n) time complexity and constant space complexity(Recursive solution will take O(n) space because of stack).
9 -> 3 -> 2 -> 2 ->
3 -> 4 -> 8 -> 3 ->
1 -> 2 -> 8 -> 0 -> 5
| Flag | PURGE
- 0 Answers Question
Take as input N, a number. Take N more inputs and store that in an array.- Sagarshvn June 16, 2018
a. Write a recursive function which counts the number of ways the array could be split in two groups, so that the sum of items in both groups is equal. Each number in the array must belong to one of the two groups. Print the value returned.
b. Write a recursive function which keeps track of ways an array could be split in two groups, so that the sum of items in both groups is equal. Each number in the array must belong to one of the two groups. Return type of function should be void. Print the two groups, each time you find a successful split.
Take as input N, a number. Take N more inputs and store that in an array.
| Flag | PURGE
- 0 Answers Register dump
Using tools like memtool one can read the memory addresses and dump it on screen. But, mapping these bits into their meaning as per SOC's register definition is a tedious and error prone task.- psk1801 May 23, 2018
So, i am working on developing a tool that can take the memtool output and then map it to the SOC register bits.
I have SOC register header file and memtool as inputs. The challenging part is parsing through the SOC register header file some way and may be create an intermediate output which helps in mapping the data.
Please suggest what would be best approach to follow here, when it comes to parsing through the SOC register header file.
| Flag | PURGE
- 0 Answers Will HR check my exact diploma title and fake internships in my resume?
I started bachelor of computer science, but it was too challenging,my GPA went down, it was very low and I was failing to meet min.GPA requirements. So I switched to Math, graduated with "3 y general degree in Math". Though I started as Computer science student and completed some CS courses, my last year was pure math courses.- erjcan April 08, 2018
I have been working as front-end web dev for 1.5y.
I want to work in a tech giant company(FB, google etc)
Also, I did not do any internships during my bachelor's. Can I add in my resume that I had some 1-2 internships in startups?
Will they run some check?
1)check exactly diploma title
2)check my internships?
| Flag | PURGE
- 0 Answers GROSSLY UNPROFESSIONAL company GOOGLE
It has been a long overdue review – but better to expose such things late than never.- Interviewer February 07, 2018
It would be shocking for any reader to know the reality of Google’s (Hyderabad India office) fraud interview process, and the gross unprofessionalism prevailing there.
It gives a telltale picture of what sort of people Google has started recruiting and promoting to senior roles nowadays.
A bit about myself – 11+ years in the software industry, 7 years as a technical interviewer, 8 years in software QA automation, 3 years as a Technical Lead/Architect with full hands on coding work.
Here are the details – read till the end with the dates to get a clear idea of Google’s unprofessionalism.
7th July 2017 – I got a message on LinkedIn from a person S****bh G***a, who introduced himself as a recruiter working at Google, and claimed that they are looking for an experienced Test Engineer to own and manage the Testing process of an upcoming product at Hyderabad location.
I asked him to email the details to my email id from his google.com email id. He obliged, and then we had a long telephonic conversation regarding the details of the role.
Right at the onset – I made it very clear that I would consider any further discussion if and only if you have a role in Hyderabad – as relocation is simply out of question for me.
He immediately made it clear that we are discussing about Hyderabad location only.
He further went on to disclose that the internal codename of this product is “Next Billion Users”. (Later, I came to know that this product was the TEZ payments app).
He scheduled a Google Hangouts call, with a clear instruction that it will be of exactly 45 minutes.
18th July 2017 – The call was scheduled for 2230-2315 (late night) my local time.
Here comes the first glimpse of unprofessionalism.
The interviewer dude turns up for interview 10 minutes late.
He initially asked me a few things from my resume, and then asked me to give a test-plan for Google Maps.
I did goof up a bit but managed to list down reasonable list of scenarios.
Now, with just 12 minutes remaining (i.e. at 2303), he gave me a coding problem.
[No, I was not asked to sign any NDA or any other document – hence I am disclosing the problem statements].
Given two strings - S1 and S2.
Arrange the characters of S1 in same alphabetical order as the characters of S2.
If a character of S1 is not present in S2 - such characters should come at the end of the result string, but make sure to retain the order of such characters
Case sensitivity is irrelevant
e.g. S1 = "Google", S2 = "dog"
Output = "ooggle"
e.g. S1 = "abcdedadf", S2 = "cae"
Output = "caaebdddf"
By the time he explained the problem and I made sense of the problem, there were barely 7-8 minutes remaining.
I somehow completed the code, detected a bug in my code – and was about to fix it – then the clock struck 2315, and the Mr Latecomer simply got up from his chair and ran away saying that he has a meeting – thus offering me just 35 minutes in total because His Highness came 10 minutes late.
When the interviewer turns up 10 minutes late, isn’t he/she supposed to give 10 extra minutes for the interview? This is a basic minimal courtesy – which I know because I myself have been an interviewer since past 7+ years.
Next day – the recruiter S****bh G***a called me and gave me a long lecture saying that “your code was not efficient, Google pays lots of importance to efficiency and scalability etc etc”.
I bluntly told him that the interviewer was 10 minutes late, and I got barely 8 minutes to code – is it fair? Can the interviewer himself solve such problems in 8 minutes without any bugs, that too on a Google Doc?
S****bh G***a fell silent for a while, and then offered me 2 more back-to-back Google Hangouts interviews with a different set of interviewers. I asked for some time for more preparation to which he agreed.
31st July 2017 – Again, the call was scheduled for 2230-2315 (late night) my local time.
Yet another unprofessionalism awaited me.
I kept waiting till 2310, and nobody turned up for the call. I dropped an email to the recruiters and went to sleep, and received a sheepish Sorry as the answer.
1st August 2017 – Again, the call was scheduled for 2230-2315 (late night) my local time.
For a change, this lady (based in London) turned up bang on time.
She asked me lot of questions about my past testing experiences.
She was in-particular interested when I talked about how I had applied Pairwise Testing technique in a past testing assignment in a previous company.
She gave me a coding question – with 15 minutes of time remaining.
Given any uppercase string. Report the starting index at which any valid permutation of ABCDEF starts. If not found, then report -1.
Possible permutations of ABCDEF are ABCDFE, BCDAFE, FEDCAB etc (a total of 6! = 720 permutations)
e.g. S = "ACDBFE", Output = "0"
S = "ACXBFE", Output = "-1"
S = "ACXBFEDABCFE", Output = "4"
I managed to code it reasonably – she seemed to be satisfied with my solution, and asked me all testcases for the problem. The interview apparently went well.
2nd August 2017 – Again, the call was scheduled for 2230-2315 (late night) my local time.
And, yet another sample of unprofessionalism from Google.
Again a delay – at 2245 – I received a call from an International unknown number on my mobile phone – it was the Interviewer – he said that he has not been provided the Google Hangouts link!!!!
Fortunately he had the link of the shared Google Doc, through which I sent him the link to the Google Hangouts call, and then the interview started.
Fortunately – this gentleman (based in US) gave me full 45 minutes for my interview.
His coding problems were very easy.
Convert a natural number to base-3 equivalent
He was happy when I asked clarifying question as to how big the number can be – he said stick to integers, and I managed to code it within 5 minutes, as it was an easy problem.
He asked for testcases – seemed happy with my test data – and moved to next question.
Find the sum of all nodes stored in a binary tree.
I gave him a choice – recursive code or iterative?
He himself asked me to ignore integer overflows etc.
He asked for recursive solution – which I coded within minutes, and again – he asked for testcases. He seemed satisfied with my solution, and then he repeated an earlier problem.
The next question was – Design a test plan for Google Maps – yes the same problem – which was asked in my first round of telephonic interview.
This time – I was well prepared for such problems for all commonly used Google products – hence I answered this time in a systematic way – classifying the scenarios, prioritizing them, discussed the test automation strategy etc.
He seemed to be happy and the interview ended.
10+ days passed by – during this period – I followed up twice on phone, only to hear from S****bh G***a that – “we are still waiting for feedback from one of the 2 interviewers, and the other one has given positive feedback” (10+ days to write an interview feedback – this is what we call as Scalability and Efficiency at Google – right?)
Finally, one fine day – the recruiter S****bh G***a informed me that they are inviting me for Onsite Interview at Google’s Hyderabad office.
He informed that it would be a 2-step process – first day will be 3 rounds of technical interviews, and if I do well there – then they would invite me once more for an interaction with someone from the Developer Team.
The first onsite was scheduled for 21st August 2017.
11:00 AM – Round 1 – The interviewer was a Software Test Engineer, and focused only on Testing. He asked a generic question – when do you declare testing as complete.
He asked me to take the example of Gmail, and then we had a discussion about various scenarios and prioritization for 20+ minutes, using whiteboard.
He asked me to list out all testcases for a function
performOperation(input1, operator, input2), where operator is any binary mathematical operator, and input1 and input 2 are any numeric values.
We had a detailed discussion on whiteboard for 30+ minutes for this problem as I put up a lot of clarifying questions before listing out my testcases – and he seemed very happy with my testcases – and acknowledged that he has seen very few people who can think upto this level of testcases.
The interview ended, and after a breather for 10 minutes, I was ushered into a conference room – for a Google Hangouts video call with a guy located in Bangalore.
12:00 PM – Round 2 – This person was the previous interviewer’s Boss. He was yawning and seemed sleepy, tired and disinterested outright – definitely not a professional behavior by any standards – that too for a person at a technical manager level.
He too started with the same problem statement – when do you declare testing as complete.
I had to tell him that I have answered this question just now in previous interview.
Clear proof of lack of coordination between interviewers – I seriously wonder haven’t these morons been trained that feedback from one interview is supposed to be circulated to remaining interviewers!!!
He gave me a coding problem then.
Input is an integer array A
Return an array B such that B[i] = product of all elements of A except A[i]
I coded it, started to describe testcases – then immediately I discovered a bug in my code.
I fixed it – all this while the interviewer was yawning – then I did a dry run on Google Doc, and explained him that my code is correct.
Trust me – this Mr Sleepy had a hard time in understanding that my code had time complexity of O(N).
After this – the recruiter took me for lunch at their cafeteria at around 1300.
14:00 – Round 3 – This person was interested purely in my design and coding – and gave a good problem.
Data structure for Task Dependency
A task can start only after all its pre-requisites are done
He asked me to design the data structure properly, and then code the methods addNewTask and getExecutionSequence for this.
It was a reasonably lengthy one – the discussion and analysis took some 25+ minutes, and then I was asked to code it – which I did.
I figured out a bug in my code again – to which the interviewer said that its ok – its hard to code on Google Doc – and seemed to be satisfied with my code.
Again, 3+ weeks of silence – and on following up with S****bh G***a, I was told each time that there are more candidates – we will let you know.
I kept waiting patiently.
Finally, on 5 September 2017 – I got a call from him saying that they want me to come to their office once more for one more round of Google Hangouts call with one of their Software Development Engineers.
7th September 2017 – I reached their office again, and had a call with a guy based in Singapore, who was probably working on the TEZ app.
It was not exactly an interview – more of a discussion around people management, resource prioritization, test planning, release management etc.
NOW – DEAFENINGLY DEAD SILENCE FOR 2 MONTHS – yes, 2 MONTHS.
Whenever I would follow up with S****bh G***a, his answer would be – 1 week, 2 week etc – with no definite answer.
7th November 2017 – Finally, my patience gave up, and I sent a nasty message to S****bh G***a over Google Chat, blasting out Google for this unprofessional behavior of keeping dead silence and not even being able to say Yes/No after 7 rounds of interviews.
I explicitly mentioned – is this the Scalability and Efficiency which is followed at Google ?
He called me – said Sorry etc, and then I clearly told him – if you have selected someone else – then be a man and speak up, and finish off the drama – to which he replied that – You are the only candidate for this position as of now, the team was BUSY with TEZ app release – hence the delay.
By the way, during these 2 months – the TEZ app was released. I started using it – and emailed with full details and screenshots to S****bh G***a about BUG in their app – that it was being flagged as a VIRUS by 360 Security Antivirus running on my Vivo V5 (Android) phone.
Needless to say – NO ACKNOWLEDGEMENT.
Finally, MORE DRAMA.
S****bh G***a scheduled a Lunch Meeting for 17th November 2017 at Google’s Hyderabad office, and also asked me to provide a list of REFERENCES.
I immediately provided him the list of references, and later came to know on contacting the persons referred that NONE of them received any questionnaire from Google asking about me.
The meeting was with their Engineering Director J** K**a, and one more person.
Over lunch, J** K**a asked me about my past experiences, most challenging testing assignments etc. I did make a point to mention about that bug as well – he seemed to be shocked that their team had missed such a basic test scenario.
Then, again a 1 hour chat with another person – similar pattern of talk, and there as well I mentioned about this bug – and he too thanked me for bringing it out, and said that he would get this fixed.
Both the lunch interviewers explicitly said that I am a great fit for multiple roles in TEZ team, as well as many other teams in Hyderabad – and not just as a Software Test Engineer, but also as a Developer.
NOW, the REAL MELODRAMA.
Some 10 days later – I received a call from S****bh G***a saying that they have got approval from their Hiring Committee – and made me 3 offers – Sweden, US and Bangalore.
When I reminded him in stern words, that I had attended all this interview cycle only for Hyderabad – then he said that – The Hyderabad is still 60:40 about you, but we are giving you offers for any of these 3 locations.
So after 7 rounds of interviews – you are still not decided whether a candidate is fit for your team or not – GREAT – Scalability and Efficiency – right?
I sternly told him that I have a well settled family and an expecting wife – hence relocation is ruled out – either Hyderabad or nothing.
7 days later - S****bh G***a again called me and this time the LIAR said – there is one guy based in US, who is very keen to hire you, and he would work out an opportunity based in Hyderabad for you.
5th December 2017 – another Google Hangouts Video call with another Engineering Manager Ja****h S***h B***a. He too offered me a position in US, and clearly said that Hyderabad is NOT AT ALL a strategically important location for Google right now – and hence NO HIRING is going on there.
Read again – Hyderabad is NOT AT ALL a strategically important location for Google right now – and hence NO HIRING is going on there.
I clearly told him that I am not going to relocate – hence its over.
Finally, I sent an emailed to S****bh G***a clearly blasting him out that I am not interested in joining an UNPROFESSIONAL company who does not know whether they have a vacancy or not, and spends 5 months and still stays undecided whether to hire or not.
Thinking of joining Google – think again !!
| Flag | PURGE
- 0 Answers Error in 6th Edition
Maybe you fixed this already in 7th.- timcrall January 09, 2018
In 6th edition, question 4.11, the question only specifies a binary tree but the answer assumes a binary search tree. Which is exactly a thing you told us to look out for. So I was.
EDIT: Although this doesn't really seem to affect the answer.
Also, for the love of all things holy, invest in some spam-blocking on the forums!
| Flag | PURGE
- 0 Answers String Transformation
You are given 2 Strings A and B. You have to transform A to become B.- anuj January 07, 2018
Following are the type of transformation possible:
1. pick an alphabet and replace all occurrences of this alphabet in the string by the next alphabet in the sequence[a,b,c,d----y,z]. Note that the next alphabet for z is a. The whole operation counts as one operation with Cost C is given as input.
2.pick an alphabet and replace all occurrences of this alphabet in the string by the previous alphabet in the sequence[a,b,c,d----y,z]. Note that the next alphabet for a is z. The whole operation counts as one operation with Cost D is given as input.
You have to return the minimum cost to transform A to B. if it's not possible return -1
Answer : 4
we need two C operations "ab" -->"bb"-->"cc"
Note that the last step of converting all b to c counts as one operation
| Flag | PURGE
- 0 Answers Didn't receive any offer
Hi,- stan.alexandru.dan November 30, 2017
I've held the interview process at Amazon for a position in one of the european offices.
So I got contacted by a recruiter, I did an online test, afterwards a phone interview, after that on-premise interviews.
I had 4 on-premise interviews, each a one-on-one with a Software Manager, 2 of them were algorithms, 1 was architecture and another was Software Design.
After 2 weeks I received a call from the recruiter. She told me I've passed the interview process, but there was predicament and I will not be receiving an offer from the center I applied to, and I will receive an offer from another european office on the same day.
3 months have passed, I haven't received any offer and the recruiter stopped responding, I have sent several mails and still no reply.
I still don't know what happened, my resumee wasn't that good, was my application lost in the process.
I don't know if it's worth trying again, if things like this happen. I know I've spent a full month, preparing, not sleeping well. I've never felt prepared for the interviews, also I wasn't outstanding on them, going through that again seems a bit much.
What do you guys think, should I try again, has anyone else had the same experience?
| Flag | PURGE
- 0 Answers Developing Java game
creating a RESTful service using which players can play a simple game described- stallapp November 02, 2017
The game should have the following rules:
• The player has an infinite amount of coins.
• The player bets 10 coins to play a normal game round.
• In any round (free or normal), the player has a 30% chance of winning back 20 coins.
• In any round (free or normal), the player also has a 10% chance of triggering a free round where
the player does not have to pay for bet. The free round works in the same way as a normal round except
it costs 0 coins. The free round should follow immediately after the normal round.
• The player can both win coins and free round at the same time.
| Flag | PURGE
- 0 Answers rejected by amazon for no reason
got rejected, I think I did well for all rounds, maybe not behavioral questions. They didn't give any feedback.- ly October 21, 2017
the questions were not hard at all.
one round, I only got asked behavioral questions for 45 mins. really not that much to say
| Flag | PURGE
Open Chat in New Window