Interview Transcript
Digital Avenger: Okay, so before we get started, I just want to ask you one of the questions that sort of helps me calibrate the interview a little bit better. Is that okay with you?
Rocket Broccoli: Yeah, totally.
Digital Avenger: Okay, so one main question, like you have specific interviews lined up at, say, Amazon or Google or something like that? The reason I ask this is because I'm a buy raiser at Amazon. So if you have something lined up at Amazon, I can sort of help you out with the flow of the interview. What it's going to look like? Something like that, yeah.
Rocket Broccoli: So currently I have an interview tomorrow with Google. I have an interview with Amazon on next Friday. It's the full day on site, and then the following Monday I have with meta.
Digital Avenger: Got it. Okay, so Amazon, it's l five, l six.
Rocket Broccoli: I believe it's l five, l six. But it's not really for a specific position, it's more just general. I think they're going to level me during the actual interview.
Digital Avenger: Got it. Okay, so I'll take a few minutes extra at the end to sort of explain to you what the Amazon process would look like. What? I mean, I can't tell you exactly what they're going to ask, but want a general idea of what to expect. Okay.
Rocket Broccoli: Okay, that sounds great.
Digital Avenger: Yeah. Okay, so the flow of the interview is going to be, we'll spend the next 50, 55 minutes solving one or two questions. I'll spend the last five minutes discussing some of the salient feedback. This will be more or less a collaborative interview, so we'll discuss the problem, but if you need me to shut up, just say the word and I will stay silent until you ask me to help.
Rocket Broccoli: Okay, that sounds great.
Digital Avenger: Yeah. One final point before we get started, and this is something you should expect from all three companies. At the very least, you should mention even others. I'll be taking notes in this interview. All that you'll hear is just the sound, like just the sound of my keyboard. But in a number of video interviews, what happens is people see interview looking down or looking at another screen or something like that, and they think that the interview is not sort of paying attention to what they're doing. That's not it. They're just taking notes.
Rocket Broccoli: Okay, gotcha. Yeah, that makes sense.
Digital Avenger: Okay, so let me share the problem. Feel free to ask me any questions, anything you have a doubt, any clarifications you need, anything like that.
Rocket Broccoli: Awesome, sounds good.
Digital Avenger: Yeah. You already selected JavaScript excellent. Can you see it?
Rocket Broccoli: Yes, I can.
Digital Avenger: Go ahead, please.
Rocket Broccoli: All right, so if I'm looking at this kind of, what I'm thinking of when I first see it is being able to use a DF's of some kind. So basically searching through, finding a one, when I see the one, what I'll do is I'll say, okay, let me find all the surrounding nodes and see if I can figure out what shape is going on here. I'll then potentially be able to describe that shape, maybe with an enum or something, and add it to this to some sort of set to keep track uniquely of each type of shape. Now, the first question I'll have here is, are we dealing with all cardinal planes? Like for example, do I care about adjacents or am I only caring about like left, right, up and down?
Digital Avenger: Okay, that's an excellent question. So all adjacents. So diagonals are included. So basically, let me first ask you this.
Rocket Broccoli: Yes.
Digital Avenger: How many total shapes do you think there are? Not unique, just total.
Rocket Broccoli: Gosh, there's going to be. Well, it depends. So a good, a good question I have for that is like do three singles in a row, or that, is that the same as two singles in a row? Does that define a shape? Like what is the specific definition of a shape?
Digital Avenger: Okay, so definition of a shape is any collection of connected ones. That's how we're defining a shape. Let's not worry about unique part. That's why I've asked you total number of shapes.
Rocket Broccoli: Okay? So let's think about this. One, two, three. I mean, there's some permutation or commutate, comp. Combination math here. I'm not sure off the top of my head, but I'm guessing square, triangle l.
Digital Avenger: Okay, so the number of shapes here are three. You see line 1314.
Rocket Broccoli: Oh, okay. Yeah.
Digital Avenger: Fourth column. This is one shape. Okay. These two, one, line 1617, 4th column. This is one shape. Okay?
Rocket Broccoli: Yes.
Digital Avenger: They're not connected because they are surrounded by zero. So they are not connected. That's why they are just one shape. Okay.
Rocket Broccoli: Right.
Digital Avenger: Right again, we are not talking about unique. We are not talking about same, we are just talking about total number. Then we do line 1415, first and second columns. So these three inverted l sort of shape. Okay. This is connected to the line 16, one.
Rocket Broccoli: Right.
Digital Avenger: So these five ones are connected together in a sort of question mark kind of shape.
Rocket Broccoli: Right?
Digital Avenger: So total, there are three shapes because these two ones and these two ones.
Rocket Broccoli: Right.
Digital Avenger: Are congruent. But now let's talk about uniqueness. We define uniqueness by congruency. Congruency is basically, if you overlap two, they fit exactly. No magnification, no reverse of that. No. Nothing. It has to be matched exactly. Nothing left out, nothing rotated. Nothing. Nothing. If it fits exactly as it is, then it's unique.
Rocket Broccoli: That makes sense. Okay. I'm sorry. I was a little confused. I didn't know you meant the number of things in the example. I thought you meant the total number of shapes that could be possible in any grid. I was like, oh, God, how do I calculate that?
Digital Avenger: That's. Okay. That's a question. Yeah.
Rocket Broccoli: Okay. So then, going back to my approach, I'm going to loop through the array. I'm going to find a one. I'm going to get the shape, essentially, and I'm going to find some way to define it. I think probably the best way is to just store the shape in the grid and compare two grids. So, in the case of this, I would essentially. And again, this may not be the most efficient approach, but I think it would be effective in the case where I found this shape. Let's say the one and the one here, what I would store is a zero zero. And again, I think there's definitely a way to optimize this. But I want to start with a path, because I think it will be relatively easy to cut down the scope, storing something along this lines. Now, I think I could probably just store these two numbers or whatever the shape of the ray is, but I think that the looking at it might be a little confusing.
Digital Avenger: Say you store the entire grid. Then what?
Rocket Broccoli: And then I can just lay the. Basically exactly what you said. Lay the grids on top of each other and compare them. And if they're exactly equal, then it's unique.
Digital Avenger: Okay. Then can you paste the grid that you created?
Rocket Broccoli: Yep.
Digital Avenger: Okay, so let's say this is the shape grid that you created for the line. 1314, 4th column shape, right?
Rocket Broccoli: Yeah. I see what you're getting at here.
Digital Avenger: Yeah. So you already understand. I'll just point out they're not going to match, but they're the same shape.
Rocket Broccoli: Sure. Okay. Well, then I think maybe some sort of 2d array, like just the 2d array of the shape itself might be fine. I think that that's probably what I'll end up with. So, really, what I'll be storing at the end of the day will be something more along the lines of just the one one I think that it would be. I want to see. So as I do my DF's, of course, it's recursive I want to make sure that I'm able to store that in an array and pass that through and then make sure that gets added to a set. So I'm pretty sure I have an approach that will work for that.
Digital Avenger: Okay.
Rocket Broccoli: And yeah, I think I have an idea there.
Digital Avenger: Okay, just clarify something for me. What exactly will you store? You said that it's one one. You store this one, one shape. What are you storing this one? Like, it's just, are you storing the number of ones or, or what are you storing?
Rocket Broccoli: In effect, I'm going to be storing basically the orientation of the shape. So in this particular case here, it would be one one. Because looking at this, if I. I'm thinking of it kind of like I would a DF's. If I find the one, I'm going to look up left, down, right, you know all those directions, and the only one I'm going to find is this. And so once I have these two elements grabbed, I can shove them into an array relative to each other. In the case of this question mark here, what I would really be storing for that one, because it's a little bit more of a complicated shape, would be 11011.
Digital Avenger: Okay, so you are creating.
Rocket Broccoli: Sorry, sorry. I think I mistakenly added a couple ones here. So it's one, one one.
Digital Avenger: No, it's fine. It's the right one. So you are creating a 2d array with these kind of things. Okay.
Rocket Broccoli: I have a feeling there's probably something that's a little bit more clever. And I think potentially, as I start it, like, I think getting the basic DF's in place and getting kind of the structure of being able to at least count the number of connected letters. I think that's a decent start. And then from there, I'll be able to start to consider what will this thing actually look like and reason through potentially a better plan. Because at the end of the day, what I want to understand is the orientation of these ones to each other. And while a 2d array can do that, I just have a feeling that there's something a touch better. Maybe even just tracking the way that I'm iterating through the DF's in some way. Like I went up, down, left, right. Okay. Maybe. Maybe something around those lines might allow me to potentially store this more effectively.
Digital Avenger: Okay, makes sense. Yeah. Okay, then let's get started. As you're probably aware, all you have to code is the function and assume you have a 2d array as your input. The only ask for you to return is an integer.
Rocket Broccoli: Sounds great. All right. So I'm just going to get started by defining my function here. I'm going to be taking in a grid and. Yep, that's it. And so what I'm going to go ahead and do here is first I'm going to recognize that I want to loop through the grid normally. And then once I reach an element that's one, that's when I want to perform a Df's. So what I'm going to do is for let x equals zero, x less than grid length, x plus plus. Then I'll do the same for the y's, we'll do y here. And then what we're going to do is we're going to say, hey, if the grid value at Xy is going to be equivalent to. I'm just going to assume they're integers, not strings because I feel like, yeah, that's fine. This right here is where I'm going to go ahead and call my DF's. So I'm going to say DF's and let me actually just define that. So I'll say function DF's and that's going to take in a grid and then a starting point. That way I can use it, I can write my DF's recursively that way very effectively. Then here is where I'll go ahead and do DF's. For now, what I'm going to do is just for the sake of having something I'm going to do, let count equals zero. That way I can at least start counting them and I'll be able to return from here the shapes later. Or potentially I'll pass the set in, I'm not sure. But let's see, we're going to do grid X, Y and we're going to do count plus plus. Also allow us to test it a little effectively to make sure we're only going through this as many times as we want if we want to moving forward, I'm going to clear that out. All right. So for the DF's, the first thing I want to do is I want to ensure that x and Y are valid numbers and I want to ensure that the item at that grid is in fact a one. That way I can use this recursively. So the way I'm going to do that is I'm going to say if x.
Digital Avenger: Aren't we already doing that? That it's a one grid xy is equal to one. You already checked that, didn't you?
Rocket Broccoli: I for sure did, but I think I'm going to use this function recursively. And if I use it recursively, I want to make sure that I'm rechecking it. Sure. Yeah. Maybe it's a little bit of a duplicate. In reality, potentially I could get rid of this, but I think it's a really clear way to do it for now.
Digital Avenger: Yeah, that's fine.
Rocket Broccoli: So we'll say while x is less than zero, or. So if x is less than zero or x is greater than grid length, or we're going to say, let's just say in this particular case, Y is less than zero or x is greater than grid Y is greater than grid X length. Okay. If any of these are true, we know we need to get out of here. This is no longer valid. So for now, we're just going to return again, the part that I'm most interested in is, for now, ensuring that we're able to df's through this array properly. I'll probably end up doing some sort of set magic here or something moving forward, but, yeah. So now what I'm going to go ahead and do is I'm going to ensure that. And again, I'm just going to do this, even though it's a little bit repetitive, makes it quite clear what's happening, and it allows us to use this recursively, which I think will make the logic very clear. So if this and this, that's when we're going to go ahead and do some other work. Or actually, maybe, I think I want to invert this. So, actually, if it's not equal to one, that's another case where I just want to get out of here. Otherwise what I'm going to go ahead and do is I'm going to go in each of the cardinal directions. So north, south, east, west, northeast.
Digital Avenger: Right? Yeah. You can just type any aisle. Yeah, I understand.
Rocket Broccoli: Yeah. For me, I like to. I like to keep it separated so I can make sure that I'm doing everything in the. In the right order here or. Well, not that the order matters, but just that I don't forget one.
Digital Avenger: Yeah.
Rocket Broccoli: And then we'll be able to do Df's and we'll pass in the grid, of course. And then we'll do. So for the north we're going to do x, y plus one. And then for south, y minus one. For east, we're going to do never ever. Okay. Plus one. For west we're going to do minus one. Northeast we'll do. So that'll be plus one. Plus one, I believe. Yeah. Plus one, plus one. Southeast, we'll do plus one, minus one. Northwest, we'll go ahead and do plus one, minus one. And northeast, we'll be able to do. Let's see here. That'll be minus, plus one, minus one. And so that will, at the very least, get us DF's incorrectly. If we get to a negative one, we're getting out of here. If we do that, if we are not inside of the grid, we're getting out of here. Otherwise, actually, what I want to do to make sure that I don't go over the same spaces twice is I'll temporarily replace that, that element in the grid. So what I'll do is I'll say x, y, and for now, just for the sake of ease, I'll just use negative one. Let's say that will make sure that I'm not iterating over the same spot twice, and it will keep the shapes in the grid, but still allow me to DF's properly. I think that should, at the very least, get us counting here. I'm going to grab a sip of water.
Digital Avenger: We don't want to change the grid permanently, so this input is being passed to us as a read only kind of thing. Okay, so temporary change might be okay, but otherwise we don't want to change it.
Rocket Broccoli: Yeah, we can always flip the neg, flip it back to one if we wanted to. Let's think about this. How else? How? Well, okay, then what I could do is I could add a visited set. So I'll just leave this for now, and we can go back as an optimization step to just switch to using a set. Say, yes, I've already iterated over that in this pass or in previous passes, and that way we can do it. But for now, I'll leave this for now, sort of what I'm thinking through now. I think what we have here would properly at least get us the count of each one of the things in the array. Right. But we need to now start considering shapes. So what I think is that we can kind of keep the, I'm thinking this through. Do I have a place where I can draw? I'm thinking if I have a list of all of the directions I've gone, is that enough to say a shape works? No, I don't think so. Because I have one here and one here. What? It's to the right. But if I, for whatever reason, ended up starting here and went here, it may not, it may not be the same.
Digital Avenger: You're traveling from left to right, right. So the starting point in most shapes, you will find the same way. Right?
Rocket Broccoli: Yeah. No, you're right, actually, because, well, so, yeah, you're right. So, because I'm always going left or right. And because when I do my DF's, it's always in the same order. I think. I think what you're saying is totally right. That we can kind of keep a. I don't know what the term would be, but, like a direction list that would tell us. So that would. It would always be the same every time, I think. Yeah, yeah, yeah. I think it would be the same every time.
Digital Avenger: Sorry.
Rocket Broccoli: Say that one more time.
Digital Avenger: Just think through it for a minute.
Rocket Broccoli: Okay, so here we start. Left we go one, two, two. Okay. If I come over here, it's going to be like that. If I come over here, it's going to be like that. I think of another array. Is there any point where I could start at a one and not get the same thing for the shape? Same shape it's angled. No, I think that as long as we're parsing or going through the array in the same consistent way.
Digital Avenger: Right.
Rocket Broccoli: We should get the same consistent shape.
Digital Avenger: Okay, so. Got it. So what we will be storing in, say, let's assume. Let's kill this in this inverted l shape. We'll store right, then down. Right.
Rocket Broccoli: In for this shape here.
Digital Avenger: Yeah, the inverted l shape. Assuming we go right first. I mean, we take all the right down.
Rocket Broccoli: Yep. Mm hmm.
Digital Avenger: Got it. Cool. Just wanted to confirm this.
Rocket Broccoli: Yes.
Digital Avenger: Now let me. I mean, we could quote that out. I could point it out later. But in the spirit of not wanting to waste either of our times, let me ask you to consider assuming. So let's assume the directions in which we are going are up, then right, then down, then left. This. This is the order in which we are actually traversing through directions. Okay. Assuming that if I changed the input to something like this, what do you think would be the direction equivalent of this?
Rocket Broccoli: The direction equivalent of this. This part right here? That would be. Let's just make sure that I get it fully right. Yeah. It's going to be down, then right.
Digital Avenger: Down we jump. We are going in this order. First up, then right, then down, then left. Let's assume this is the order.
Rocket Broccoli: Oh, okay. Let's assume this order. So then, yeah, it would be. It would be right and then down.
Digital Avenger: Yeah. So more or less I could figure out another case based specifically on the case that you have made.
Rocket Broccoli: Sure.
Digital Avenger: Or we could just understand the point I'm trying to make here.
Rocket Broccoli: Yeah.
Digital Avenger: We end up with the same shape direction, but they are not the same shape. Right?
Rocket Broccoli: Right. Yeah. So I guess the TLDr there is that. Right. And down does describe a shape, or, you know, whatever these, these, these coordinates, these directions, they describe a shape, but, uh. Or, or they encode to a shape. But that doesn't mean that every shape has the same directions.
Digital Avenger: Right. They don't uniquely identify a shape.
Rocket Broccoli: Yeah, that makes sense. That makes a lot of sense.
Digital Avenger: Let's talk about your grid example for a minute. I like that idea. Okay, so you initially took the full grid. Let's take the line 18 to 22. Now this grid looks okay.
Rocket Broccoli: Right?
Digital Avenger: Taken the whole grid. First of all, let's, let's actually take a bit of a different grid. Let's first let's just take this. Okay, now we are comparing this grid to the grid below this, correct?
Rocket Broccoli: Yeah.
Digital Avenger: What can we do to make sure the grids line up okay. The shapes are exactly the same. What can we do?
Rocket Broccoli: What I would do is I would find the first instance of one of both of those and kind of start that as the place that we're going to be iterating through potentially with another DF's.
Digital Avenger: Yeah. You're going to start another DF's from there. Sure. But how is that going to change? Sorry. How would that make sure these two bits match up exactly the same?
Rocket Broccoli: So if I go through this array and I find the first one, I end up here. If I go through the array and I find the first one, I end up here.
Digital Avenger: Yeah.
Rocket Broccoli: If I treat this xY as the start of a DF's, and I start this one as the start of the DF's, as I iterate through, I go down. I go down. And we can confirm that if they're going in the same direction and they end at the same time, then they're the same. I mean, I think actually just pulling out programmer logic, I think potentially a BFS might be a proper solution here as well. But I think in this particular case you could utilize the DF's. As long as you were able to track that both were going in the same direction, you could potentially do something more simple. I just think reutilizing the DF's might be easier.
Digital Avenger: Okay, so I understand and it will be a bit of complicated logic, but it will work. One question. So you have to compare all the shapes involved because this is a shape by shape comparison.
Rocket Broccoli: Yes.
Digital Avenger: You take, let's say there are x shapes. You are comparing one shape in each to the other. X minus one shapes something along those lines. That's going to take a hell of a lot of time.
Rocket Broccoli: Absolutely, yes.
Digital Avenger: Change the grid somehow so that one traversal of the grid can tell us without having to do DF's. Let's first match the grids. Can we do anything with the grid? Reposition those lines?
Rocket Broccoli: Yeah, I mean, I think what I would do is I would iterate till I find a one and then stop. Iterate till I find a one and then stop and then continue them together, if that makes sense. I mean, that's still potentially two grids, but I think you can iterate through them at the, like, at the same time. Almost like a two pointer problem.
Digital Avenger: Okay, that's. That's closer. Closer. Let's talk a little bit more about repositioning.
Rocket Broccoli: Yeah, I was thinking. Yeah, sorry to interrupt. I was actually gonna say as the next thing, if you can move the ones to the front, like, you can move this to the start of the array somehow, then you would be able to do the same thing, but just in much shorter period of time.
Digital Avenger: Right. Right. Why can't we move it? And how would we move it?
Rocket Broccoli: Well, maybe as we're iterating through the shape, we. When we create the grid itself, we. We move it. Well, the potential downside there is that if, like, let's say I decide to always start here, if something's to the left of that, it might. It might not work. But that's my first intuition, is what if we can move it at create time somehow? Like what, when we. When we actually instantiate this 2d array and start iterating through and. And checking it?
Digital Avenger: Yeah. So in that case, let's assume, if we take these cases, if we do the approaches suggested, do we even need the rest of the grid?
Rocket Broccoli: No, we just need that. That initial spot.
Digital Avenger: Yeah. So once we have. So we can cut down on a huge chunk of the grid.
Rocket Broccoli: Yes.
Digital Avenger: Based on only what's required here. Right?
Rocket Broccoli: Mm hmm.
Digital Avenger: So let's see if we can do that.
Rocket Broccoli: Okay, so basically. Okay, I think that's. That makes sense. That's kind of what I was considering for my first approach when I. When I was talking here. Maybe I didn't do a good job of kind of explaining, explaining that.
Digital Avenger: But the reframing is the main part there.
Rocket Broccoli: Say that one more time.
Digital Avenger: Sorry. Exactly. That's why, like, I like their approach, but it's. The question was around, and what I was expecting was reframing. You have to. I see the entire one, the entire shape, and then move it. Keeping in mind the very problem you raised yourself, if, let's say the shape is something along these lines, it has to fit like this, right? The shape. Let's say this. I mean, you could also think about how to take care of something that goes beyond the negative. That is something you could take a look at, or you could figure out how to do this. So either approach would work.
Rocket Broccoli: I see. So, like rapid almost. So wrap it to the other side of the array. That seems maybe a little bit overly complicated. Let's think about this. Well, I want to try thinking through what it's going to look like to put these things on a grid as a way to start this. And then from there I'll see if I can reason through a way to transform them from their original, their quote unquote original position to, to it. So let's, let's start by having a way of creating a grid that is the same size. That way we can have something to pass in and start to fill out and then we can again, iterate from there. So, func, create grid. And I'm just going to take in the the original grid. That way we can quickly and easily iterate here. And we'll say const. Grid two is going to be equal to an array. And then we'll say for const. Sorry, let column. I think we could do this with array fill, but I'm just going to do what's simple and fast. So I'm going to say let call equals zero while I is less than. Seems like I can't type here. All right. While I recall is Sngrid length. I'm just going to, for the sake of keeping everything the same, I'm going to do this grid. Sorry, I just got messed up here. And we'll do x plus plus. Okay. And then we'll just for the sake of ease, paste that. Throw a y in here. Throw y in here. X and then y here. Okay, so what we'll essentially do for this is we're just going to fill everything with zeros. So we'll say grid, x, y. And then from there we'll have a grid and we can return it. And that gets us the grid. Now what we can do is when we create a, we found a shape we need to create our temp grid or our copy, I'm just going to call it copy. Is going to be equal to create grid, grid. And then what I'll do is I'll pass this in and I'll say copy. Okay, and so we've got df's grid copy. Copy. Let's update. Our Df's here to handle that properly now copy. And then what we'll do is we'll say copy. Since we know it's going to be the exact same size, we can say copy x, y. Okay, that will update it count. I think we can get rid of that. We get the idea here. And then for now we need, well, we can do a comparison. For now I think what I'll do is I'll just say const. I mean, I wonder if set can handle 2d arrays. I assume not. So I'm just going to say const. Shapes equals this. And for now what I'm going to do is just push. Okay, so what have we done?
Digital Avenger: We created a new grid, added the specific shape to it and pushed it to our overall shapes collection.
Rocket Broccoli: Yes. Now that gets us closer to the solution, but still leaves the couple fundamental problems we ran into, which are if we want to iterate over the whole gray, sorry, the whole grid kind of is hard. Ideally I don't need to put every shape into the array. I can kind of tell if that shape has already existed. So potentially there's some way to do that. So I'm going to just for the sake of me, solve these two problems or write down these two problems, one, potentially adding extra shapes to shapes. All right. And then two, of course, can we optimize shape comparison? And so let's take a look at.
Digital Avenger: This here like they are in tandem. So there are problems one after the other. First, we need to solve the first problem because we have currently not solved it. Like the same shape as we discussed. One, one at the top and one, one at the bottom will give us two copies in the shapes array. So let's first call back.
Rocket Broccoli: Okay, so the first thing we need to do is be able to compare two shapes, comparing 2d arrays. That, it's going to be slow because we have so many things. But you know what, let's go with the brute force solution for now. Let's go with that and we'll just say function compare. Great. Say grid one comma grid. I'm just going to copy this to make it nice and easy. So if grid one x, y equal, equal, equal. Just wrap this in. If. So, if it's equal, we continue. So if it's not equal, we fail it.
Digital Avenger: Two x. Oh, this type of copy comparison, assume sets can do it. So let's not.
Rocket Broccoli: That's can. Oh, great. Okay. No, that makes sense. So then we'll say equals new set and then we can just do shapes, add. That's what we want to do, and that should handle it. What did I do here? Okay, we can just get rid of this. So that's great. I think I. Did I lose some here? Well, it doesn't matter. We're not running code. We can look at that later. So. Now. Okay, well, that's easy. We're potentially adding extra shapes. But, I mean, at the end of the day, this should do it, right? And then can we optimize shape comparison? Well, let's just. Because we're able to just do this.
Digital Avenger: Wait, wait, wait. We haven't actually.
Rocket Broccoli: No, you're right.
Digital Avenger: Yeah.
Rocket Broccoli: Yeah, you're right. I forgot. I completely forgot. Yeah, yeah, yeah. So is there a way for us now to solve, really, that first problem of is, you know, when things are not in the same part of the array, can we move them? So let's. Let's look at this. We have a 2d array, and it has the numbers in it. And now my intuition tells me that I don't need to iterate through the array to find the first one, because originally, the way that I kind of considered doing this was to find the first one to rebuild the shape and then to kind of move it to the front. But that seems ridiculous because I'm already doing the DF's. So is there a way for me to. I guess. What would the term be? Normalize this x and y to the start of the array. What if I chose. I'm just thinking, like, what if I chose some spot in the array to start no matter what? And then, like you said, I could. I could potentially wrap. Wrap around. So just. Just to be clear on what I'm saying here, like, let's say I. We have. Let's just say we have. Yeah. This shape here, this is a great example. My idea is if I decide to always start at index zero zero, then what I would end up with would be this basically just one and then zero, zero, one. Right. That's essentially what I would end up with. If I just always started here and put the shape. Does that kind of make sense?
Digital Avenger: Sorry. Where this last one coming from?
Rocket Broccoli: So here it's. Wait, did I mess this up? Yeah, sorry, sorry, sorry. It should be this. So here, because I've decided to start always at index is zero. Essentially, what happens is this.
Digital Avenger: That one around the rope going back?
Rocket Broccoli: Yeah, no, I see what you're saying. Yeah. So that's what I was planning on doing is if I'm doing a comparison on the Y, basically, my idea is I do Y mod the size of the array or the size of this particular row? And then I'll always end up getting to that. Does that kind of make sense?
Digital Avenger: That makes sense.
Rocket Broccoli: Okay. So let's see if we can make that happen here. So we always need to consider that when we're creating the copy, we start at zero zero like that. That's where I want this to always start. So this is going to be a little silly, maybe a little brute force. I'm just going to do it with the amount of time we got here. And what I'm going to do is inside of here, I'm going to just add a x two, y two. So zero, zero. So this is going to be x two, y two. And I'm always going to start at zero, x two, y two. And then I need to manipulate these relatives still, but they need to always be within the same. So I'm forgetting my math here. Let me remember. So if this is length four, if I do four mod four, that should always equal zero, right? Four mod four is equal to zero. Yeah. So I think that's what I need to do is I need to mod it by the length here. So I'm just going to make that into a quick function, just so I keep it consistent. I'm going to say function, index, wrap, elk, and we'll just take whatever index just to keep it simple. And then a length. Well, let's make sure. Hold on, because. No, that should be okay, actually. Yeah, I think we're good because I was just thinking like mod what? But yeah, anyway, return index mod length and that will get us something here. We may need it. There might be a off by one situation here. I think this seems okay. I'll think about edge cases a little bit as I go, but because I've moved this out, I'll be able to quickly and easily manipulate.
Digital Avenger: Sure, that's fine.
Rocket Broccoli: So then what we're going to do here is we're going to say x. I wish I had built something to make this a little more clean, but hey, what can you do? So we'll say x, y plus one. And essentially what we're going to do is we're going to say, I'm going to do one more thing here, construct row length. Actually, I'm going to do it under here, just so we know that they exist. So I don't have to worry about it. I'm second guessing. So I'm just going to continue. So here, what I'm going to do is say index, wrap HAlc X in this case, I don't think it matters because it does do it, but I'm just going to keep it consistent for all of them. So if there's a bug, it's very clear. Wrap calc. We'll do y plus one and then we need to know. So we'll just come in here and we'll say, what is it? It's going to be just grid length. And then over here, over here, excuse me. We will do grid X length. And that should, I mean, at the end of the day, the grid is square so it doesn't matter. But just a habit. So let's come through here and let's just add this everywhere. Boom, boom, boom. Of course we're going to have to go through and manipulate. This always feels bad. Copy pasting this much code, you know, you should be doing something a little more dry, so to speak.
Digital Avenger: Okay.
Rocket Broccoli: Sela v, as they say. So we're here. Xy. We're here. X plus one. So this is going to be X plus one, y. Just going to do all the Y's first because that's easy. Y plus one, Y. I'm going to miss one for sure. So we have y minus one. We have.
Digital Avenger: I got it. I think you don't need to fix any of these, the code. So let's move on.
Rocket Broccoli: Okay, sure. We got the general idea of this. Okay. So now we have, we have these things. I mean, in reality, if the, if the set handles this, they should all be normalized to be the same because they're all starting in the same point. So if that's the case, then all we really need to do here is return shapes, size.
Digital Avenger: Okay, one thing. You started from x to y to zero. You're doing index wrap calc X grid that length. So this is going to take the index and do a modulo by length.
Rocket Broccoli: Yep.
Digital Avenger: So if it is actually going overboard, then it might actually do what you are saying. But those cases are dependent on x. So if it's passing line 68, then there is no need for wrapping around anyways because X and Y are not passing.
Rocket Broccoli: I see. Yeah. Okay. Actually, give me a second. Maybe I don't understand because X two and y two are going to be slightly different potentially. Or wait, are they? Well, they're going to start at a different place and they're going to move relative. So that. So they're going to move relative. So I. Maybe I'm wrong here, but I don't see how the x and Y relationship. Oh, wait a minute. Are you saying no, I think that since we're doing everything relative, just checking the X and Y up there is okay. And let me tell you what I.
Digital Avenger: Think is the issue. Take the first north. You're at X Y plus one. Okay. Let's remove the index wrap calc for a second. This DF's will go to line 68. Okay. Then it will check for your modulo condition. If X is less than zero, Y plus, I mean X plus plus minus delta or y plus minus delta. If it ever exceeds the length where it has to undergo any actual relevant modulo operation, where the modulo operation will be relevant. Those cases X and Y are also going to face, just as your index wrap calc are facing x and Y will face that in line 68. If any of those actually happen, then this is simply going to return, isn't it?
Rocket Broccoli: I'm not sure, because so if we can assume that it was working before and iterating as it was, then this should work. Because x two and y two are not actually what we're checking against. They're just moving relative of X and Y. So if we look at. I might be wrong here. Let's look. So in this particular situation we were talking about where it's one one one. In this case, when we find this, X is going to be one and y is going to be zero, right? But x two and y two are going to be zero. Both be zero. So when I start iterating through this, what I'm going to end up is here. So this will still iterate through the graph just as we expected. One, two, three, all within its expected operation, never going outside of the bounds of the array. Only x two and y two, which are again just kind of a reflection of x. This will go out of the array.
Digital Avenger: You start at one, that's where your DSS starts. And then at every point you go down. Let's assume you were here. This is where you're starting your DF's. You're not actually there. You start your DF's here. This is your zero. And you put x grid dot length. This is going to be the same as actual x grid length. So if it. Okay, let's start here. Let me put this as zero. Let's take this case, show me how it will work. Line 3031, take this.
Rocket Broccoli: Okay, so in this particular case, let's just desk check it. Yeah. Right.
Digital Avenger: Come to the DSS out and let's see what Xyxy two are.
Rocket Broccoli: Okay, so the first thing that's going to happen is when it starts. X is going to be. X is going to be 01233. Y is going to be 120123. And we're going to start at three. Three. We're going to come into my function. Of course, that all fits within. Of course, we know XY is equal to one. So now what we need to do is convert it and then set it. Right. Now, x two and y two are zero. So if we look at the inverted mirror. So let's copy this and let's change everything to zeros just so we can watch it in real time be built. So the first thing that's going to happen here is one.
Digital Avenger: This is right.
Rocket Broccoli: Yes. Now let's see.
Digital Avenger: North is empty. You go into south.
Rocket Broccoli: Yep. North is empty. We're going south. So we go down here. All right. What is it? It's going to be four. Four, right? Or wait, 0123. Yeah. Four. Four two. Now 340123.
Digital Avenger: And south because. Wait.
Rocket Broccoli: 012-340-1230 yeah. Oh, I think, yeah. So it's not a square away. So. Yeah, you're right. You're absolutely right. It's going to be four three. I just assumed it was square, but yeah. Okay. Now what's going to, what's going to happen here, in my case is it's going to start here. Come down here. Now we just. We determine now it's going to do the same here. Right. So really, what was zero? Zero is now going to become, you.
Digital Avenger: Know, zero one calc, wrap calc. It will take x, which is three modulo.
Rocket Broccoli: Oh, wait, that's it. So you're absolutely right. This is a mistake on my part. I forgot to put x two.
Digital Avenger: Yeah, this is the main check I was looking for. Because we are not using the initial values of x two.
Rocket Broccoli: Yeah, yeah. When we were talking through, you know, when I was starting to edit all this, I was starting, I was starting with getting the addition right. Then I was going to go back and add the things. So because we kind of interrupted that process, I got a little.
Digital Avenger: I understand now.
Rocket Broccoli: Okay, great. Awesome. Love it.
Digital Avenger: So we're 50. So let's just discuss what's the space and time complexity of the solution.
Rocket Broccoli: Okay, that's a great question. So I think it's going to be, well, just starting by ignoring whatever the set operations are. I'm going to pretend those are free. Just mentally here, we're looping through the array. So that's going to be n squared. And then we are doing a DF.
Digital Avenger: Let's assume the grid is om, cross and grid. Okay.
Rocket Broccoli: Yeah. Yeah. Yeah. So it's going to be m times n then, for this, for this part of it, the DF's, I think is login or log Mx. Mn. I'm forgetting for DF's. Exactly. But I think as we iterate through that, it's going to be, you know, what is the worst case? The worst case is we go through everything. So I think it's mn, actually. Not even. Not even log mn. So if we look at that, mn plus mn or mn times mn would be m squared. N squared, I think. Let me make sure that that makes sense. So, mn, worst case, we go through this whole thing, mn, actually, it might just be. I think that this might be doable in just mn. I think this is big o of mn. M times n.
Digital Avenger: Okay.
Rocket Broccoli: When we do this iteration. Well, I'm just thinking when we do this iteration, worst case goes through again. It goes through everything that's mn. So it's, you know, I'm a little thrown off by the DF's because I always forget that, at least right now. But it could. It's either mn or m squared. N squared.
Digital Avenger: Okay. So the basic DF's would be mn, right? Okay. Not log mn. That's a bit of a thing that you should memorize here.
Rocket Broccoli: Yeah, it's a min, right.
Digital Avenger: It's mn because we could end up going through the entire grid. So the best I would like to go about doing this is especially for bfs, DF's, for graph algorithms. This is just me. This is just my tip. You, you can come up your own way. It's perfectly fine. This is just how I like to think about it. Okay.
Rocket Broccoli: Yep.
Digital Avenger: In BFS, BSS, never think about it from the point of view of loops, because if you do, then there is a problem. How many are we doing? We are already in four. In four, which is doing recursive. How do we know how many times recursion goes? Think about it. From points. There are mn points in a grid. How many times do you touch each point?
Rocket Broccoli: Great question. We touch each point under normal circumstances. Well, so I'll tell you how I'm thinking about it. Maybe you can help. Correct me here. I'm thinking we're definitely touching everything once. That's for sure. Here. We're touching everything once. I think when I look at the DF's here, if we are considering this as a worst case, we're potentially touching every point again. So that's why to me, it's mn times mn. That's, that's like the worst case that I can see here.
Digital Avenger: Okay. So what happens is DF's also we generally put you, you are actually doing a grid XY minus one. So even then you would not go here. You would return. So a quick from this is immaterial because then you are not actually going through the function. You're just checking it was minus one. You could put the same check here and get rid of the whole thing. Actually you have put the same check here. So next time you would never go there. If it's zero, you anyways wouldn't go there.
Rocket Broccoli: I see. Okay, so that's like the average case outlook. So the average case outlook then is just mn.
Digital Avenger: Yeah. Our trouble is we have done a create grid.
Rocket Broccoli: Yes. Oh, you're right.
Digital Avenger: So that is a full mn every point, more or less every point. So that requires us to go through a full every beginning of every shape. And you can technically have disconnected shapes to the not exactly equal to mn because then they would be connected. Then you wouldn't do this. But like to the order of mn maybe mn by three, mn by four depending on how you put it out. But yeah. So that would lead us to mn square.
Rocket Broccoli: That makes sense.
Digital Avenger: Okay. We are on time. And what about space? Let's discuss space as well. I like to discuss that.
Rocket Broccoli: Okay. Yeah. I always forget with space calculations, if you include the original grid. If we include the original grid, it's going to be, if we think about it, it'll be just so I can write it out. It's going to be grid. That's one of the things what is.
Digital Avenger: Generally not supposed to be taken. You can mention it, but.
Rocket Broccoli: Okay.
Digital Avenger: Generally.
Rocket Broccoli: Okay. So then we have the shape set, which is potentially, I mean, I think my guess is it would be log event because there's no, there's only or sorry em in because or actually no log of all the potential things would be like k, I guess because we couldn't actually like even if every single space was full, that or you know, basically the worst case for the number of shapes in there is not mn, it's some other value, k. So if we're considering that it's going to be something along these lines where it's the total possible number of shapes that of unique shapes in there, which would be something around k. It wouldn't be Mr. N. Sorry, what was that?
Digital Avenger: Yeah. So it wouldn't be mrn, but what would be the value that it's around? And by the.
Rocket Broccoli: Sorry, I missed that last part. What was that?
Digital Avenger: Okay, two questions. So you started off. Well, but what is k? And, like approximate value or something like any approximations or anything on that. And second is by the log. Why the log? What is the log doing here?
Rocket Broccoli: A log is basically like, okay, so I'll start from the top here. So what is k? I would say it's like n over two or something along those lines. It's like whatever number that you could put inside of this array that is like that. Essentially, it's the number of possible shapes that can go into the grid. That's what I identify. Ks.
Digital Avenger: Okay.
Rocket Broccoli: Which is some value relative to mn.
Digital Avenger: I just related to mn. Yeah, yeah.
Rocket Broccoli: Well, I get. Well, in that case, I guess with. With the way that big o works, then pay would just be mn. Right.
Digital Avenger: Some c times mn, which is equal to mn only. Yeah.
Rocket Broccoli: Yeah. Okay. That makes sense. It's been a while. And then I did the log because it felt like the way that this thing goes, just mentally, the space complexity is logarithmic. Logarithmic. Logarithmic in relationship to mn. So as Mn gets bigger, it doesn't necessarily grow exponentially. It doesn't necessarily grow linearly because I think that the number of shapes that can fit into the grid is not necessarily linear to the size of the grid. And so log just made sense to me mentally for that reason.
Digital Avenger: Okay. Okay. So this is. You are going with the fact that this is log mn. This log k is the number of sets, approximately number of shapes.
Rocket Broccoli: Unique shapes. Right.
Digital Avenger: Ah, okay. Unique shapes.
Rocket Broccoli: Yeah, yeah. I mean, well, because Im in just seems. Excuse me, sorry. Im in seems too big for me in terms of the number of unique shape. It's some relative number of that. And it seems like it could potentially be logged to me. I'm curious about that. That's really interesting.
Digital Avenger: The way we are storing, even I cannot guarantee exactly, because sure, one number of we are creating one, but only storing only a certain amount of shapes. Shapes that don't do so.
Rocket Broccoli: Right.
Digital Avenger: One, two. But. Okay, so we could have. You didn't take these into account. Like a shape of three can have four different variations.
Rocket Broccoli: Right.
Digital Avenger: So it's not like we have one shape of one, one shape of two, one shape of three. In that case, you'll have around n square kind of shapes for total mn of grid. So approximately root mn kind of thing. But we could have two shapes of two, four shapes of three, things like that. So I'm not sure I would still go with some constant of mn, but. Yeah.
Rocket Broccoli: Okay. That makes sense.
Digital Avenger: Yeah.
Rocket Broccoli: I think mn is definitely accurate. It just feels a little high for me. But I guess I'm thinking of it not, you know, stripped as big o is. So, yeah, no constant of mn makes sense. And then the other space complexity, of course, is this overbearing create grid function that is essentially doing mn times mn. Right. So m squared, n squared, or whatever you want to call it. Maybe even potentially more than that. Let me think. So for every single. Well, no, because we're only creating a grid for every shape we match.
Digital Avenger: Yeah, yeah, exactly.
Rocket Broccoli: Yeah, yeah. Originally, like, oh, we're creating a grid every time. But no, that's. That's definitely not the case. So then go ahead.
Digital Avenger: No, that takes time. So it goes in time, but in space, it's the same grid being created again. So space either adds it to shapes or discards it entirely.
Rocket Broccoli: Yeah. So the shapes kind of accounts for that. So, yeah, no, it's a temporary variable. It gets deleted, essentially. So, yeah, that makes sense.
Digital Avenger: Okay. So it's just.
Rocket Broccoli: It's just set then. So that's actually not that bad in terms of space complexity.
Digital Avenger: Yeah, it's not bad. It's not bad at all. Okay, so I'd like to take. So this is number of shapes. So the total complexity, first of all, is not there. This is number of shapes. If we assume are some constant of mn, each shape in itself is taking mn because, you know, we are storing.
Rocket Broccoli: Yeah, no, that makes sense.
Digital Avenger: So it's mn star mn. So total would be mn to the power two.
Rocket Broccoli: Gotcha. Okay. Yeah.
Digital Avenger: So. Okay. We are a little over time, but I would like to take a few minutes, if that's all right with you.
Rocket Broccoli: Yeah, absolutely. Of course. Anything you got for me? I got my little notepad open. I'm ready.
Digital Avenger: Yeah. Okay. So, I mean, I know you have an interview tomorrow, so I'll just stick to the main big things.
Rocket Broccoli: Mm hmm.
Digital Avenger: Because, I mean, it's the specific question, the algorithm, that part, I think I'll put it in the written feedback first thing. So, like, post this interview, I'll be providing written feedback. Please provide some for me as well. Anything you feel I could do. Anything that I could be better. Okay. I'd appreciate it. Now, coming to this. So one thing I'd like to mention is you jumped a little too fast into solving the question into the code. I understand why you're coming that from where you're coming from, and trust me, in a certain perspective, I appreciate that, because people waste a lot of time going over what they think is a solution. And by the time they get to coding, the question is almost done. We don't like, we are out of time. So that's actually a good point. But take just a minute or two more. I'm not asking for a lot.
Rocket Broccoli: Yeah.
Digital Avenger: Thing that you should do, which you did. You asked, but like the first thing that you said was about DSS, then you asked clarifications. The first thing you should do is ask clarification questions even before mentioning a damn thing about what algorithm you would use, what solution you would use first. Ask clarifications.
Rocket Broccoli: Gotcha.
Digital Avenger: So you had some good rough ideas, which is also good. You needed some bit of helps coding wise. Okay, again, so specific feedback, provide later. But yeah, coding wise I'd say you did okay. Reasonably, quite well. You separated out functions into separate methods. Code was spread out, which was good. Refactored, modular. Again, very good. But one or two things. Use better variable names. Yes. Row call is better variable names matter these days. Okay.
Rocket Broccoli: Yep.
Digital Avenger: Especially in the companies that you are applying to. Yeah, that much I can promise you. It matters. We check.
Rocket Broccoli: Totally, totally.
Digital Avenger: Like you're not even applying at an SG one level. So basically an l four level, you are at least l five, l six. And there, these things matter quite a bit. And like the reason I'm this is because these are changes you can do tomorrow, right? Yeah. These are not going to take that much time. Next thing I'd say is take a look at, okay, yeah. Come to line 84. This is a memorization for you I would write down in your notebook if I were you. Okay, memorize, make it equal to, just make it a habit, just memorize this. It's always equal to less than zero, greater than equal to, but the length.
Rocket Broccoli: Is always one more than the allowed, the allowed value here because you know, the grid's length is going to be, you know, in this particular case.
Digital Avenger: So normally in coding languages it's zero to n minus one.
Rocket Broccoli: Right.
Digital Avenger: I'm not sure how it is in JavaScript.
Rocket Broccoli: Right.
Digital Avenger: But if it's, if it's grid dot length, if it is equal to even, then you would throw an error.
Rocket Broccoli: Let me, let me show you. So, and maybe, you know, I'm not trying to say I'm the best in the world here, I just want to make sure I fully understand. So if you have one, two, three, the length of this array is three.
Digital Avenger: Yeah.
Rocket Broccoli: And so if I try and access this element at three, I'm going to, I'm going to fail because the third element in the array doesn't exist. So if, if y is ever, wait a minute. Maybe you're right. I think I just proved myself wrong. No, yeah, you're absolutely right. Yeah, no, I flipped that up. I was just making sure I fully understood. I flipped it. You're. You're absolutely right. It is greater than or equal, then.
Digital Avenger: Like, I'm not gonna take it personally. It's okay. Like, if I have to learn, I'm happy to learn something.
Rocket Broccoli: Yeah, no, no, me too. Me too. I. Again, just trying to make sure I fully understood it. I had to prove myself wrong there.
Digital Avenger: Just memorize it. That's why I'm saying just memorize, like.
Rocket Broccoli: Yep.
Digital Avenger: Because in the heat of writing, this is not something you should pay too much attention to at that time. You should be, like, greater than equal to move on. Because this is not the chunk of logic that's ever gonna matter that much.
Rocket Broccoli: Yeah. If I am used to doing, you know, x first and then grid after and then usually doing a less than. And so I guess I'm just. I'm used to having it flipped up. But, yeah, no, that makes total sense. That makes total sense.
Digital Avenger: Okay. Other than that, there were a few small bugs, but I think more or less, these are fine. These are specific dependencies. So, yeah, these three main things are something I would keep an eye on. And one more thing. And this, I mean, it's already ten where I am at. I'm in PST. So it's already ten. Seven here. Not sure what time it is there. So how much time you have left, but, like, space and time complexities are quite important. Yes. Even if, let's say tomorrow you skate by, you have two more interviews coming. I would suggest boning up on those.
Rocket Broccoli: Yeah.
Digital Avenger: Like, those are the things that I first mentioned here. These are pitfalls that prove slightly problematic if you fall into them. Nomenclature, clarifications. And these minor, greater than equal to these are small things that have to add up to make a difference. Space and time complexity is something that makes a difference all on its own.
Rocket Broccoli: Right.
Digital Avenger: Okay. So once you're past that, I suggest taking a look at most of these things. And there are tutorials online. Like tutorials as in, there are questions online where all you need to do is just figure out the space and time complexity. Another way, I would suggest this is go through some questions. Don't even bother writing any solution. Figure out some solutions in your head. This is probably what you will do. Go to the actual solution. Check if your solution matches. Don't check the space and time complexity yet. They're generally at the bottom. Hold the page until you get there, figure out what you think would be the space and time complexity. Check the space and time complexity provided.
Rocket Broccoli: Gotcha. Yeah, I definitely need to. Just to agree with you. Yeah. I need to study time and complexity and space complexity more. In particular, space. I found that I simple things like it accurately most of the time, but more complex things like here, or at least what in the face of it, it seemed complex at first. I always mess up.
Digital Avenger: So, yeah, you're like, I'm not saying you need. That's why I never suggested tutorials like a basic ground up. You are halfway there. Just, you need a bit of practice.
Rocket Broccoli: Yeah.
Digital Avenger: And this is important. This is going to be asked like, this is hundred percent going to be asked in all interviews. This is something you should go in expecting. Okay.
Rocket Broccoli: Totally. Totally.
Digital Avenger: Okay. I want to take two more minutes talking about Amazon.
Rocket Broccoli: Okay. Yeah.
Digital Avenger: Okay.
Rocket Broccoli: Yeah, totally.
Digital Avenger: Okay. So I'll jump quickly. So Amazon, what you should expect is your interviews will be for 60 minutes. But, but, and this is why I really liked that you started coding because the thing is, whether it's a design interview or coding rounds, you will never have more than 40 minutes. Never more than 40 minutes. I'll tell you why. Two plus two. Assume this is intro plus last two minutes for interviewees. So generally we leave time for interviewees as well. You know, I mean, you guys also should have some time to ask us questions.
Rocket Broccoli: Yes.
Digital Avenger: So that's why we leave there then. Next. 1517. I'm not sure how familiar you are with these, but I would suggest boning up.
Rocket Broccoli: Yes. The leadership principles. Yep.
Digital Avenger: Because these are asked and like obviously if the take round is, has gone bad, then these are not even looked at. Because I mean, unless these are all excellent, then we think that the candidate has applied for the wrong role. Assuming tech has gone well. So we are considering you for technical position only, then these are looked at quite seriously. So few lP's, I want to point out are deliver results. Come on. Fairly. Let me make this. Yeah, got these down. There are 1213 only if you have four rounds, only eight will ever be asked because each interviewer will only ask two. Never more than two. Obsession. So these four are generally what are considered the key LP's. So key LP's generally vary from team to team because each team has something new. For example, if my team has existing stuff, person needs to learn something like that. I would be like on trust. Person should be able to work with the team. If my team directly interfaces with the customer, I would appreciate customer obsession. Deliver results in general is always so deliver results and customer obsession. These two are generally there always.
Rocket Broccoli: Yeah, that makes sense. Okay. Yeah, they. I'm gonna do the, you know, there's like a little webinar to prep you. I'm gonna do that. I'm gonna do system because I figure most of what we'll be doing that day is system design. So I'll bone up on system design and then leadership principles. That'll be kind of my study material for next week. On top of, of course, keeping in mind the three things you told me, plus big o, of course, because I need to study that as well, especially, you know, my intuition is the Google interview will not go terribly well tomorrow just because Google's crazy. It's my assumption at least. But I'll be, I'll be able to use this plus that as preparation for meta and Amazon.
Digital Avenger: Yep.
Rocket Broccoli: And I threw those three jobs that they sent to me as potential opportunities just so you can see them. And if you have any ideas, this marketplace.
Digital Avenger: Let me check the second one. Eks delivery. Let me check the last one. Okay. So your jobs are almost all in Aws.
Rocket Broccoli: Yes.
Digital Avenger: That's a little bit tougher. I want to own your hand.
Rocket Broccoli: Yeah, I figured.
Digital Avenger: Yeah.
Rocket Broccoli: Well, I, you know, the thing about interviewing is there's some interview questions. Like this interview question was completely outside of my comfort zone, so I felt really bad. There are some questions I do great on, there are some questions I do terrible on. And so it just kind of depends on what questions are asked, which is something I'm working on. I'm trying to study. So I'm more well rounded in that world. But, you know, we'll see what happens.
Digital Avenger: Well, that's why, that's why I was like, that is fine. So specific feedback I'll provide, you know, because that varies from question to question. And since you have the fundamentals there, I felt that it's okay.
Rocket Broccoli: Gotcha.
Digital Avenger: Check 960 as well. I'm sure you are aware of it, but I would feel bad if I didn't point it out.
Rocket Broccoli: If you didn't point out what? Sorry.
Digital Avenger: Line 660.
Rocket Broccoli: Ah, yes.
Digital Avenger: Technique. You're aware, right?
Rocket Broccoli: No, I'm not.
Digital Avenger: Oh, okay. Please, please, please, please note this down.
Rocket Broccoli: I am. I got, I'm pulling it up right now.
Digital Avenger: So situation, task, action, result. And I know saying this is easy, people listen to this easily. People forget most often about this quantifiable results.
Rocket Broccoli: Yeah.
Digital Avenger: Because people say that a bug came, I fixed it. Done. That's not done. How did it help? Let's say a feature was there. You worked on the feature, deployed it, done. That's not it. What was the result? What was the actual quantifiable help that you made? Okay, two things that I generally like for results, and second is I, not we. I know this goes against everything that we, but specifically for LP's, I mean, working with teams is part of it, like earns trust, etcetera. We expect to work in teams, but the thing is, in these kind of questions I am looking for, I. What was your contribution like as bar is that I've interviewed people from fields where they only do this. Like, I only interview them on LP's leadership principles. So there also I need to see the eye, like, because your contribution to the whole thing, the team did the entire thing, then your contribution gets suppressed. Don't glorify yourself. I'm not asking for that. I would never say that, and that would be actually problematic, but just say that this was my contribution to the overall thing. Specify when you needed help. That's okay. I needed help. I got somebody else assigned to me on the project as well, and I directed them. Maybe they worked with me, whatever. But this was what I did. I prepared the design, I gave them a task. However you understood that, that's up to you. And practice. Okay?
Rocket Broccoli: Yeah, yeah.
Digital Avenger: Situations ready to go for these, because you should have around six to seven situations for all these questions, you will have eight questions. Repeat more than three, four. That becomes problematic. You are eight years experience, right?
Rocket Broccoli: Yeah, a little more than that now, but yeah, yeah.
Digital Avenger: So you should not be repeating more than three, four.
Rocket Broccoli: Yeah, I probably. I, well, you know, right now I work at a startup and I've done so many things that I've been completely in charge. So I have a lot, you know, I'm. I'm out there building products from scratch on the weekend to potentially sell to customers. So luckily I've got, I mean, lucky you're unlucky. Depends on how you look at it. But, yeah, I've got the experience.
Digital Avenger: Yeah. So just write them down, sort of run them. Even if you write them down, that's good. Otherwise you want to run them through your own head. Just, you know, flesh it out in your head. This comes, I will say, talk about this situation. This. These are the things I'll mention. These are the things I'll talk about. Something like that.
Rocket Broccoli: Okay. Yeah, totally.
Digital Avenger: Okay. I feel I've taken a lot of your time and. Yeah. Okay, I'll let you go now.
Rocket Broccoli: Hey, well, you know, you're never, I'm never going to complain. Having someone help me out. So I appreciate your time. Take as much of my time as you want. I really do appreciate it, and thank you so much.
Digital Avenger: Okay, well, good luck on your interviews. I hope you do well on your Google interview tomorrow.
Rocket Broccoli: Thank you. I really appreciate that.
Digital Avenger: Cool.
Rocket Broccoli: All right.
Digital Avenger: Bye.
Rocket Broccoli: Have a good night. Bye.
Digital Avenger: You, too. Bye. Thanks.