Black Friday sale! Get $500 off on 10-session dedicated coaching.

Watch a technical mock interview with a Spotify engineer
The Benevolent Enigma, a Spotify engineer, interviewed Spasmodic Donut in Java
Share
Summary

Problem type 

Even palindrome generator

Question(s) asked 

1) Generate all even number palindromes with 8 digits. 2) Generate the word index that goes in the end of a textbook.

Feedback

Feedback about Spasmodic Donut (the interviewee)

Advance this person to the next round?
  No
How were their technical skills?
3/4
How was their problem solving ability?
3/4
What about their communication ability?
2/4
Behavioral Question - The question “Tell me about a project you worked on, a technical challenge you faced, and how you solved” should be answered succinctly (see general notes about time management). Have two or three specific projects that you know inside and out, that you can dive deeply into if prompted. You were somewhat loose with the “technical” aspect (learning a language or framework isn’t a good enough challenge on its own). Even when I prompted you further, to discuss tradeoffs more precisely, you didn't follow that advice. I would've made that a top-of-mind response to a question like that. Question 1 (Palindrome Generator) - Catches edge case of leading zeros? Yes. You brought up a good example of eight 0’s being the smallest case, which I then corrected you on. - You brought up a brute force approach to start, which is good, but you didn't necessarily bring up that there is likely something better. That’s not the worst thing in the world, especially as you're facing the question for the first time. But of course, there usually is something better than pure brute force, and therefore, worth it to mention that reality. - At some point, I tried to clarify with you: "How do we reverse [the number]?" You said: “Use a stack,” and then said nothing. It's really important to communicate here. I wanted you to be more specific about it and I had to prompt you to get further clarification. - You continuously missed some basic cases around the minimum start (1111? 1001?) - Eventually clarified what we mean by “appending” the reverse, but it would've been worth it to mention that to me, since we weren't allowing string manipulation (and "appending" is primarily a string operation). - Excellent use of a helper function for reverse! Something I recommend to candidates all the time; it makes your code more readable and shows that you care about modularity - You were about to make the mistake of over calculating the x10 bit inside of your reverse() function, but you caught yourself, so kudos. In general, however, I would've wanted you to communicate that as you went, rather than making me guess at your thoughts. Especially if you actually end up stuck and don’t fix it. I can't offer you any insights at that point if you're truly lost and not communicating it. - On the followup question of generalization, you needed to parametrize the function! It took a little longer to understand that insight than I would've hoped Question 2 (Book Index Generator): - The open-ended question about how you want the "book" given to you as input is an important one. It shows me how you think about making the problem easier for you. Your intuition to use a list of list of strings was good. - You didn't bring up the issue of overly common words, punctuation, and capitalization at all until prompted. Maybe you were even thinking it, but I have a feeling that you jumped a million miles into the future thinking about a solution that you didn't communicate that issue directly to me. It's possible that I’m ultimately going to simplify the problem for you, but you need to make sure to communicate these thoughts to your interviewer. - Using a hashset for the unimportant words vs a list was a very good insight! I wish you communicated why without prompting though. - Only edge case is that words appearing more than once on a page will be duplicated in the index. - Overall good algorithm! General Notes: - Be a lot more communicative! Your previous interviewer's feedback about it was spot on, and I'm glad to hear that you're working on it. I would work on it even more! Don’t make the interviewer draw out your ideas from you. Offer them up yourself. My recommendation would be to talk to yourself, out loud, as you practice in the future. As if there was an interviewer there. Be overly communicative, rather than under. - Overall, your problem-solving was good, but the lack of communication was what pushed me from "soft pass" territory to "reject" territory.

Feedback about The Benevolent Enigma (the interviewer)

Would you want to work with this person?
  Yes
