#!process Amazon final

1 messages · Page 1 of 1 (latest)

brazen radish
#

what happened king? was it the LP or LC or interviewer RNG

muted depot
#

LC

#

Wanted k most frequent strings but in lexicographical order

#

I didn’t give optimal solution

brazen radish
#

did interviewer give hints to optimal

muted depot
#

I gave O(n log n) but wanted O(n log k)

fast prairie
#

Did he seem unsatisfied

#

No hints?

muted depot
#

Yeah he gave me a lot of hints to try to get the optimal solution

fast prairie
#

But u didn’t get it?

muted depot
#

No I didn’t implement in time

#

He basically told me what to do at the end

fast prairie
#

U might be fine

#

Tbh

muted depot
#

He basically told me what to do at the end

fast prairie
#

How’d behavioral go

brazen radish
#

nah you might be fine bro

muted depot
#

I think it went fine

#

Standard behavioral

fast prairie
#

I think that’s offer tbh

muted depot
#

How

#

I wasn’t able to give the optimal solution

fast prairie
#

Bc you still solved the problem

#

I don’t think they care abt that tbh

muted depot
#

He wasn’t satisfied

compact abyss
#

Heaps?

muted depot
#

Not at all

fast prairie
#

Uh

muted depot
#

Yeah heaps

fast prairie
#

Then idk

compact abyss
#

Did you use heaps

fast prairie
#

How’d u know he wasn’t satisfied

muted depot
#

Yeah I used heaps

#

Cuz he kept trying to get me to do the optimal solution

compact abyss
#

Ah

fast prairie
#

Did bro want quick select or some shit

muted depot
#

And I just couldn’t get it

#

No he wanted O(n log k)

#

I did O(n log n)

fast prairie
#

What’s that solution

muted depot
#

Used min heap, pop if new most frequent comes up

compact abyss
#

Quick select wouldn't be log

compact abyss
#

And then sort right?

muted depot
#

Idk it’s not looking good for me

#

Yeah

compact abyss
#

Isn't that n log k

#

Use heaps

muted depot
#

Idk

compact abyss
#

And then sort output

muted depot
#

Yeah I should’ve done that

compact abyss
#

Cause output is bounded to length k

muted depot
#

I should’ve done that

#

I didn’t

compact abyss
#

So it would've been nlog k

#

Oh did you not?

muted depot
#

No

compact abyss
#

Ah

muted depot
#

I gave n log n

compact abyss
#

Ah

muted depot
#

So I’m cooked

compact abyss
#

Damn a one liner difference too

brazen radish
#

good luck man

muted depot
#

The problem was that I thought of heaping everything

compact abyss
#

Ahh

fast prairie
#

Bro is not cooked

muted depot
#

And then getting the k most frequent

fast prairie
#

If you’re cooked I’m baked

#

I got to optimal but needed hints

compact abyss
#

Yea heap part is n log k

muted depot
#

But that’s O(n) he was like it’s not O(n)

compact abyss
#

Sorting output would be k log k

muted depot
fast prairie
#

And i went in the wrong direction at first

compact abyss
#

If k << n then yea n log k final complexity

fast prairie
#

Yeah my dude straight told me what optimal algo was

muted depot
#

I ran out of time

#

Did u get the offer?

fast prairie
#

Still waiting

#

2/10 vo

muted depot
#

I’m just fucked

fast prairie
#

Nah

#

Just wait

muted depot
#

U got optimal

#

I didn’t

fast prairie
#

At the end, but bro had to help

#

I also made a wrong solution at first, like not even non optimal but just wrong

#

He pointed it out then asked if I knew a specific algo

#

Then I said yeah and wrote a new solution

strange berry
muted depot
fast prairie
#

🇺🇸 on top

strange berry
#

one of my friends did behavioural a few weeks ago and he said they asked him about his projects instead of standard behavioural

#

in canada tho

#

i also have amazon final coming up

compact abyss
#

Eiehter way u shud be fine

strange berry
#

can i introduce projects that were not on my resume when applying? 😭

