Better HN
topnewbestaskshowjobs
Log inSign up

qls

1 karma · joined Dec 30, 2018 (7y ago) · 2 submissions

Submissions

comment 7y ago · link · parent

Good to see an actual change vs. SWEs that suck at LeetCode-style questions complain about these algorithmic questions...

It's ironic considering how MSFT pioneered the original brain teasers/problem solving questions.

comment 7y ago · link · parent

This is a pretty standard linked list question (called cycle detection) – one of the easiest questions on LeetCode. You can use the two-pointer method to just detect if there's a cycle. If you want to find the node that the cycle starts at, you can just walk the slow pointer from the slow/fast meeting point and a pointer to the head of the list 1 step at a time until they both meet (there's a simple explanation for this that I won't bother writing out).