this post was submitted on 27 Oct 2024
199 points (98.5% liked)

Ask Lemmy

26701 readers
2183 users here now

A Fediverse community for open-ended, thought provoking questions

Please don't post about US Politics.


Rules: (interactive)


1) Be nice and; have funDoxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them


2) All posts must end with a '?'This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?


3) No spamPlease do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.


4) NSFW is okay, within reasonJust remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either !asklemmyafterdark@lemmy.world or !asklemmynsfw@lemmynsfw.com. NSFW comments should be restricted to posts tagged [NSFW].


5) This is not a support community.
It is not a place for 'how do I?', type questions. If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email info@lemmy.world. For other questions check our partnered communities list, or use the search function.


Reminder: The terms of service apply here too.

Partnered Communities:

Tech Support

No Stupid Questions

You Should Know

Reddit

Jokes

Ask Ouija


Logo design credit goes to: tubbadu


founded 1 year ago
MODERATORS
 

What are your worst interviews you've done? I'm currently going through them myself and want to hear what others are like. Dijkstras algorithm on the whiteboard? Binary Search? My personal favorite "I don't see anything wrong with your architecture, but I'm not a fan of X language/framework so I have to call that out"

Let me hear them!

(Non programmers too please jump in with your horrid interviews, I'm just very fed up with tech screens)

you are viewing a single comment's thread
view the rest of the comments
[–] scrubbles@poptalk.scrubbles.tech 21 points 1 week ago (2 children)

To kick us off, mine from this week that I wrote down in another thread. In 60 minutes take an adjacency matrix as an input, good old int[][], and return all of the disjointed groups, and their group sizes in descending order.

[–] kambusha@sh.itjust.works 13 points 1 week ago (1 children)
[–] eskimofry@lemmy.world 8 points 1 week ago (2 children)

No you just start by marking all nodes as unvisited and perform a search from a random starting node. you store the current bfs set of vertices in a sorted datastructure. Repeat until there are no more unvisited nodes.

Bingo. For each node if it's 0 continue if it's 1 then bfs to get everything. Store that group temporarily and mark which nodes you've seen. For the remaining nodes check if they are 1 and you have not seen it and continue. O(n log n) I believe, since you still iterate over everything and check

[–] kambusha@sh.itjust.works 2 points 1 week ago

Thanks friend!

[–] GissaMittJobb@lemmy.ml 3 points 1 week ago (1 children)

I think this is basically testing:

  1. If you have been practicing your leetcoding recently, and
  2. If you're decent at leetcoding under pressure

Correct! I don't like it, but gotta play the game if you want to make the cash