compact obsidian
compact obsidian
#

thought it was k log n

brazen radish
#

n because u pass through the entire list of n elements

compact obsidian
#

I was thinking

#

Counter(words)

#

max heap with the tuples or whatever

#

then pop k times

lapis zephyr
#

Thats still NLogN

#

For maxheap heapify

compact obsidian
#

heapify can get O(n)

lapis zephyr
brazen radish
#

this is what leetcode said for my code

#

class Solution:
def topKFrequent(self, words: List[str], k: int) -> List[str]:
word_count = defaultdict(int)

    #Intialize all words into frequency dictionary
    for word in words:
        word_count[word] += 1

    #Make a heap that sorts the words primarily by frequency and breaks ties lexicographically
    heap = [(-count, word) for word, count in word_count.items()]
    heapq.heapify(heap)

    result = []
    #Return k top elements from the heap
    for _ in range(k):
        result.append(heapq.heappop(heap)[1])

    return result
#

my code ^

compact obsidian
# lapis zephyr Uhm not sure if thays the case then ig no issues but i think its nlogn

This video explains the build heap algorithm with example dry run.In this problem, given an array, we are required to build a heap.I have shown all the observations and intuition needed for solving the problem.I have shown all the prerequisite concepts required to solve the problem as well using examples.We can use the heapify algorithm to do th...

▶ Play video
lapis zephyr
#

I said the same thing in my zon interview, and the interviewer grilled me asking thtere are no comparative sorting algos that take less than nlogn

compact obsidian
compact obsidian
obtuse folio
#

dont wanna be a downer but i got optimal, nearly coded it up in time but not fully and get rej so....

whole barn
muted garnet
#

I feel like you still have a chance

#

I did bad on lp and still got offer

fast prairie
#

I feel like if you did bad on lp and still got an offer you didn’t do as bad as you think

muted garnet
fast prairie
#

@warm niche @broken herald @wicked drift

fast prairie
#

To make him say that

wicked drift
#

bro what did you say

fast prairie
#

Getting an offer from that is kinda crazy

wicked drift
#

we need the story

fast prairie
#

Hell nah if this mf got an offer I better

fast prairie
warm niche
#

@broken herald inspiration

broken herald
#

Im ngmi

#

Deadass

fast prairie
#

Lmfao

#

Same

#

This mf out here

muted garnet
#

honesty maybe bc he saw I handle it well

fast prairie
#

This is crazy work

warm niche
#

mipmaster speech when he gets zon offer will be legendary

broken herald
#

Im actually probably cooked

fast prairie
#

Nah tell us what u said

broken herald
#

Like ive been coming to terms w that all day

#

Im ngmi to zon i dont think

muted garnet
#

it was literally like tell us a time when you under a time crunch

#

so I said I had to quickly finish my software engineering project the day before the code review or something

#

lowkey standard idk what went wrong

#

maybe it was a test to see if I would crack under pressure

wicked drift
#

nah youre not telling us something

warm niche
#

ye

wicked drift
#

how did that make him unconfortable

warm niche
#

whats going on

fast prairie
#

Bro probably said he finished ON his software engineering project

#

Quickly

muted garnet
#

That’s literally it

#

I think he thought i procrastinated or something

#

But it was more like a bug

brazen radish
#

bro was this you

muted garnet
#

Last minute thag we had to fix

brazen radish
#

i cant tell since ur gmi now

muted garnet
#

Yeah lol

#

J was joking

brazen radish
fast prairie
#

“Yeah in my interview I talked about the alternate use cases for bananas “

muted garnet
#

Im just trying to give my boi some hope

brazen radish
#

how tf was ur interviewer uncomfortable from ur story of finishing work the day before

brazen radish
muted garnet
#

idk believe what you wanna believe

brazen radish
#

congrats on offer eitherways dawg

muted garnet
#

love the pfp btw

#

ayankoji goat

brazen radish
#

im emulating you until I get offer

#

I had an LP prepared of me stabbing prime driver until you corrected your story