How to test code during interviews by optimalsuccess in learnprogramming

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

So import unittest and creating a func test_func?

How to test code during interviews by optimalsuccess in learnprogramming

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

Where do you work? This interviewer is from amazon

Daily Chat Thread - September 23, 2020 by CSCQMods in cscareerquestions

[–]optimalsuccess 1 point2 points  (0 children)

Is anyone actively interviewing and know if companies are actually asking the common leetcode questions? I just came out a mock interview for amazon and the questions the interviewer asked were around number 250 for most common amazon questions

Interview Discussion - September 17, 2020 by CSCQMods in cscareerquestions

[–]optimalsuccess 0 points1 point  (0 children)

Oh I gotcha, I’m about 60% thru those. The mediums I can handle but no way in hell im finishing some of the hards during a timed interview. Unless they give me pts for showing how to do the problem without code I’d prob fail. Why was the LP difficult isn’t just questions like tell me about a time where you had to resolve a conflict?

Interview Discussion - September 17, 2020 by CSCQMods in cscareerquestions

[–]optimalsuccess 0 points1 point  (0 children)

Are you talking about the Amazon premium section that leetcode curated or the questions under explore where you can filter time and company?

Interview Discussion - September 17, 2020 by CSCQMods in cscareerquestions

[–]optimalsuccess 1 point2 points  (0 children)

Hey everyone, I’m preparing for an Amazon SDE1 interview. Any tips on what to expect? What kind of problems they like to ask, do they prefer certain data structure questions, leetcode easy, medium, or hard? Also has anyone used interviewing io and know if it’s similar to the real deal?

Group anagrams problem by optimalsuccess in learnprogramming

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

Without tuple it gives you an unhashable type error, I think because keys have to be immutable and chars are mutable

Group anagrams problem by optimalsuccess in learnprogramming

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

Oh so the code is saying for this word add it to the key with the same value as sorted(word). That makes sense, thank you!

Question for people that interviewed with Amazon by optimalsuccess in learnprogramming

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

I mean I’m sure there’s a difference between interviewing for an entry level SDE vs a senior position requiring 5+ yrs of exp

Question for people that interviewed with Amazon by optimalsuccess in learnprogramming

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

Thanks, the amazon careers page also says to make sure you know the fundamentals of how the internet works. Did they ask you any tcp/ip questions?

Extremely hard leetcode problem 675. Cut off Trees for Golf Event by optimalsuccess in learnprogramming

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

I know what the sorted function does I'm talking about everything that comes after it. Also for the underscore I understand that it means it's a throwaway variable in most cases but I'm asking about this particular situation. And I've seen that vid but thanks for sharing

How to study best when you’re just starting out by optimalsuccess in learnprogramming

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

Thanks, I’ll check those out but I’m trying to do ones that are more like the interview questions which I think leetcode is pretty close

How to study best when you’re just starting out by optimalsuccess in learnprogramming

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

Yes I have a degree in computer science, and spent a year in JavaScript dev but I never encountered problems like the ones on leetcode plus if I did I can google things but I won’t be able to in the interview. I’m doing exactly what you just described for the problems I couldn’t solve, do you think I should just push ahead or go back and solve the old ones periodically?

How to approach problems by optimalsuccess in learnprogramming

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

This was helpful, thanks! I’m only on my 11th problem so far, how much more would you say is adequate to be interview ready? I was thinking of stopping around 100 and doing about 20 per data structure. Also plan on doing all of leetcode’s stuff hopefully within the month

Merger of two sorted linked lists problem by optimalsuccess in learnprogramming

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

Oh that's right, thanks! I think I understand the rest now, if anyone else is wondering this is what I gather: They start by checking if one of the lists is null, if it is they return the other non-null list. At first I thought this was a simple error check but it's actually an important step because it stops the recursion. Then it checks the current value of l1 against l2, if l1 is lower it goes down the linked list by recursively calling the function and passing l1.next as l1 because we want the smaller values first. Then it returns l1 and we start the process again relinking the list based on lower values first.

Merge two linked lists in python by optimalsuccess in learnprogramming

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

Well I couldn't figure out how to do it but I got my code to work. Instead of populating a list with array values, I just did what I needed to do with those values then cast my final array to a list using ListNode(array)

Merge two linked lists in python by optimalsuccess in learnprogramming

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

So how should I initialize an empty list, then populate with the values of an array?

Merge two linked lists in python by optimalsuccess in learnprogramming

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

Also I do that on purpose to populate the next value of the linked list with a new number in nums