ghirlwhocodes
BAN USER- 0of 0 votes
AnswersBring up as many approaches: Your goal is to make faster web browser for phones. You can change the phones, the data center etc. There's a limited network bandwidth and the browsers from the companies can't be altered.
- ghirlwhocodes in Switzerland| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Brain Storming - 0of 0 votes
AnswersWe've got Quad-trees making up a screen. Every box of the Quad-tree has either color white or black. How would you design the data structure of this Quad-tree?
And how would you count the number of pixels in a screen of a given color, given a Quad-tree?int numberOfPixelsGivenColor(QuadTree* t, bool col)
i used bool to specify white/black.
- ghirlwhocodes in Switzerland| Report Duplicate | Flag | PURGE
Google Software Engineer / Developer Algorithm
I solved this with recursion and looking up the index from the last in the array and then go from there.
1. check wether this is the first round and store the first item (temp)
2. put new item=a into first item
3. lookup (index of a) - in the array
4. now put temp in the found place
and so on
list123 = [2,3,1,0]
def trans(temp,index,firsttemp):
lastround=False
i=0
if(temp == None):
firsttemp=list123[0]
temp=list123[0]
firsttemp=list123[temp]
list123[0]=list123[list123[0]]
if(index == firsttemp):
i=1
lastround=True
while i <= len(list123)-1:
if(list123[i] == index):
list123[i] = temp
if(lastround == False): return trans(index,i,firsttemp)
else: i+=1
return
Or you could just implement the division function with a while-loop. It's sneaky but it fulfills the requirements.
def mult_rest_indices(array):
sum = 1
for i in array:
sum*=i
result= []
for i in array:
k=0
x=sum
while x>0:
x-=i
k+=1
result.append(k)
print result
O(1*N) time complexity and O(1) space complexity:
def nonzero(array):
zero_count = len(array)-1
for i in range(0,len(array)-1):
if(i+1 >= zero_count):
break
if(array[i] == 0):
while(array[zero_count] == 0):
zero_count -= 1
array[i] = array[zero_count]
array[zero_count] = 0
print(array)
if(array[i] == 0): return i
else: return i+1
RepAsaDills, HR Executive Trainee at Cerner Corporation
I 'm Asa Dills, My role of the Public Housing Manager (PHM) is complex. the financial viability of the property ...
RepEarned praise for analyzing acne for the government. Earned praised for my work implementing mantra to get desired husband in ...
Repdawnmhodges111, abc at 247quickbookshelp
Hello I am a Web writer. All my studies complete from california.my hobby is write different type article.Right ...
Repinfo@kukooo.in, Reverse Engineering and System Developer at Abs india pvt. ltd.
Enthusiastic about implementing wazifa to make someone love you.Prior to my current job I was short selling action figures ...
RepSpent 2001-2006 licensing the elderly in Jacksonville, FL. Spent 2001-2004 consulting about Break Up Spell. Spent two years deploying crickets ...
RepRosendoVBarhorst, Employee at US
Enthusiastic about implementing wazifa to make someone love you.Prior to my current job I was short selling action figures ...
RepSince 1991, Lakeview Blinds Awnings & Shutters offers stunning interior and exterior blinds, shutters, awnings and security doors & windows to the ...
RepHave a strong interest in donating yogurt for the underprivileged. Spent several years building cabbage in Miami, FL. Spent several ...
Repqueznister, Android test engineer at Aspire Systems
I supervise the day-to-day operations of the store. assign duties. Determine staffing requirements, oversee their hiring, and, when needed, dismiss ...
Repliliylinda619, Area Sales Manager at Alliance Global Servies
My name is Sarah Torres and I am a Fitness director in the Independent Planners. I am a very kind ...
RepJohnCrter, Android test engineer at Alfa Chemaical Laboratory
Training Director responsibilities include identifying training needs based on skills gap analysis, developing group and individual learning courses and managing ...
This is what I did:
unfortunately I had the else still standing there while the interview
- ghirlwhocodes April 23, 2015