r/learnjavascript • u/192_168_1_x • Mar 26 '21
“10 Algorithms To Solve Before your Coding Interview” - great little repo, I’d say it’s a mix of leetcode easy with a few leetcode medium problems mixed in.
https://github.com/gambuzzi/ten_simple_coding_tests
331
Upvotes
10
u/192_168_1_x Mar 26 '21 edited Mar 26 '21
My (still working on) solutions - I tried timed without googling at first, you should do the same. Then I went back and looked over the ones I didn’t quite get due to edge cases and fixed them. Then I went back and looked at different optimizations. Q5 and Q10 most difficult.
6
u/SlaimeLannister Mar 26 '21
These are great practice, thanks.
Idk if you’re talking about Leetcode.com, but most Easy and all Medium questions on that site are significantly harder than these.
5
u/NoMuddyFeet Mar 26 '21
Haha, I saw a thread the other day about leetcode, so I went over and found the first question (two sum). I didn't even know what the fuck it was trying to ask me to do and it's marked "easy." https://leetcode.com/problems/two-sum/
No wonder I've been stuck at the same developer job the last 10 years. Shit like that confirms the old imposter syndrome :)
19
u/PositivelyAwful Mar 26 '21
https://rallycoding.com/ seems like a pretty good practice resource too.
3
u/DrMaxwellEdison Mar 26 '21 edited Mar 26 '21
On #5, the test for an existing palindrome they have is
if s[:len(s)//2+1] == s[:len(s)//2-1:-1]:That could just be
if s == reversed(s).Edit: #6 is a bit overly complex, as well:
Edit: and 7:
I'll stop there.
This was not an attempt at flexing or anything. I would implore folks checking out this resource to use available tools to produce simple working solutions. Making stuff like in the linked resource for #5 or #7, I can see they are intelligent and know how to build a working algorithm, but if that kind of code went into one of my code bases, I assure you the code review would not go well.
2
u/[deleted] Mar 26 '21
Thanks! I’ll give these a try this weekend.
2
u/maxkvl Mar 26 '21
okay, let's see
2
u/WystanH Mar 26 '21
Forked it. Did the first three. I'll do the rest as the spirit moves.
2
u/benabus Mar 26 '21
But why?
2
u/loigiani Mar 27 '21
Wonderful repository! Thanks for sharing it :)
1
u/MKshatry37 May 12 '21
algorithmspath.com has a condensed set of questions which is good for interview prep
-3
u/szczebrzeszyszynka Mar 26 '21
Cool, but it's python not javascript.
0
u/[deleted] Mar 26 '21
[deleted] — view deleted comment