#!process amazon final

1 messages · Page 1 of 1 (latest)

torpid kindle
#

when did u do the OA

#

and get the OA

zealous sonnet
#

late Nov, did it early dec, final offer dec 31, scheduled 8th, final 15th

torpid kindle
#

gl

sand trellis
#

how did the technical go?

foggy roost
#

tagged?

zealous sonnet
#

top k elements

vestal moss
#

For US nongrad?

zealous sonnet
#

us intern

next yoke
zealous sonnet
#

na i fucked up

#

used a maxheap instead of a minheap interviwer pointed that out

iron siren
#

arent you supposed to use a max heap for that

#

what were the behaviorals

#

i have mine in 2 hours

zealous sonnet
#

minheap

#

is more efficient

zealous sonnet
iron siren
#

Wait it doesnt make sense. if you use min heap it is O(n log k) and max heap is O(n + k log n)

#

if k is similar in size to n. both approaches pretty much equal the same time complexity

#

but when k is smaller than n. Max heap is still better because k log n is way better than n log k to the point that it gets dominated by n. so doesnt that mean you are comparing n log k to n

#

where max heap is n and wouldnt that be better

#

it doesnt matter i think both approaches are really similar time complexity i think you got it in the bag

deep robin
# iron siren Wait it doesnt make sense. if you use min heap it is O(n log k) and max heap is ...

Min heap is more efficient. Let’s say you wanted to get the top 2 elements. We don’t ever need our heap to have more 2 elements at any time. So if I were to add a 3rd element it’s best to pop whatever is at the top of the heap immediately because it would never fit in within the answer. Because remember the top elements are stored at the bottom of the min heap and the lesser elements are stored at the top.

rose estuary
stiff veldt
#

idk not sure

plush echo
#

bruh i got exact same question for my final today @2pm ct

zealous sonnet