Google | Onsite | London
Anonymous User
3809

Today I scheduled 4 onsite interviews with google. At first one interviewer did not join and when I asked my recruiter She rescheduled it for the next day.

The second interview was googliness and the interviewer asked me standard questions and everything went well.

third one was technical and He ask me problem like this:
given a string s which contains only curly braces and questions was what is the minimum number of operations to become it valid expression and return corrected string. There are three operations:
insert { or } in any position
delete { or } in any position
flip any position so { change by } or vice versa.
I solved it using a stack in linear time and space complexity and the follow-up question was if I could solve it without extra space. my answer was NO

fourth one was so weird because limitation which told me interviewer was very big and I am not sure that it's possible to solve it in linear or logarithmic time:
given N, K and array A length of N and contains non-negative integers. for example N = 5, K = 2, A = [4, 8, 1, 10, 2]. K is initial work capability which means that you can work K days, when you work i-th day your capability decreases by 1 and you get reward A[i], when you skip day your current capability increases by 1. you start at 0 and the question was what is the maximum total reward you can get.
In this example, the answer is 22 because you work 0 and 1 day, after that your capability will become 0. After that you skipp day 2 and capability becomes 1 and you work day 3 and you will get 10 reward, in total 4+8+10=22 reward and it's the maximum you can achieve.

If anyone knows a problem like this please share a link or solution.

P.S. in the fourth interview was weird because the interviewer's camera was off and I think he did not follow me and asked me problems which were unknown by himself. Is it normal?

I am waiting for an interview which missed by tomorrow and I'll share what will be feedback.

UPDATE: (21/07/2022)
I just had last interview and problem was following:

You are given a course prerequisites list in the form {(a,b),(c,d)...}. A semester is a unit where you can take one or multiple courses. To take a course in a semester, you must complete all the prerequisite courses of that course. You need to find minimum number of semesters required to complete all the courses of the curriculum.
(a,b) -> course a is prerequisite to take course b.
Example: Given (1,2) (1,5) (5,2) (2,3) (2,4) (4,6) (5,6) the answer is 5./Which means you need can complete the curriculum in 5 semesters.

I solved it using BFD in O(n+m) time and O(n) space complexity where n is number of courses and m is number of prerequisite pairs, but I spent all time for thinking and I'm not sure that it wasn't warmup question and He was going to ask another more difficult question

UPDATE: (25/07/2022)
I received an email from the recruiter that my feedback was overall good but it requires final revision for a final decision. Currently, the business is reviewing its demand for the year 2022 and once he will have additional information will inform me. as it seems there is a hiring freeze at Google

Comments (25)