How excited would you be to work with them?
4/4
How good were the questions?
4/4
How helpful was your interviewer in guiding you to the solution(s)?
4/4
N/A
Transcript
The Benevolent Enigma: How's it going? Spasmodic Donut: Hi. Can you hear me? The Benevolent Enigma: Yep, I can hear you. Okay, how about can you hear me? Spasmodic Donut: Yeah, yeah, I can hear you. Yeah. Good, good. How are you? The Benevolent Enigma: Not bad. Not bad. Hope you're having a good week so far. Yeah. Yeah. Right. So let's jump right into it. How about that. So, my name is Simon. I'm currently a senior software engineer at Spotify. And I'll be conducting the interview today, which will run for about an hour, I'll ask you some questions about your past experience, followed by maybe one or two technical coding problems. And of course, the interview itself should be collaborative, very much like a dialogue, but also hands off for my perspective, like a normal evaluative interview would be. And just to set expectations, I'm totally okay with you looking up language documentation, syntax, things like that. But full answers to questions would not be okay. And please, of course, let me know if you've seen the question I'm asking before. Does that sound good? Yeah. All right, great. I'll definitely leave some time at the end for me to give you verbal feedback. And don't worry about writing down any notes that I give, because you'll also get those comments in written form as well. And to that end, you may hear me typing. But of course, that's just me writing down notes. So my feedback can be specific and complete, and ultimately valuable. So before we get started, do you have any questions for me? Spasmodic Donut: Yeah, I don't have any questions. The Benevolent Enigma: All right, let's jump right in. So why don't you start by telling me about, you know, a project that you've worked on, at some point in the last two years, maybe some technical challenges that you faced? And how you solve them? Spasmodic Donut: Yeah, yeah. So currently, like, my name is... So currently, I'm doing a master's in computer science. Right. Yeah. Currently this my last semester, and I will be graduating in December. And yeah. The last two months, I worked on a project. So it's a product. The product is about, I worked on AWS EC2 console. So I wrote a tool to manage the AWS EC2 running instances. Yeah, so this tool, like it will help you to figure out like, what are the instances running in each region and what are the volumes like you attached during the peak moment, or your removed and for each instance, and for each region, and it keeps track of all the information about the easy two instances. So for a particular account, so... So this thing, like, so the programming language I used was Python3. And so... So in SDK like I used it for. So for scraping, the extracting the data from the AWS EC2. The Benevolent Enigma: Great. So maybe it were some technical challenges that you've faced, and how did you end up solving them. Spasmodic Donut: Yeah, yeah. So the Python3, like, the Python, it was a new language for me. So like, I was primarily using Java. So Python, is this new language and the Boto three SDK, it's very new. So there was there was a learning curve. And I contacted my friends and I took guidance from my roommates, and to help me with the project, lead the challenges I have faced in the... The Benevolent Enigma: Yeah. Do you have to like face any, any sort of trade off decisions while you're implementing? Like were there any interesting challenges you face in that regard? Spasmodic Donut: Yeah, initially, like certain challenges like how to set up the remote, like SSH and how to SSH to the from the from. Like, how to initially set up the SSH for your account, and how to access those... Have the account the easy to account details. And these were like initial challenges for me. Since I did not use the how to the public keys and private keys on SSH, so... So Java, yeah, initial challenges said. The Benevolent Enigma: Alright, sounds good. So why don't we jump into a technical problem? Yeah, yes. So what's your preferred language? Spasmodic Donut: Java The Benevolent Enigma: Java. Alright, let's do that. Alright, so the prompt itself is very simple. So, what we want to do and do you see me like typing here? Basically, I'm like, moving around here. Okay. Yeah. So basically, this is the prompt prompt. I want us to write a function that prints out all the eight digit palindromes. And the only limitation here is we can't use string manipulation. Spasmodic Donut: Okay, okay. So what's the what are the constraints? So what are the input? The Benevolent Enigma: So there's no inputs, we just want our function to basically print out all those palindromes. So technically speaking, there aren't even any outputs since we're just printing to the console. So technically no inputs and no outputs, but we are we are printing those are sort of active action. Spasmodic Donut: Palindromes, okay created it means, even meant palindromes, okay you can't use the string manipulation. The Benevolent Enigma: I mean, this is maybe a limitation that I want us to think about. But if you can think of a solution that does use string manipulation, we can talk about it but we'll ultimately have to settle on a solution that doesn't use it and the reason being is that since we're using numbers we want to leverage the you know the internal CPUs ability to do arithmetic operations easily. And let's say for our purposes, string manipulation is a little too heavy. Spasmodic Donut: Okay okay. So eight digit palindromes okay? And the characters will be only digits right? Numbers. The Benevolent Enigma: Yes. Okay. Spasmodic Donut: So, even palindromes so... So, for example, and this isn't evenly balanced, so, this is the eight digit palindromes. The Benevolent Enigma: And it is not a power. Yeah. Spasmodic Donut: It is not a Palindrome. So, I'm just saying so, this is this a digit number and if the if like if we want to be this a palindrome, so, it exists exactly half So, it should mirror it, so, if I divided by half, so. The Benevolent Enigma: Right, yeah, so, that would be an eight digit Palindrome, yeah. Spasmodic Donut: Yeah. And I think the minimum Palindrome will be the all zeros. The Benevolent Enigma: So, this is a good situation to bring up. So, for our purposes, this actually would not be a valid a digit Palindrome we basically are not allowing any leading zeros like if we had a situation. In like this, this would basically be in our mind just zero and that would not be an eight digit palindrome. Spasmodic Donut: Okay. The Benevolent Enigma: So even if we had a situation like 00122100 this would not be an eight digit Palindrome it would simply be 122100. Does that make sense? Yeah. So, so it would be wrong basically. But it's a good call out. Spasmodic Donut: Okay, okay. So, I think the the starting palindrome will be it will start with one because I think the zero is not allowed. The Benevolent Enigma: Sure, yeah. I agree with you there that would be the smallest eight digit Palindrome. Spasmodic Donut: Yeah, this is the smallest and the I think the largest will be all nines. Sure. Yeah. Yeah. Because if anything, yeah. If a digital be lost, because if you've increased one, so it will become a nine digit. So... one way to do this is if I keep a start start as this... as 100001 Yeah, if I increment like one by one and check if it is a palindrome... So, if it is a palindrome, I can print it. So one way to take it is a palindrome or not. So... I will compare. So there are total eight digits. So I will compare so for checking... The Benevolent Enigma: Before we go into that approach, I do think that that would be a valid approach. It is it does feel a little bit too. Yeah, like we might be going through too many cases. Yeah. Can we think of an approach that maybe doesn't have to like cycles are so many possibilities Spasmodic Donut: Okay. Okay. Yeah, one approach I think I'm thinking of like, since it is since it is an even Palindrome, if we construct the first four digits, and then then the rest of the four digits will be the reverse of the first four digits. The Benevolent Enigma: Okay, that sounds interesting. However, we are going to reverse it? Spasmodic Donut: For reversing I can use stack... The Benevolent Enigma: Talk me through that a little bit more. Spasmodic Donut: Okay. So, if I use a stack like 1234 suppose, if you're constructing suppose this example 1234. And I want to reverse it so... So in this case, I will extract maybe, digit by digit. Suppose if I extract four. The Benevolent Enigma: How do we extract four? Spasmodic Donut: I can do the... Yeah, if I divide divided with 10 I can get the remainder four. The Benevolent Enigma: If you divide it you divide it you won't get the remainder if you if you divide this by 10? What will you get? Spasmodic Donut: Yeah. So, I would get four and so divided. So, for the remainder I will use this one. The Benevolent Enigma: Yeah much modular right okay. Yeah, just wanted to be on the same page Cool, all right. Spasmodic Donut: So, if I did, so, I if I use modulo so, I will get the remainder four. So, after after getting the remainder so, first it will be four and for next time after getting the remainder I can just multiply the four in... So, four into 10 so, it will be 40 and if I add, so, it will be 43. The Benevolent Enigma: Gotcha how are we going to get the three. Spasmodic Donut: Three. So, like so, after getting four we can just divide by 10 so, since it is an zoom, it is an integer. So... The Benevolent Enigma: You can you can make it an integer if you want right? Spasmodic Donut: Yeah. So, so, if we do 1234 by 10 so, it will become 123.4 and it is or it will become 123. The Benevolent Enigma: Got it. Okay. So, I think I understand though, so, can we recap the algorithm then? Spasmodic Donut: Yeah. The Benevolent Enigma: Can we summarize the whole algorithm overall? Spasmodic Donut: Yeah. So, so, instead of using the start as the digits, we can use this for digits and reverse the start and appended to it. So, in this way like we are not calculating, we are not going through whole eight digit so, we are going through the four digits. The Benevolent Enigma: So, two questions for you. Why is that the start? And, actually, let's start there. Why is that your start? Oh, I was 1111? Yeah. No, I don't think that would be the start either. I can think of a smaller Palindrome than that. Right? We could have this... One because that's your start. That would be Yeah, right. So it's bigger. I just wanted to be clear about that. Right. Like, because I want us to be sure that we're going to go through all the possibilities. So that's why I'm just bringing it up. But it's a small thing. But a follow up question I have is you said you're just going to append it, what do you mean by appending? It can we be a little more precise. Spasmodic Donut: Yeah. Appending is since here, also, so in this example, so while reversing it we are having only four so to make it 43... We are multiplying it by 10 and we are adding right. The Benevolent Enigma: So right... Spasmodic Donut: So in our case after so after constructing the initial part 1234. And now we have number this is the reverse part. The Benevolent Enigma: Yeah. Spasmodic Donut: If I do, since we know that it's a four digit, so multiply it by. Yeah. 10,000. So... The Benevolent Enigma: Gotcha. Okay. Yeah, that makes sense, right? Because we can't use string manipulation. So this is kind of the only thing that we're left with. Yeah. Yeah. That's great. Yeah, that this makes sense to me. So does the algorithm make sense to you overall? Spasmodic Donut: Yeah. Yeah, but I still it's, I think it's a brute force. We still we are calculating. We are, we are going through every combination, but we just reduce it from the eight digit to four digit. The Benevolent Enigma: Right? Yeah, I'm not sure that we can do actually better than this. Because we do. We're at the very least going over n possibilities where n is exactly the number of palindromes right? So we'll have to be able to do that at the very least anyway, so I think that's okay. Why don't we implement this? Spasmodic Donut: Okay yeah. The Benevolent Enigma: Yeah, don't worry about it ultimately compiling. Spasmodic Donut: Okay, okay yeah. Oh, for calculating the reverse, so I'm using an helper function. So I wrote the code. So disappointing function so, so we can just call it and it has been the Palindrome. The Benevolent Enigma: Okay, so again, I just want to point out that you are missing a case. Spasmodic Donut: Oh, yeah. So 1000. Yeah. The Benevolent Enigma: Sure. Yeah. All right, great job. This would work to clean up the code a little bit. So this would work. Now, we're not going to code this part, but let's just sort of think through some ideas. So what this function does right now, is it generates all eight digit palindromes. Let's say I wanted to generalize this to all even digit palindromes. So you know, eight digit Palindrome 16 32 64. Can you indicate to me where we would maybe change the lines of code in the algorithm to make it more generalized? Spasmodic Donut: Okay. So, we want to make it to like the to print a k list palindromes when case and case even right okay. The Benevolent Enigma: Can you just like tell me like where we would change the lines of code and what we would roughly change it to? Spasmodic Donut: Yeah. Like initially like I can think of is like changing the start and end so... The Benevolent Enigma: That what would we change it to? Spasmodic Donut: So this one so, one way of doing this is like changing the start and end. So, changing start digit so, so if we want a even list Palindrome of size four then oh yeah, we can we can change it to one one... The Benevolent Enigma: Why one one? Spasmodic Donut: Yeah, if we change it to one zero, then well calculating the reverse it will be one zero. Zero to 10. Zero, some will be zero and next it will be one. Yeah. So if we start from one zero while reversing, it will just return one. So it will be an odd length palindrome. The Benevolent Enigma: Sure, so, so what you're telling me is, every time I want to have a different number of digit palindromes, I have to keep changing this line over and over again. So if I want six, if I was two, I'll have to edit this line. If I want. If I want 16, I'll have to edit this line. Is that what you're telling me? Spasmodic Donut: Yeah. The Benevolent Enigma: Can we think of a better approach? So what you're telling me is basically that I'm either gonna have to have infinitely many versions of this function? Right? Oh, yeah. Yeah, one of one of them where there's like, this another one where there's like this, another one where there's this is that what you're telling me? Spasmodic Donut: So like, I can think of so. So if we gave the variable k, so which the k will be the even the, what we want the length of the Palindrome of like of sizes, the even? The Benevolent Enigma: So gotcha, gotcha. Spasmodic Donut: So long, we can just generalize the palindrome function to perform the final even palindromes. The Benevolent Enigma: Gotcha. Yeah, I think that would that would work right? We would need something like 10 to the power of k minus one, right? And then here would be 10 to the power of k. Right? Those would be the changes. Yeah. All right. Great. I think this would work. Good job on this problem. Let's move on to another problem. Okay. Gotcha. So, let's, I'm gonna, let's move down a little bit further. So I'm just gonna, let's say this. Let's just have another function, for example. Okay, so basically, the purpose of our function. The purpose of our second problem is, let's imagine that we have a book. Now in its very simplest form, we have a book, books are full of a bunch of words. And let's actually be a little bit more specific. Let's say it's a textbook, for example. You're familiar with how, like, at the end of textbook, there's, like an alphabetized index of words at the back. So for example, if we have, like, let's say, a biology textbook, or something like that, we might see like animals, and then it shows what pages they appear on. Right? Yeah, yeah. And we have biology, and then it's like, you know, 2 3 4 6, you know, it's like a book about biology. So we'd expect it to happen in a lot of places. So... Spasmodic Donut: Oh, okay. So that important words and the pages of which they appear on. The Benevolent Enigma: Right, so the only thing I'll draw your attention to is basically that these words themselves are alphabetically sorted. And the pages that those words appear on our page sorted in increasing order. So basically, what I want to be able to do is you know, given a book I want us to generate this index. Spasmodic Donut: Okay. Okay, given a book also, on purchases the index, but how do I know? Like, how should I get the words? So, what are these words are like based on? The Benevolent Enigma: Sure, so, let's actually talk about the structure of the book. How do you want the book given to like we can understand that like, you know, a book has pages and has like, you know, paragraphs and words and things like that. So, let me ask you, like, how would you want that a book given to you in one form? Spasmodic Donut: Okay. Yeah, the book should consist of the words and page numbers. Yeah, so the book is should consists of, like the pages and support, let's assume. So the book is consisting of 100 pages, and in 100 pages, like there are words. The Benevolent Enigma: Sure, so can we be more precise? Like, like what data structures would we be using? Like, I'm happy to give it to you, and I'm like flexible on the on the form of the input. So, let me know what you would like. Spasmodic Donut: Okay. So, I want to so, it will be a list of lists. So, because... So, it will be a list of pages and each page consisting of words. So, it will be a list of RNAs. So, it will be I think, so, it will be a list of strings so. The Benevolent Enigma: And what does the string represent? Spasmodic Donut: These these things are the words. So, animals and cells... Yeah, because so, I think it will look like this animals and in the second page, so, so biology, so, this, the size of the book will give me the total number of pages and each index, I can get the page number. The Benevolent Enigma: Yeah, yeah, that makes sense to me. So, that would be like page zero. Biology would be page one, or, you know, whatever, if it's based or zero base, that's your call. Okay. I'm happy, I'm happy to give you the book in this form. But one thing I do notice is that, you know, this doesn't look like a sentence to me. So, I don't know if I can just simply give you these words. So like, you know, I can imagine, you know, I'm not going to write it in the form that you gave it. Yeah. But like, you know, no, Biology is the study of life. Life is important for all organisms, you know, like, let's say this is like our first page or something like that. Okay, okay. Yeah. Right. Like that would be technically held the book is so like, I like what you've got going here. But let's say the reality is, you know, you know, we have something like this as the actual textbook, what you see like any, any thoughts that you'd like to bring up about this? Spasmodic Donut: Yeah. So, so, one way is like, so, if it is a list of string and so, this string will be the the each page. The Benevolent Enigma: Why? Spasmodic Donut: So the so the sentence is nothing but it's a collection of words and... The Benevolent Enigma: Can you maybe communicate to me like the issue that you're seeing with this? Because I'm not necessarily opposed to this initial idea that you brought up. But I do want to understand like, if this brings up any issues for us. Like, what issues are you seeing? Spasmodic Donut: Yeah, if they give the given book is in this format, like... The Benevolent Enigma: I'm not saying it's in this given format, I'm just saying that like, this is not an impossible situation where we kind of have like this sentence, like, this is what the book will look like. And even if I give it to like this, like, do you notice any, like issues that might be problematic for us, as we're sort of generating this index? I mean, so for one thing, there's punctuation, right? Spasmodic Donut: Yeah. Yeah. Because if it's a string, and in string, so in Java, like we need to end it with... So... The Benevolent Enigma: Right, and there's also you know, capitalized words and things like that. Are there any other issues here that might end up making our index maybe a little bit bigger than we want? Spasmodic Donut: Yeah, so if, like, if the book is presented in this form, like we need to calculate. So we need to extract each words, the animal's biology cells. So... The Benevolent Enigma: So again, just to be clear, I'm happy to give it to you in this format. And I'll even say, I'll strip out the punctuation for you. And even better, I'll make an all lowercase. Let's say I do all that for you. Let's say I tokenize it, I lowercase it, I remove the punctuation and I give it to you in the format that you initially suggested as a list of list of strings. Okay, do you even even with that being said, Do you might we have like any issues? So you know, something like, biology is study of life. Life is important for all organisms, right? I just, you know, I just want it to be clear that, like, I'm happy with this initial proposal. But is there anything that kind of jumps out at you here? I mean, I'm gonna have something like this in my dictionary in my index, right? Yeah. Right. Like it's gonna, there's probably going to be the word. The word is, like on every page, right? That'll kind of make my index very big, right? Spasmodic Donut: Yeah. Yeah, we need to we need to extract those indexes like, which are important. And so the priority? The Benevolent Enigma: Sure. Okay. Can you see any issues with like? Coming up with a list of like, quote, unquote, important words, like let's say, you know, this is a biology textbook, right? But then at some point, we have a textbook about like art history, or a textbook about chemistry. How do we know what's important? Spasmodic Donut: Yeah, one way is... So if we calculate the frequency of the words, so suppose the so this will have a higher frequency than the, the biology. The Benevolent Enigma: Right? Sure. So we could do some sort of a heuristic, where, if it's like, a lot a lot, we remove it. And if it's not a lot, then we keep it. Okay? Can you think of any other approaches. What if I told you what all the unimportant words were? Right? Like, we can imagine that? You know, maybe what's important between an art history textbook and a biology textbook is different. But probably what's unimportant is maybe a little bit more consistent, right? Like is and, and all that stuff. Spasmodic Donut: Yeah. So if we have unimportant words list, just so. So here like, yeah, while scanning through each page, we can just so if we keep this important, you know, in a set. So. So unimportant set. So if we can, if we scan through, well scanning through each page, if we encounter the word, which is already in the unimportant set, so we can skip that word. The Benevolent Enigma: Right? Yeah, I like that approach. Okay. So can we maybe like now formalize the algorithm a little bit? Spasmodic Donut: Okay, yeah. Okay. So the book is in the list of list format, right? The Benevolent Enigma: Sure. Yeah. I'm okay with that. Spasmodic Donut: Okay. And book and unimportant words. The Benevolent Enigma: So why'd you give it to me as a list? Spasmodic Donut: I'm sorry. Could you please.... The Benevolent Enigma: So you want this as a list? Spasmodic Donut: List of unimportant words. The Benevolent Enigma: Okay, fine. So walk me through the algorithm. Spasmodic Donut: Okay, okay. Yeah. Initially, like, so, I want to keep these unimportant words in a set. The Benevolent Enigma: Okay, what's the benefit of the set over the string over their list? Spasmodic Donut: Because inside also, we can, we can look up in constant time. So we can look up the word in constant time. So you need to enlist, like you need to scan through whole list. So it will be like complex, they will be linear time. The Benevolent Enigma: Sure. Okay. So let me just give it to you as a set. Right? Like we have like flexibility, right? So that's why I brought that up. Okay. Great. So walk me through the algorithm. Okay. Yeah. You don't have to write it out yet. You could just explain it to me for now. Spasmodic Donut: Yeah, so I need to go to through. So, each page of the book and while going through each page I need to also I need to iterate to whole page and I need to see every word. So and for every word like a first I need to say it is important or not. So, if it is important, then I can keep track of it. So, I can use a HashMap okay. Yeah, for the nothing, so, has been the key will be the important word. So, the string and the for the pages. So, I can use list shortened to the interval... The Benevolent Enigma: Yes, okay, this makes sense. Spasmodic Donut: Yeah. So, when scanning through, so every word first I will look into is important or not. So, if it is important, then then I will take if the if it is present in the HashMap or not. So, if it's present in the HashMap, then I can just add the page number to the list. If it's not, so I can create a new key and new list so I can just add it to the pool finally, return the dictionary. The Benevolent Enigma: Yeah. The only thing to note is that the words may not be sorted, right? Like a like this is in sorted order the words themselves. But the HashMap one is totally give that to you, but that's totally okay. There are approaches around that. But yeah, I'm happy with that approach. I'll leave it to you as an exercise to implement on your own after this interview. But why don't we jump into feedback? Spasmodic Donut: Yeah, yeah. The Benevolent Enigma: So why don't you tell me how you're feeling? Tell me? What are your thoughts about how this interview went? Spasmodic Donut: Yeah. So, so this, this is my second interview, like on this platform. So yeah. So what I observed, so from the like, first interview, I gave, so the feedback I got, so on my side, it was, so it was pretty bad. So I didn't communicate very well. So the interviewer, like, he gave feedback on the show to communicate and to communicate your approach, because sometimes, you may. So without communication, you may go to different approach. And that approach may did so. So the company, so it will be a complete waste of time. So what he suggested was you need to you need to explain everything, like your thought process and everything. So yeah, the time. So, yeah. So in the second interview, like, this time, like, I thought, and so I'm, I'm thinking like, so I communicated good. Better than last time. The Benevolent Enigma: Great. Okay. So I'm very glad to hear that you, you brought that up. I'm glad that you're sort of taking that feedback from your past interviewer and applying it now. So I'm glad that you use sensed to communicate better. But I will actually say that I 100% agree with your first interviewer that I think that my main piece of feedback for you is that I would like you to be even more communicative than you were this time. So overall, I would actually say that your technical problem solving skills are pretty good. But what I would like ding you on most, first and foremost is the communication. So I'm actually glad to hear that you're working on it. So that's great. I want actually even more of your thoughts. And as I'll go through each of the problems, I'll kind of maybe suggest where you could have like given me a little bit more when you didn't. But I would say that like keep working on that communication as you sort of do future interviewers future interviews on this platform. But let's go one by one actually. Could you could you give me just one second? Spasmodic Donut: Yes, yeah. The Benevolent Enigma: Alright, okay, yeah, sorry about that. Okay, so let's, let's start with the behavioral question that I asked you at the very beginning. So I basically asked you, you know, talk me through like a project that you worked on some challenges you faced and how you solve them. I will say that the first time you started answering the problem, that question rather, you only answered the first part of the question, which was, tell me about a project, you didn't talk at all about the technical problems you faced, or how you solve them. I had to like, draw that out of you a little bit more. And even when I did draw that out of you, I would say that maybe there was probably a better way of approaching the question. In general, I would say that, you know, a common issue that you'll face, of course, when you're an engineer, is that you need to learn a new language, learn a new framework. But I wouldn't say that that's necessarily like a good candidate for answering that question. I think that there are better, better examples to conjure up when it comes to that, like, situations when you had to make certain trade offs like around performance, or extensibility, or scalability. Like I think that in general, those are better candidates for answering the question. So I, in general, maybe in the future, when you're kind of dealing with that sort of question, maybe avoid talking about languages or frameworks, I think it's just like, not as rich. Like, I can't necessarily delve more deep into people into that as an interviewer. Like, it's kind of not very fruitful to talk about, oh, like, what about the framework was difficult, you know what I mean? Whereas I can, I can delve a little bit more deeply into, you know, performance trade offs, or like, why you did something, if that makes sense. So I would say in the future, kind of, like, have a ready example, that ties into that a little bit better. And even when I did kind of prompt you with that, like, where I said, Can you talk about, like some trade offs that you had to make? I didn't think you quite answered that part of the question. So for the future, just have something like that as an example that you can conjure up. Does that sort of make sense? Spasmodic Donut: Yeah, yes. Yeah. Yeah. Yeah. The Benevolent Enigma: Yeah. All right, great. So let's jump into the first question. The Palindrome generator question. So overall, I think you did pretty well with this question. You know, I was wondering whether you would catch the edge case of leading zeros, and you actually brought that example up pretty immediately. And I'm glad like I, you know, it's fine. I didn't tell you that there were any limitations around that. And I corrected it. And then once we got that, it became clear that we had to have a different starting point. So I'm glad that we kind of got there, I appreciate that you brought up the very, very brute force approach to start. It's not, it's not necessarily a bad thing that you didn't say that there was something better because maybe it's not necessarily clear to you that there's something better at that stage in time. So it's not the worst thing in the world that you didn't mention it. But I'm glad that we did sort of bring up this brute force approach. So at some point, you suggested that we, you know, take four digits, and then we reverse it. And then I asked, okay, how do we reverse it? Let's be more specific. And you said, use a stack? And then that's it. You just there was silence after that. So I think it would have actually, like, that's one very specific place where I actually wanted more communication from you, where you said, use a stack, but like, you didn't explain at all what you meant by that. And I thought that that was like, definitely like a red flag. So, you know, explain, like, how would you use a stack, you know, it's important to be a little bit more specific here. I had to prompt you for that. And ultimately, we actually didn't end up using a stack, which is okay. But I would have went like, you could have used a stack in this case. But I would have wanted you to explain that more concretely. And I think you just were very non verbose there, and I would have wanted that. I think in general, as you sort of went through this problem, like, I actually think that your problem solving around it was good, you sort of, you know, you tripped up in the normal places where I would expect a candidate to trip up, but you ended up solving those situations. But I think the main issue is that like you didn't communicate your thoughts to me a lot of the time. You, I, it's good that you communicated more maybe than your previous interview, but I actually want even more out of you. And the reason is exactly what your previous interviewers said. If you had suddenly started going down a bad path, and you didn't communicate to me your thoughts around that bad path, you would dig yourself into a very, very deep hole and not let me help you out of it. Because, you know, eventually I will give a hint. In this case, I actually didn't need to give a hint because you kind of did start going in the right direction. But if you didn't communicate, we would have just sunk all of our time. into the problem. So I want you to communicate your thoughts even more. I want, even if you're, here's a common thing, like when I was interviewing something that I went through, I would think about the problem. And I would sometimes even overthink it over complicated. And as a result of that, I would, my mind would be racing like a million miles a minute, I wouldn't be jumping to all the issues with the approach, why the approaches isn't good. But I think it's important to verbalize that to me as your interviewer. Because maybe I'll simplify the problem for you. Maybe I'll say, actually, let's ignore this. This isn't an issue. Right. And I think by you not communicating as effectively, we can't get there. Do you know what I mean? Spasmodic Donut: Yeah, yeah, yeah. The Benevolent Enigma: Definitely communicate more on that aspect. You did miss some basic cases around the minimum start. And I have actually had to, like, poke you about that a couple of times. So just be a little bit more careful about it. Just, you know, we, it wasn't it didn't even just happen once it happened, like two or three times. So just be a little bit more aware about it. I think, you know, at some point, you said something about appending, the reverse. And I'm like, I wanted to clarify what we meant about that, especially because we said we weren't using string manipulation. So I'm glad that you explained that really well, to me, what I really loved was your use of a helper function for reversing like, that's great. Like, that's something that I recommend to candidates all the time. Like, it makes your code way more readable if you introduce helper functions into the mix. And it shows that you care about modularity, you know, about testing if we eventually wanted to write tests for it. So I thought that was excellent that you just did it on your own. So kudos on that. What one thing I saw that you were doing, as you were writing that function is you're about to make the mistake of over calculating by 10, or something like that inside of your reverse function, but you caught yourself. So I just wanted to say kudos to that. I think one thing that I would have really liked there is if you've communicated that as you went, right? Because you didn't say anything, when you were implementing that. And like, I saw that we're potentially going to fall down a rabbit hole. And yes, you fixed it. But if you didn't communicate, like I would have wanted to hear your thoughts about what you just fixed, if that makes sense. Yeah, so yeah, but otherwise, I thought your implementation was overall pretty good. The only thing is, is that at the end, at the very end, when I asked a follow up question about how would we generalize this? It took us maybe a little bit longer than I would have expected to actually do see my highlighting up here. Yeah, yeah. So it took a little bit longer than expected for us to realize we should actually pass in a parameter for the size of the Palindrome length that we want. Like, I tried to get at it by saying, do we want to re implement this function, you know, 1000 different ways. It just took a little bit longer than I would have expected, it's all. Great. And don't worry, again, don't worry about writing any of this down. All of this will be shared with you at the end. So do you have any questions about this first problem? Spasmodic Donut: Yeah, I don't have any questions. Yeah, I don't have any questions. The Benevolent Enigma: All right. Great. Let's move on to the second problem then. So you know, I was totally okay with us not getting to code with this part, because I thought I saw enough with the first problem. I wanted to see how you would approach this. From a problem solving perspective. I would say a lot of there are a lot of open ended questions with this problem. And I'd say that, like, it was a little bit on the fence, like some you answered, really well, and thoughtfully, and others, you'll just like, weren't really communicating with me at all. So like, the very first one was, what format do we want the book and I think that your intuition was really good to have like a list of lists of strings. And I'm glad that we kind of caught up on that right away. But what I didn't so much see is that you didn't really bring up the issues of these like overly common words like is and you didn't bring up punctuation. You didn't bring up any of those issues and capitalization like you didn't bring up any of those issues. And I felt I got the sense that you were maybe thinking about them, but you weren't verbalizing them, because you were you were trying to jump to the perfect solution at the very end. And I would very much recommend against doing that. I want you to verbalize those thoughts, even if they feel wrong. Because again, what what did I do at the very end I simplified the problem for you. I said I'm totally okay with this format of the word I'm totally I'll give you I'll give you the unimportant words. But I want you to communicate that to me and give me some of those ideas. I felt like you didn't communicate that to me. And like, that was like a pretty severe ding, I think in my book, especially with like, how, how open ended this problem really is. Yeah, I'm glad that you said that we should have a set of these words of these unimportant words, I did bring that up as a suggestion to you, which wasn't great. But I'm, you know, I'm glad that you suggested that instead of a list of words, you should use a hash set, because that will increase the improve the time complexity. So I'm glad that you brought that up. The only thing I would say is that there is an edge case here, where if a word appears multiple times on a page, it will appear in your index multiple times. So for example, the word life, for example, it appears twice on page one, or whenever page zero, it would technically have appeared twice in your index, because we didn't bring up this corner case. So I just wanted to bring that up as a potential issue. But overall, it was a good, good algorithm and a good solution. Here's the thing. I would say that, from a problem solving perspective, you're really strong. But because of the like, if it was, if I just was grading you on problem solving, like if this was like a do I pass this candidate on to the next round or not? If it was purely based on the problem solving, I probably would pass you. Like, I would be leaning more towards yes than no. But given how maybe how much you struggled with the open ended nature of the second problem, like maybe it's okay to struggle with it. Like that's totally fine. But I say that overall, because the communication was lacking for problem one. And problem two, I'm leaning actually more towards a no, like, I wouldn't have passed this candidate to the next round. So I would say that, absolutely. Like, as you sort of continue to do practice more practice interviews, but even more practice on your own, I would recommend that you like talk to yourself, like try to go through these problems completely out loud. As you face issues or perceived challenges. Like I want you to communicate that even if you're you know doing some leetcode problems entirely on your own, like, pretend like there's somebody there, and you're like explaining your approach to them as you go. And definitely, as you do your next interview, definitely, definitely communicate to the interviewer more. Yeah. But that's overall my impression. Do you have any questions for me about either the second problem, or these sort of general notes that I've left you? Spasmodic Donut: Yeah, yeah. I like the the like feedback again. So getting my 10 Second questions already. So the like, little by little, yeah. The Benevolent Enigma: Yeah. All right. Sounds good. Spasmodic Donut: Yeah, the communication is key for the interviewing process. The Benevolent Enigma: Yeah, if it was only problem solving, I you know, overall, you did well, but because it's not just that, I would say that. That would be my main area of focus in terms of improvement. Yeah. Alrighty. If that's all then I wish you the very best of luck in the future, and you know, if we connect after this, happy to chat again in the future. Spasmodic Donut: Yeah, yeah. Yeah. Thank you very much. Thank you. The Benevolent Enigma: Have a good one. Spasmodic Donut: Yeah, and you too. Bye. The Benevolent Enigma: Yeah, bye.

Want to get some practice yourself?

Become awesome at interviewing, and get actionable feedback from engineers at top companies – it’s 100% anonymous!