 What's going on everybody? Welcome back to another video. Today, we're gonna be taking a look at my favorite website for practicing technical interview questions. Now, about five years ago when I was first getting started, I used lead code to practice for my technical interview questions. And if you've been on lead code, they have that database section, so you can use SQL to kind of practice some of these common technical problems or questions that you're gonna be asked during an interview. But about a year and a half ago, the owner of the website that we're gonna be looking at today, his name's Nate, he reached out to me, just said, hey, I like your channel, check it out. We do all sorts of technical interview questions, and so I checked it out and I really liked it. And in fact, I actually paid for it at one point to use it because I liked it so much. So for the past year and a half, the website that we're looking at today is actually the one that I've been recommending to people. I've been telling people to go look at if they actually wanna practice for their technical interview questions. The name of the website is called Stratus Crunch and I will leave a link in the description if you wanna check it out and also follow along while we're going through this video. We're gonna be looking at the entire website as well as walking through a few of the interview questions so you can kinda get a feel of how it works. And if you like it, I highly recommend trying it out to practice for your technical interview questions. They have a whole section called freemium where you don't have to pay for anything and so there are a lot of questions in that section as we are going to look at today. But before we get into it, I wanna give a huge shout to the sponsor of this video and that is Stratus Scratch. And Nate, the owner of Stratus Scratch, actually reached out to me over a year ago wanting to sponsor the channel and I told him no because I hadn't used the product long enough and so I wasn't sure if I wanted to recommend it but I have used it in the past year and I actually have paid for it and so I'm confident that it's a very, very good product and so I do recommend it. They have over a thousand real interview questions from Google, Twitch and Amazon and a ton of other huge companies and they are always adding new stuff and so I highly recommend checking out this website if you have an interview coming up and you wanna be prepared for your technical interview portion. Big shout out to Stratus Scratch for sponsoring this video and without further ado, let's jump onto my screen and get started with the video. All right, so here is the website that we're gonna be looking at today. Again, it's called Stratus Scratch and this is basically their landing page where you can log in and access all the questions. And like I said, they have 900 real interview questions from big companies and you can see what those questions are and you can actually see when we get in there what questions are from which company and I'll show you that in just a second. But really quick, let's log in and start taking a look. So it's gonna take us right to the coding questions section. They have a non-coding question. Let me click on that. I personally have not really used that this much. Here's their freemium sections. These are free ones that you can use. When I look through here, this is more data science focused so I didn't use it too much but I did try out a few questions. It was pretty interesting but I was mostly here for the coding questions like practicing for a sequel and Python and trying out some of these questions to try to figure them out and make sure I knew what I was doing before I actually got into my interview. So right here, you can see, they have lots of different interview questions once from Fang companies specifically. There is where you can pay for it and then you can get a ton of questions or there's a freemium section and honestly, there's a lot of content in this freemium one. There's like 30, 40 questions. Does it say? It doesn't say. But there's got to be like probably 30 to 40 questions for free in here and it's a really great place to start and start practicing these things. For the code type, right now, I remember there was only PostgreSQL recently that came out with MySQL and you can do Python. So all of these questions, you can either do it in PostgreSQL, Python or MySQL. And so you can practice these on different types or if you want to try it on SQL and try it on Python, you can do that. You can also select a company. So in here, if you're like, I have an Amazon interview coming up, you can filter by Amazon and find questions that are from Amazon. So these ones are all Amazon company questions or interview questions. You can also filter by the topic. And so if you come in here, they have lots of different ones. You can do sub queries, you can do date and time functions and you can click on these and then it'll filter by those types of questions. So if you're wanting to practice specific ones, you can do that. Let's, how do I get rid of this? There we go. So now what we're going to do is we're gonna actually take a look at some of these questions. I'm gonna show you just how it works and how the user interface works for doing the actual coding portion of it. And then we will go from there. So what I'm gonna do is I already have two pulled up right here. They are this salaries differences and the finding updated records. Both are the easy. So if you notice there's easy. If we come back here, they have medium, they have hard. So very similar to like how leek code is. If you use leek code before, they have easy, medium and hard. What I will say is the easy, medium and hard that was on leek code was much more difficult because leek code was made for software engineers. So the ones that they were doing were like crazy difficult. The ones here are difficult. The hard is what I genuinely think is hard. Some of the ones on leek code were like near impossible. And I've done some of those myself. They're very, very challenging. These ones are actually pretty accurate. So the easy ones are ones that I do consider fairly easy, really good practice ones for people who are just starting out. The medium and hard are genuinely pretty difficult. You need to kind of know your stuff on those. But I think are really accurate. So like easy is like entry level, medium is like mid level, hard is like senior level is kind of how I would put it. So let's take a look at these questions. I'm gonna be solving this one for MySQL. I could do PostgreSQL or MySQL. They're pretty similar in syntax. But let's take a look at this question. I'm gonna show you how to write it out, how to run your code, all that good stuff. And we'll just kind of see how it works. So this one is salaries differences. It says write a query that calculates the difference between the highest salaries found in the marketing and engineering departments. Output just the absolute difference in salaries. Okay, so I'm guessing, well I'm sure that this department has both of the departments in there. Let's look at that one real quick. Let's do db underscore department. Let's run this. Okay, so we have our different departments. That's important because we need to compare the marketing and engineering departments. And we're also need to look at their highest salary. So we need to take the highest salary from the marketing and the highest salary from the engineering, and then look at the difference between those. That is basically it. And let's see, so we have the salary in this table. So we'll need to join on the ID. So we'll have to join these. Yeah, definitely have to join these tables. And then we'll need to take the salary from the engineering and subtract it from the salary of marketing, I think. Let's take a look, let's start running it out and we'll figure it out as we go. Again, I haven't actually gone through this one. So I'm just kind of figuring out as we go. But we're gonna take the max salary of the db underscore employee. And let's just take a look at that real quick. Actually, let's take a look at the whole table. So real quick, while we're in here, you can do it like this where you run the code and you get your output right here. Or you can click preview and you can pull up the whole table. So we can see just a preview of these tables. We didn't actually have to search for it like I did just a second ago, but we can do a preview. Or we can go up here and run the code. Now, when you click check solution, you're actually submitting it. This is just giving us the an output of it. So, okay, so let's run that. We have all of our salaries in our department ID. So this looks pretty straightforward. We're gonna select the salary, the max salary, and then filter it by these IDs. And let me go back here, which is the engineering. Engineering is one and then marketing is four. So those IDs. So let's join those together really quick. And where am I going? Oh, I wanna go right here. So let's join those together. We're just gonna say, I like having it like this. Let's do join and we'll do db underscore department just like that. And we'll join it on, and let's give these aliases, we'll call this mnd, or department and employment. So go employee dot, what's it? Department ID. If we look at this ID, this ID is the unique identifier. This department ID is the one that matches this department ID. So when you do dot department underscore ID is equal to DE dot ID. I think that's it. Yeah, so let's take a look at this. Okay, and it joins it. So real quick, let me see if I can scroll over. So now we've joined them, and now what we need to do is we need to filter on ones and fours. So let's do that real quick. We'll say, oops, let's click up here. We'll go where, I think it's just department, right? Yeah, department is equal to, and we'll say marketing. So let's do that. Okay, so we have all the fours, and then let me just do or department is equal to engineering. And let's see if this works. Okay, so now we have all of our ones and fours. So what we're gonna take a look at is the max salaries of one and a max salary of four. Let's do it like this. Max, and we'll do salary, and we'll run that. Okay, so basically this is not gonna identify the marketing or the engineering. I should probably put that. Let me do department, and we'll do like that. Okay, so marketing has the highest salary of 48,187. But the question is, is output just the absolute difference in salary? So we need to be able to compare the salary of marketing and the salary in engineering. There's a few different ways to do this. I think the simplest one is to use a subquery where we look at one and then we look at the other. So let's take this, and we'll get rid of that. So we're gonna take this portion and we'll say, let's say select, yeah. So we're gonna select, and this is gonna choose the highest salary in this one. So we're selecting this, which is gonna give us the max salary for marketing. And then let's get rid of this and we'll do just like we did down here. We'll do select the max salary for this one. And I think I need to combine this because all we're gonna do is subtract it. So we're basically getting a number from this and then we're going to subtract and then get a number from this. And it all is in one. So let me run this and see what we get. It says zero. Oh, that's because we need to do engineering. All right, let's run this. Okay, the difference is 2,400. I didn't check to make sure that's right, but I'm gonna assume that's right. But let's give this an, it's taken the entire query as like an alias. Let's do as difference, oops. How do you spell difference? Difference, let's do it like that. In salary, differences. Yeah, I spelled that right. Difference in salary. I think this is correct. Let me see, write a query that calculates the difference between the highest salaries found in the marketing and engineering, output just the absolute difference in salaries. There is something in MySQL called an absolute where if it's a negative number, like let's take a look at like this, engineering and marketing. If we do this, it's minus 2,400. So the difference is 2,400, I believe, but depending on how we write it, we could get it wrong. So I think we need to add ABS. Yeah, so absolute makes it to where it's not negative. I think this is correct. Let's check it. Hey, it's correct. All right, that was what I would consider fairly easy. I think that could definitely be challenging for beginners or if you haven't seen stuff like this before, this could definitely be a challenging one. So try this one out yourself, see if you can figure it out. There also is a solutions from users where you can go in and see what other people did. And yeah, it's really interesting. This guy used, he's subtracted as well. So you can go and check out other people's submissions and see if you got it right as well. Or there's a solutions discussion. There's no official solution for MySQL or R. So some of them are gonna have it, some aren't. And then you can look at the solutions from users. So again, if you can't figure it out, you can at least get some, you can try these out and see how other people did them and see if you can get it right, which I think is really, really neat. Let's move over to the next one. And this one is the finding updated records. So let's try this one and see how difficult it is compared to the last one. So we have a table with employees and their salaries. Okay, just one table. This one even looks simpler than the last one because it doesn't have the other table. This is the same table as before, but without the actual other department table. So it says, with their salaries, however, some of the records are old and contain outdated salary information. Find the current salary of each employee assuming that salaries increase each year. That's important. Output their ID, first name, last name, department ID and current salary, order your list by employee ID in ascending order. Okay, so the difference between this one is this one is telling you specifically what you need to output. The other one kinda did, but this one is saying you need these fields in your output and you need to order it. So it's giving additional instructions. Let's take a look at this MS employee salary. Well, we just were, but it says assume that salaries increase each year. So the max salary, the higher salary between Todd Wilson, this one is gonna be the most recent. Everyone's getting a promotion is basically it. So we're gonna do everything comma, let's do max salary. Let's run this. Oh, okay. That's not what I was hoping to do. Let's run this again. This seems fairly straightforward though. We're just gonna choose each person. So we're gonna choose, we're gonna do ID. It says ID first name. So first underscore name, last underscore name, comma salary. Let's get rid of that real quick. Salary and then department underscore ID. Oops, underscore ID. So let's just, and then we also need to be ordering by, order by, I should be writing this better. I should be writing in like all cops and stuff, but I don't. So then we're gonna be ordering by employee ID, which is just ID and ascending. So we can do ASC, ascending. So descending is highest to lowest, am I right? And ascending, let's see if everyone, I forget. Yeah, so ascending is lowest to highest as it goes down. Descending is the opposite of that. So now we'll have the highest one and then the lowest. So yeah, ascending by ID and then salary. Okay, so I think what we need to do current salary. Okay, actually this needs to go at the end. And I think it's just gonna be the max salary. I think that's it and let's run this. Okay, okay. I need to be able to do each person. I need to be grouping by this, I think. So group by, I think it's everything. So I'm just gonna copy this. I think it's all of these. Let me do group by, let's run this. Okay, I think this is our final, I think this is our answer right here. So it's taking each person. So Todd, his highest salary was that 110,000. Is it in order? Let me make sure. ID, first name, last name, department ID and current salary, which is their max salary. So this is assuming each salary increases. And then order your list by the employee ID in ascending order. Okay, I think this is our answer. Let's check it and we got it right. So that's, let's see what other people did. This is, is this correct? He didn't put the salary in the right spot. Maybe it is, because it's still in the, this guy's using a partition. Hey, look, you can do it however you want. That's fantastic. Let's go back to the questions. That's it. I mean, that's what this is all about. You get to practice these different types of questions. And if we look through here, though, the easy ones, I wonder if you can sort by easy. Let's see. Yeah, you can do easy. So if we just look at the easy ones, there's a bunch of options. Again, there's an entire freemium section with a ton of questions. So even if you don't want to pay for it, just go and check it out. This is a great, great resource. Then there's medium ones. Let's take a look at one of these media. I'm not going to do it, but let's take a look. Customer revenue in March. It says calculate the total revenue from each customer in March of 2019, include only customers who are active. Let's look at solutions. I just want to see what these kind of look like. Okay, yeah, so a little bit different. This is a little bit more difficult. I'm not going to do this one, I think it'll take a little while, but these are the types of questions that you potentially could get in an actual interview. So they could just say, hey, we want you to solve this question and you have to solve it. And so practicing these things and practicing these types of questions is really, really, really beneficial. Because I promise you, I have studied, not just on this website, but on others, I have studied questions like these and gotten asked almost the exact same thing in an actual interview. And so knowing and practicing these things before you get in there is really important because if you get in there and you kind of waver and you're not really sure and you struggle to get it right, versus just nailing it right away and be like, oh, I know how to do that, boom, boom, boom, and you're done, there's a big difference. And so you want to go in positive and confident that you're going to get these questions right. So I would absolutely check this website out. Again, Strata Scratch, it's just, it has a bunch of free stuff. So go and check it out and practice these things, make sure you know how to do these questions because I promise you these ones are pretty accurate. What actual questions will look like. So knowing them and practicing them ahead of time, really, really recommend. So with that being said, I hope that this was helpful. I hope that this is something that you can actually use. I know that I myself have used it and recommended it for quite a while. So go and check it out. With that being said, thank you so much for watching this video. I genuinely appreciate it. And if you liked the video, if you found it useful, be sure to like and subscribe below. I will see you in the next video.