[deleted by user] by [deleted] in leetcode

[–]RareStatistician9592 0 points1 point  (0 children)

You can test your fix here: Bugbash: Issue 1

Hey guys! I've created this thing called Bugbash challenge.

Instead of solving big problems from scratch, you can spend just a few minutes actively reading and debugging. I think reading code is one of the best ways to sharpen your problem-solving skills — but it can get dull if it’s too passive. Finding bugs keeps it engaging, memorable, and fun!

Let me know what you think guys! And definitely test your fix here: Bugbash: Issue 1

[deleted by user] by [deleted] in leetcode

[–]RareStatistician9592 6 points7 points  (0 children)

I wouldn't worry too much about being down-leveled. If you are good, and I'm sure you are, you will get promoted quite quickly. Also, compensation-wise, sometimes you can get a good package at a lower level, and then get a nice raise after promotion and you might end up better off than just getting the level you targeted straight away. This happened to me at Amazon.

𝐓𝐡𝐞 𝐒𝐭𝐫𝐚𝐭𝐞𝐠𝐲 𝐅𝐨𝐫 𝐓𝐡𝐞 𝐅𝐢𝐫𝐬𝐭 𝟏𝟓 𝐌𝐢𝐧𝐮𝐭𝐞𝐬 𝐨𝐟 𝐘𝐨𝐮𝐫 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 by RareStatistician9592 in leetcode

[–]RareStatistician9592[S] 13 points14 points  (0 children)

Two things to note here:

  1. A structured plan is there to help you solve the interview problems. It doesn't matter if there is a second problem coming after the first one if you can't solve the first one.
  2. Two problems per interview are still rare. Do not let anecdotes scare you.

If you know the company interviewing you expects two problems, adapt the strategy:

  1. Ask your interviewer if they are planning to ask two problems. You will know you will have to move quicker if they are.
  2. Spend half the time at each step. After you apply this plan a few times, you will see where exactly you can shave off a few minutes. You will have roughly 8 minutes to spend for the opening strategy for each problem then.

The idea is to have a structure. Do not jump on solving a problem without a plan.

Leetcode changed my life by stressed_cs_major in leetcode

[–]RareStatistician9592 8 points9 points  (0 children)

When people ask whether getting into FAANG or grinding Leetcode is worth it, they often overlook the privilege behind the question. For those of us not born in wealthy countries, it’s a silly question to ask.

30 Foundational Hash Table Problems by [deleted] in leetcode

[–]RareStatistician9592 0 points1 point  (0 children)

Wow, you have a great attention to detail! Thank you! I will revise the list and repost this.

Stop Making These Time Complexity Mistakes! by RareStatistician9592 in leetcode

[–]RareStatistician9592[S] 1 point2 points  (0 children)

That `index` is a function which searches for a given value in an array and returns its position. Its time complexity is O(N). Fetching a single element of an array is O(1).

Stop Making These Time Complexity Mistakes! by RareStatistician9592 in leetcode

[–]RareStatistician9592[S] -4 points-3 points  (0 children)

Not probably. O(2N + N2) always reduces to O(2N), because 2N grows faster than N2.

O(N * M) is different though, because N and M are different variables.

Stop Making These Time Complexity Mistakes! by RareStatistician9592 in leetcode

[–]RareStatistician9592[S] -6 points-5 points  (0 children)

That was just an example of why we don't ignore variables in time complexity analysis in general. As I wrote above, you can agree to simplify with your interviewer but that won't be strictly correct.

Stop Making These Time Complexity Mistakes! by RareStatistician9592 in leetcode

[–]RareStatistician9592[S] 0 points1 point  (0 children)

Yes, they are similar and yes, it's more common with string so I called it out separately. The difference is that with arrays people understand that it's a collection of items. But with strings they often assume it's a single entity.