Nov. 22, 2021

Senior Software Engineer Mock Technical Interview (Coding/Algorithms in JavaScript)


Many of you wanted to see what a senior technical interview looked like for software engineers. You asked, and thanks to Sophie and Dan, you shall have. Here's what an algorithm/coding portion of a senior software engineer interview can look like. I love how Sophie progressed the problem until Dan was truly challenged. How you handle that moment in the interview speaks volumes about your character and how you'll most likely handle future challenges. Enjoy!

Host (Don Hansen):
Linkedin - https://www.linkedin.com/in/donthedeveloper

Interviewer (Sophie Novati):
Linkedin - https://www.linkedin.com/in/sophienovati
Website - https://formation.dev

Interviewee (Dan Cortes):
Linkedin - https://www.linkedin.com/in/dan-cortes-8954b345
Website - https://dancortes.dev

---------------------------------------------------

🤝  Join our junior friendly developer community:
https://discord.gg/H69QqZ8MVJ

🔥  Want more personalized help from me? Here are the paid mentorship and review services I offer:
https://calendly.com/donthedeveloper

❤️  If you find my content helpful, please consider supporting me by becoming a channel member and get access to additional perks. Every little contribution helps and is actually used to pay my bills.
https://www.patreon.com/donthedeveloper

---------------------------------------------------

Disclosure: Some of the links below are affiliate links. This means that, at zero cost to you, I will earn an affiliate commission if you click through the link and finalize a purchase.

📚  Web development books and other products I recommend:
https://www.amazon.com/shop/donthedeveloper

The Leadership Enigma
As the world constantly changes, then today is a simple as it gets! It’s your...

Listen on: Apple Podcasts   Spotify

Smells Like Humans
Like spending time with funny friends talking about curious human behavior.

Listen on: Apple Podcasts   Spotify

Transcript
Don Hansen:

Welcome to my web development podcast, where I help aspiring developers get jobs and junior developers grow in this podcast episode, I hosted a mock interview, uh, where it's more like senior level for software engineers that are going into like a algo coding, heavy technical interview. And for the interviewer, I invited Sophie, who's the CEO of formation who has created a company. So she basically does this for a living and she helps a lot of junior to mid SI or mid-level engineers get into more senior roles at larger companies like Google lift, kind of just like the harder technical interviews and for the applicant, if you guys watched my previous mock interview, which is more for entry level, I brought Dan, my friend, Don, who did the last one to actually be. The interviewee this time. So Dan is a senior level engineer and we're giving him a senior level technical interview. So let me know what you think. Let's jump into it. Hey

Dan Cortes:

Dan. Hey, Sophie. Good to meet you. Good to

Sophie Novati:

meet you. Uh, super excited to be chatting. So I see that you're currently an engineer at

Dan Cortes:

Coinbase, right? Uh, yep. So I've been at Coinbase, uh, as a front end developer for about eight months. Um, prior to that, I worked at an education startup in Chicago for over five years, um, where I kind of saw that project go from like zero customers to this like actually like legit platform that's that's used by, um, I don't know, a good chunk of high schools in the us.

Sophie Novati:

Very cool. Okay. Well, um, very excited to learn more about that. Um, just to give you kind of an overview, um, well, wanna, uh, wanna learn a little bit more about kind of your, your career history and as along with some of the stuff that you're doing currently at Coinbase, um, and, uh, and, and we'll hopefully spend most of this, uh, time on, on a coding exercise after that. Um, but yeah, I guess if that sounds okay. Um, uh, yeah. Can you briefly describe kind of the, the team that you're on at Coinbase and, and the work that you're doing there?

Dan Cortes:

Yeah, for sure. So, um, currently I'm on the growth team, so that really, it involves like making sure that people that sign up for the platform, um, start interacting with the platform. So for instance, like, you know, making sure that people make an account, um, buy crypto. Set up recurring buys really just engage with the platform. Um, and I primarily work on the, uh, react native app mm-hmm , but I done around to react web as well. Um, to that fun fact, I actually had not used react native before Coinbase had to like learn it all, um, on the job. And it's been, it's been super fun. I've just been having a ton of fun, like learning a new technology.

Sophie Novati:

Cool. Can you tell me a little bit more about kind of what your process was for getting ramped up on, on reacting?

Dan Cortes:

Yeah, for sure. So thankfully the promise of react to like, uh, learn once and, uh, right anywhere is actually true. So like, it, it does feel very like comfortable going from react, uh, web to react native, cuz like you're still just writing react. Um, also we have like a super robust, uh, design system at Coinbase. So. A lot of the, you know, it's like with react native, you don't have access to like, um, all the HTML elements, but like, it doesn't matter because we have like, just component, uh, design. So system components that we use for most, uh, things. And yeah, I mean, aside from that, um, there's, there's a lot of like really awesome, um, react native developers that are there to help people out. We have like, uh, mentors who essentially just are there to onboard people with react native. Um, because yeah, like unlike react web where there's like so many react web developers, um, I feel like react native is like definitely less, uh, you know, there's like less react native devs around,

Sophie Novati:

uh, have there been any like gotchas of like something that didn't translate quite exactly as you between. React and

Dan Cortes:

react. Yeah. So the, I mean, honestly, the scariest thing for me is the fact that there is like native code. Uh, and like as a web develop, you ever have to hop down

Sophie Novati:

into

Dan Cortes:

native code. Um, sometimes especially when you have to like, um, initially like set up the application, like some, you know, some error happens that's like in, in one of the native modules and you have to like go debug. I haven't had actually had to like write native code, but I've had to like debug it just to like, make sure

Sophie Novati:

that that's one of what's one of the bugs that you had to,

Dan Cortes:

you had, um, I mean, it's, it's honestly just been more like understanding what was causing like my build to not, uh, not build correctly. Um, and yeah, usually it's just like, okay, like maybe it's like some dependency that, that I'm missing or something like that. Um, but yeah, I mean, I would say that the other big thing is that like, styling is just completely like. um, I feel like the, the web has come a long way with CSS and all the things that you can do, uh, react native CSS is extremely limited mm-hmm um, so it can be much more difficult to like precisely like, uh, style things. Um, but again, thankfully, you know, we have a really robust, uh, component design system, so there's not a whole lot of styling going.

Sophie Novati:

Yeah, I think web, uh, styling is a lot more flexible cuz you know, with mobile, I feel like all, both the mobile platforms have more like established, uh, patterns that for how apps look on, on each platform. So that makes sense. Um, I guess going back to, um, so you were at Albert for a bit before, looks like you were also at, at Glassdoor for some time. Is that, is

Dan Cortes:

that right? Yep. So I did a brief stint, um, at Glassdoor between um, Albert and

Sophie Novati:

Coinbase. And what motivated you to wanna make a recent change? Your, the recent change between Glassdoor and and Coinbase?

Dan Cortes:

Um, I mean, so yeah, if I'm being honest, like it was a great. like, love the people at Glassdoor, but I guess just the code base. Wasn't what I wanted to work within. Um, I found it

Sophie Novati:

like, like with the tech stack or

Dan Cortes:

no, I mean, it was still like a react tech stack, but the like the client server and like a lot of the foundational pieces just were not, they were very like, uh, you know, in house built mm-hmm Um, and I personally just didn't feel very productive. Um, so I was like, you know, I, I kind of made this decision of like, I haven't been here for that long. And I feel like if I stay any longer, I'm gonna be here for like, you know, two plus years. Cuz I have like a track record for actually you all learn nothing yeah. I feel like staying in places for a while. Um, so I was like, yeah, like, I don't know. I feel like I, I could go, um, I could look for something where I can find myself being more productive and thankfully I had a friend at Coinbase. I was like, yeah, like it's super chill here. And like. Yeah, like the code base is great. Um, you know, like I mentioned, there's a lot of like, uh, awesome, like developer productivity, uh, things that just make it easier for me as a, you know, individual contributor to actually contribute, uh, those, those features that, that we're trying to build.

Sophie Novati:

Got it. Cool. Um, well, let's, um, maybe transition over into another coding portion of this call. So I think maybe, um, you could go ahead and share screen.

Dan Cortes:

Um, cool. I believe that should be help on the screen.

Sophie Novati:

Yep. Cool. Awesome. Um, so the problem that we're going to work on today, um, uh, uh, it involves, uh, strings. So, um, what you're gonna be provided as input is, um, Uh, dictionary of words, but it really just is an array of words, I guess. Um, and what we wanna do is, um, fill in two functions. So one function is going to be called, um, set up and it will take this input dictionary of words. Um, and a second function called is in, and it will take a word and, um, yeah, uh, it basical, this will basically return true if it was originally in the input dictionary and it will return false otherwise. And the goal is to, um, is to do as much work as possible in the setup, uh, function to optimize, um, our is inic function.

Dan Cortes:

Okay. So I think I understand is in Dick mm-hmm , uh, because essentially that's, you know, given a word it's gonna return true or false whether or not that's gonna be in one of the original input words. Mm-hmm um, so could you explain, set up a little more like, um, yeah. What, like, why do I need setup?

Sophie Novati:

So it's gonna basically give you the list of words. Um, so let's say we call setup and then we call is in afterwards. Um, if we did this, this would return true. Um, if we did

Dan Cortes:

this, it would return false. Cool. So you can either do,

Sophie Novati:

you can either store some stuff in like a global variable. You can, you can create a class if you prefer. Um, but essentially the setup function consumes a dictionary and remembers it in some format. And, um, isn't diction reference that.

Dan Cortes:

Um, cool. I, I mean, I want to, I feel like I, I wanna set this up as a class because it feels better to like encapsulate like a dictionary in a thing rather than have like this global, uh, variable mm-hmm . Um, okay, so let's do this and I guess, would it make sense to like, would I be, should I be able to call set up later and like, um, re initialize the. Is it dictionary or, or is, is something like that, like not necessary. And the reason I ask I guess, is because if we set it up as a class, then, um, you know, we could just pass instead of having a set up, we could just pass the input, uh, to the class, uh, constructor mm-hmm and initialize the dictionary. That way. That sounds fine. Okay. Let's do that then. So we're gonna have a class that's called let's call dictionary. Mm-hmm um, wow. Coder pad, not giving me, uh, automatic brackets um,

Sophie Novati:

I think we might be able to, oh, it's it's

Dan Cortes:

all good.

Sophie Novati:

You, you have to just type in your own brackets.

Dan Cortes:

let's see how to close. There we go. Cool. All right. So dictionary is gonna have a cons uh, construction. Um, and then it's gonna have, is in Dick. That's gonna be a word and essentially, so something that I kind of like to do is just, uh, like write how I would use a thing. Um, so we wanna say cat, Karin bar let's let's just say like, test, uh, is, uh, new dictionary with the words and this is gonna be an array. Right? So cat par and bar, and then we want to test, uh, oh, why don't we like console log it. Test is in Dick cat, which should be true. And then. How about, uh, Don , which should be false. So, um, I mean, I just wanna reach for a set, I guess, here. Um, so that's not the right syntax. There we go. Uh, so words say this fixed equals new set. Um, that's a words array, I guess mm-hmm and I want to say that we have to spread it. Not totally sure about that, but I think that is how we do it. And then we can say return, this D includes word. Um, yeah, right now there's like maybe like three things that I would wanna look, look up on MDN, but let's run it and see what happens includes is it has I never remember false, false, so it doesn't have Don, so let's say console log. Cool. Oh my God. that's what it did. Yeah. I think this has to be, yeah. Cool. So we can remove the console log and then yeah. So cat is in the dictionary. Don is not, um, I will say that I do feel like using a set. It's kind of like cheating since it includes, like ISIC is essentially has, and the dictionary is essentially a set. Yeah.

Sophie Novati:

Cool. So I'm gonna, um, kind of change up the problem a little bit. So, um, now let's say that, um, given this, um, original, um, uh, dictionary as is, but now when we're calling is in Dick, we might have a wild card character. So, um, uh, as an example, um, you might have, and this isn't reg, so it's just the star. Maps to one of an existing character. Um, so this would return true. Um, and I guess, uh, this would return

Dan Cortes:

false. Cool. So the, the star can be any of one character at that place in the string, right? Yep. Cool. So, um, my first, so I kind of wanna reach for some. Um, some being like array some and like now am like, cool. Why did I use a set? Cuz I don't know what methods a set has. um,

Sophie Novati:

you can totally look up totally. Okay. To look up some tasks for anything that you need.

Dan Cortes:

Cool. I mean, let's just, um, let's do this, uh, this I guess can become includes. Um, cool. So that still works. So now what I actually wanna do is return this some, so what we wanna know is does some dictionary word match the incoming word with wild cards? mm-hmm um, you are right. that I could use a RegX for this. We could create a dynamic RegX where, uh, you know, like let's just for fun. Um, I think we could say, um, so honest, uh, template equals word. We're gonna replace that star with I got, which is like the E keyword word. And then we can say cons rags equals new rags template and then return. Test. Oh, we want the right start with that and end with that. How that works. There you go. Will this work? Uh, so cats should still be true. Don should still be false. Let's test that. True. False. Wow. That was I wasn't confident. Not gonna lie. Uh, so let's say star at, so it should be true. True. False, true, true, false, amazing. Um, let's do star a star. True true. That one should have O because it needs to be global. So we're gonna do, um, wow. Can we use replace all? I didn't know that that was a thing. Oh my gosh. That works. Okay, cool. But kind of like, uh, kind of like this said, it's like, oh, you know, like the question is clearly asking if we can do this without a rag X. So the, yeah, I mean, do, do you wanna try to do this without using like a, a dynamic rag X? I think you're muted.

Sophie Novati:

Sorry about that. um, yeah, so let's, yeah, let's try something without rag X in a bit. Um, but, um, can you kind of, um, uh, I guess break down what the kind of run time and space complexity of both the construction, I guess, in your case and the is Indic function.

Dan Cortes:

Um, yeah, so some is going to be, um, I mean the, the constructor just, you know, sets it to be an array that that would be, uh, oh one. Sure. Um, but then some would be O N since we have to iterate through every word in the, um, Zaray mm-hmm and then where I kind of like, where I guess just the answer is, I don't know is, uh, I actually have no idea what the time complexity for regular expressions is. Um, so. I know that the sum is on, but then, um, the fact that we're doing a rag X inside, I'm sure like tweaks that a little bit. Yeah. Um, but yeah, I've actually, yeah, I've never looked into RegX. Uh,

Sophie Novati:

actually I'm sure either, but I'm sure it's related. It's it's still at the minimum bounded by like length of the words. I'm sure. Um, the, okay, cool. So I guess thinking back to the original, um, prompt, we actually still want to kind of try to do as much work as possible in the construction, um, to try to optimize is Indi as much as possible. So if we can try to shift some of this work into the constructor, um, store it in however format we want to optimize for, um, the ASIC

Dan Cortes:

function. Um, yeah, for sure. I mean, so I can just convert. Um, so let's see. We could do this. We could convert the array into an object where keys and values are the same. Um, and then in is in Dick. So let's pretend we did that. And we can do that real quick in just a second, but then it, uh, we can say like, if this stick word, um, guess does not equal on defined, then we can just, and true. And that would actually, yeah, and that would be, oh one in like the best case mm-hmm . Um, and then if it doesn't exist, then we can iterate and see do any of our keys, um, match. And, and at that point, this would be, uh, an object. Values. So in order to do that, we would say cons, uh let's.

Sophie Novati:

So are you gonna still keep the reg X?

Dan Cortes:

Um, we can revisit that. Okay. Um, yeah, cuz I feel, I mean, I can think of a, another way of doing that, although it might not be like amazing in terms of, uh, time complexity, but it would, um, I guess, yeah, we can talk about like the solution and, and whether or not you want me to implement that in just a second? Uh, or we can say word map equals words, array. Um, well, let's reduce that array into an object, um, where. You know, we have the accumulator and the word, then we can say accumulator word equals word return accumulator. Now, instead of a word, Ray, we have, we, we essentially turn this like cat car bar array into an object of Kia is cat values. Cat Kia is car values, bar or car. And then Kia is bar values

Sophie Novati:

bar. And what did, what did, um, making that conversion do for us, uh, from a runtime perspective?

Dan Cortes:

Um, so I mean, we do have to iterate through the array once, uh, but essentially we are only now iterating in the constructor rather than iterating in is inic, which we would potentially be calling, uh, multiple times. Um, so. Hmm. So the value of that is that now if the word does not have wild cards, we can look, um, and, and it is in the dictionary. We can automatically mm-hmm um, I got it. Yeah. And we could even go a, a step beyond that and say like, if, uh, like word, like if the word does not include a wild card return, false mm-hmm and then we would only have to like, do the more, um, like the heavier operation, if we are, if we do have to, uh, match based on wild cards. Mm-hmm

Sophie Novati:

so how what's the kind of big O complexity of is intake now?

Dan Cortes:

So, uh, well, it, it is, I'd say it's almost like an overloaded function at this point. So like, it kind of depends. Uh, so like the complexity kind of depends on the argument. Where, um, yeah, like best case it's oh, one mm-hmm . Um, and then to check if it, you know, if it has a wild card that would be O N and then if it does of a wild card, then it would be whatever the O N plus or times the RegX, um, solution like equals. Right.

Sophie Novati:

So I guess, um, yeah. Is there any way that we can optimize this even for, for the case of a word being passed in as a wild car that contains a wild card?

Dan Cortes:

Let me think yeah. So my, I guess the first thing that comes to mind is to like, um, I don't know why, like, just like, uh, a tree like came to mind if we, uh, if we represented the words as trees, could we do this in O and time? Mm-hmm

Sophie Novati:

uh, can you describe what you mean by

Dan Cortes:

tree? Um, yes. Let me, let me think about this for just one second. Mm-hmm

Sophie Novati:

so yeah, one thing that I can, uh, that, uh, to help also is, um, if there's a, if it would help, if there's only one wild card, character,

Dan Cortes:

um, per word, up to one, I guess. Gotcha. Hmm. So I'm trying to think. Let's see. Can we, I know that we can get this to O N but I'm not sure if we can, like, is, is O N the best case scenario here,

Sophie Novati:

um, is when you say N do you mean N as in the number of words in the array?

Dan Cortes:

Um, no. Sorry. The number of letters in the incoming word

Sophie Novati:

mm-hmm um,

Dan Cortes:

yeah. Okay. So how do we.

Sophie Novati:

Because right now our O event is actually referring to the number of words. So maybe we should use different letters to denote this, but, um, right. Yeah, yeah. Yeah. Hey, as in the length of the word, and then there's O of N where N is the number of words in the dictionary. So reducing from N to K is a significant reduction.

Dan Cortes:

Gotcha. Say like, how can we represent the setup words so that we can then actually only iterate through, um, the individual letters in the incoming word?

Sophie Novati:

Yeah. And I'll say there's a, there's a number of ways to do it. Um, so, um, yeah, there's, uh, You may not may or may not need to iterate through the letters in the word. Um, there's definitely ways to do it that way, but I would say you don't have to limit yourself to that.

Dan Cortes:

um, I mean, I almost, yeah, like I feel like I, I, nothing is coming to mind. Um, if you, yeah,

Sophie Novati:

like, yes. So I guess thinking about, so let's imagine that the word only has, um, like the, the, uh, a single star character. Um, right now we have a pretty, pretty, uh, complex, or like, uh, we're we're using rag X to, to match it. Um, uh, but if we're given just a single star character, what are all the possible possible. Um, words in the original dictionary, how many possible, like words are there in the diction, in the original dictionary that it could possibly

Dan Cortes:

match? Um, for, sorry, can you repeat

Sophie Novati:

the question? Yeah. So let's say we're, we're GI given is inic and we're given star at, right. Like how many possibilities are there? Like for words in the original dictionary that possibly match

Dan Cortes:

this

Sophie Novati:

there's one now, but let's we don't, we don't know what words there are. Right. So like, if you were to check words in the dictionary, um, like, um, Like, for example, this, this couldn't be this word. Couldn't be, uh, bar, right. Like cuz the star characters here, not, not here. Right. So there's only a limited number of words that it could possibly be.

Dan Cortes:

Okay. Yeah. I mean I'm not sure what you're getting at this is, yeah, this is not like a thing I've uh, I guess yeah, not a problem I thought of before.

Sophie Novati:

Um, yeah, no worries. So like, um, like this, for example, if this was a word like this, if this word existed in the dictionary, it would be a valid match.

Dan Cortes:

Gotcha. So you just, yeah. You mean like how many literally how many possible mm-hmm guests. Okay. Then I guess 26.

Sophie Novati:

Okay. So if you kind of had to check that, um, what would be, what would be the run time kind of involved in doing that check manually?

Dan Cortes:

So in checking if I had to check star it, how many possible? Um, I mean, yeah. Is, is it 26, I guess? Yeah.

Sophie Novati:

So, so I guess, yeah. What would be, if you, if you manually checked all 26 of those, uh, of those letters. Yeah. What would be, what would be the run time involved?

Dan Cortes:

Um, I mean, I feel like this is a trick question, but I mean, it would be like, oh, 26, which we can almost like, just say it's constant time, right?

Sophie Novati:

Yeah. Um, yeah, pretty much. And it's, if it's still bounded by the, the length of the word K, but, um, but yeah, essentially, um, because it's a fixed. Number of, of checks. Um, but I guess like, yeah, to, to kind of, um, push us further here. Um, is there anyway,

Dan Cortes:

I think, I think I see what you're getting at. So, I mean, I think I'm not, I'm not positive. Okay. um, but would that mean that we can just, it's not quite brute force, but just iterate through every potential word that for instance star at could be yeah. You check that against our dictionary.

Sophie Novati:

Yeah. Um, that could, yeah. That's like one potential solution. Um, yeah. And I wanted to ask actually to, to actually push, push on this further, is there a way that we can actually further optimize this such that we don't even need to loop through that? Like, is there a way that we can get something stored in our dictionary, such that we, all we have to do is a very simple look up.

Dan Cortes:

something stored in our dictionary. Mm-hmm

Sophie Novati:

and thinking about like cat, for example, um, thinking in the reverse, like, what are all the possible inputs that we could get in is in Dick? That that would be a valid match for the word cat,

Dan Cortes:

um, like star it C star T and CA star

Sophie Novati:

mm-hmm . And can you use that, use that in some way to try to shift as much work as possible into the construction?

Dan Cortes:

Um, yes. Yeah. I mean, I, it feels I could be wrong cuz like, again, this is not a solution that I've necessarily like thought about before, but like, it feels like a lot of work in the constructor cuz we're essentially creating like a, a dictionary of every possible permutation, um, for the wild cards. Mm-hmm but let's do it, whatever

Sophie Novati:

okay. so if we store, um, the wild yeah. Store it that way, what's kind of the space runtime space complexity of each constructor and is a new

Dan Cortes:

now. Um, so it would be the length of the words array. and the word the, yeah, like now it almost depends on the words array and the individual, uh, words in that array. Mm-hmm . Yeah. Um, so yeah, like, as you mentioned earlier, it it'd be like, oh, like end times, like K. Um, but it does give us then, oh, one four is in Dick, so cool. I mean I'm down. Let's do it. Yeah, let's do that. okay. So it's sweet. Um, so now we have our word, um, essentially our word map is going to not only store the word, but then also, um, let's say word split, um, or each. Letter and I, so let's think, I guess we don't. Yeah, so we need, um, let's partial word is word partial word. I is a star and then act and for what it's worth, this doesn't need to be, uh, the word. It can just be true. So now you can just say act partial word equals. True. Cool. And then, oops. This will no longer work. Um, let's just verify that, uh, treat your false and not assign to Hmm. To read only property. Zero of strength. Okay. Um, weird. I thought you could do that. Let's see. Oh yeah, no, that's not gonna work. Wow, cool. Now I'm gonna get tripped up on like literally modifying one word or , uh, one, uh, character in a word. Um, Let's do you mind if I just like look up on end? Is there like a replace character at, um, can we slice. Um, cool. So we want essentially to say like, um, I'm actually gonna do this in console here, so we're gonna say bar word equals. Hello. Start we actually want end to be I plus one. Um, can you still see my screen?

Sophie Novati:

Uh, I can, but you might have, uh, made this window smaller to, to look up resources.

Dan Cortes:

oh, gotcha. Here. Let's see if I can do that again. Looks better. Cool. Is that working?

Sophie Novati:

Yeah, it's

Dan Cortes:

good. Um, so let's see. So I'm trying to figure out, let's see. I plus one and let's just console log. Nice. Cool. So then we want cons partial equals template strings start star. And does this work true? True, and defined and defined. So we actually want this to be four. There we go. Hey, sweet. Nice.

Sophie Novati:

uh, got it to work. It's always a simple thing. Second um, yeah, maybe we can try one where with the, like a valid wild card input that actually should return

Dan Cortes:

false. Um, so sure. Okay, cool.

Sophie Novati:

Uh, yeah, looks good. Um, and we don't have to code this version up, but I guess as a final twist to, um, this problem, uh, how might you adapt this, um, algorithm to work? If there were any number of wild cards that could come up in the is Indic function.

Dan Cortes:

Um, yes. So I think that, you know, like building every permutation and storing that in our dictionary just might be like, it might be a lot. Um, so if there were, if we had to support multiple wild cards, I'd probably go back not to like a RegX necessarily, but just something that like iterates through the letters in the word. And I guess the idea that I was playing around before was like, could we make like some sort of object mm-hmm like this? And like, honestly, like, I don't know if this would work or how I would go about like actually implementing it, but essentially like building like a character map of like the words and, um, like. so I think the, the example like explains it better, but so for instance, um, maybe it's like true or something or just, yeah, like some, you know, to actually have it be an object, um, that is valid, but for instance, like cat and car could be combined into this object of like C a T uh, you know, CS, the first letter a second T is the third. What happens when

Sophie Novati:

you get a wild card? How do you look it up

Dan Cortes:

then you would have to just like, I guess skip it and potentially look up the next character. Mm-hmm like find the ones that have the next character in there. Um, I feel like that might be, I don't know if that would give us like an actual advantage in terms of time complexity. Um,

Sophie Novati:

If there's a lot of wild cards, you'll have to do like a lot of splits of potentially up to 26.

Dan Cortes:

Um, yeah, no, that's a really good point. I mean, yeah. Like is there, is there eventually like a set of, uh, requirements where just like iterating through, you know, the words in the dictionary, like character by character, like eventually becomes more beneficial.

Sophie Novati:

Yeah. So the one, one thing that you can to build on top of what you were building and with the object, you could actually have an explicit star character, which essentially is like very similar to what we did here, um, in, in storing in a, an a dictionary or a set. Um, but instead of having just like cat, you could also build up all the like versions where each, each letter also has a star so that you can actually just step through. Um, yeah, that's like. One thing that you can do, but then also like building up the, um, the, the, the dictionary, um, of all possibilities is obviously not probably something we would do in, in practice, but, um, for the purposes of this, um, exercise could also work cuz it's still oh. Of one, um, lookup, right? Yeah. Well, cool. Um, yeah, I guess that was the, that was the problem. Uh, yeah. What would you, would you think of the, the problem ? Dan Cortes: Um, yeah, and I mean, I, um, I don't know if I would've come to the conclusion of initializing the dictionary with the wild card on my own. Um, I feel like, yeah, like the trade off there of building this potentially like very large object, um, Front versus, and, and getting that oh, one lookup time in the is inic function. Yeah. And, you know, just having the is inic function have to do a little bit more iteration. Um, yeah, for me, it's like, I, I don't actually intuitive. Yeah. You're trying to optimize both

Dan Cortes:

right, right, right, right. Um, but yeah, no, like once, once I, it obviously took me a second to understand like the, the solution that you were proposing. Um, but yeah, like once I got, it was like, oh yeah, of course we could do that. Uh, so that's yeah. I'll, I'll definitely like, keep that in mind whenever I'm doing like, um, stream manipulation stuff in the future. because yeah, fun fact at Albert, I worked on a text, like quite a lot, so I, and that was very like RegX based. So I always,

Sophie Novati:

you were really fast at implementing RegX. I was like, usually like, people don't try to do that because they assumed they syntax was gonna trip them up too much. you just like busted it out?

Dan Cortes:

yeah, I know. Yeah. Worked on a text editor for a very long time, um, on it, but I mean, so that solution to, you know, I, I would've even like, if, if I didn't know regex, I, I would've just iterated through each character and been like, you know, does any word have, uh, you know, like, does it start with a C at this index? Or, um, but like the time complexity there would be like absolutely garbage . Um, Yeah. Yeah. Cause we we'd essentially be like iterating through every word in the, in the setup array.

Sophie Novati:

Yeah. Yes, yes. Yeah, yeah.

Dan Cortes:

Yeah.

Don Hansen:

How did it

Sophie Novati:

go? I think it went, um, pretty well. Um, um, I have lots of comments though. Should I like, um, yeah. Should I just go through them? Yeah, I was typing up some things I wanted to say afterwards, but, um, yeah, to me it was very clear that, um, you know, Dan was very fluent and comfortable in JavaScript, which is just a really good sign. Like, um, he used pretty like Javascripty ways of, of structuring his code, which, um, you know, like I feel like when I interview some, some really junior people, it's like, um, I feel like the, you know, I, I see like standard for loops and, and, and like just more verbose code. And so, um, the code was really fast and fluent and to me that was, um, probably the thing that would make me, um, Lean towards, yes, because like, clearly this person knows how to, uh, write code in production. So I think, um, a few kind of comments and you want me to do this here and not like later? I,

Don Hansen:

I, yeah. I'll show 'em the comment and you guys can talk

Sophie Novati:

afterwards. Okay, cool. Yeah. So. I think, um, to start from the very beginning, um, there's uh, in the behavioral section, I think, um, I actually probably would've gone, typically pushed more in a, in a real interview, but I did wanna focus as much as possible on the coding portion. Um, I think that, um, I think one of the points I wanted to make is anytime, like there's like really short periods of like employment, like you're always gonna be asked about it. It's not a problem. Um, but you're gonna need to explain. Um, and I felt like the explanation was slightly negative. Um, and I always think that you should try to frame kind of what you wanted out of the next position, rather than what you didn't want from the current position. Like you can always make the exact same statement more in the positive, um, sense. Um, but I don't you talking about Glassdoor? Yeah. Yeah. Okay. Yeah. Um, right. Like instead of saying, oh, I didn't like this about, uh, Glassdoor, um, saying like I was looking for a code base that did more X, um, instead of like. I wanted to get away from code base that did why. Um, so that's like, I think just a very easy shift to you can always restate anything that's negative to the positive by doing that. Um, but I don't think it was extreme. So totally fine. Just a little note. Um, I think during the, uh, coding portion, um, I felt like overall one of the weaker points of the interview was actually just actually going into code quite quickly. Um, so there wasn't a ton of. Um, collaboration and, um, and questions ahead of like each, each segment where we coded, I felt like every time I presented something, it went to code pretty quickly, which meant that I didn't have, I wasn't able to kind of guide directionally, like, cuz he just started coding right away. So a couple examples are, um, there's like some things where there like, um, kind of edge cases weren't clarified, for example, like with string questions, like asking about case sensitivities, like, um, one that's that's good. Like do you consider like capital cat the same word, right. Things like that. Um, and kind of aligning on approach before going to code, for example, with the reg X thing, it's like, um, , you know, it might take a few minutes. Um, the, the good thing is he did it really, really fast. So I actually don't think it hurt him at all. And in fact, it was impressive. I was like, wow, you actually got it done. Cuz normally I might have advised like, oh, let's not, we don't need to go down that route. But then, uh, how quickly he did it was actually ended up being impressive. So, um, I think maybe more aligning more questions could have been helpful. Um, and in general, like this particular question, the, one of the reasons I like it is actually, there's just like a lot of different optimizations that you can make. And there's a lot of analysis that we can have in conversation that's outside of code. So, um, and then, um, I wanted to point out one particular kind of segment of the interview, which was, um, the, the, I think an inevitable trough that every good interview I think has, which is when you're totally lost. Um, and how you handle that. And I think is one of the most important, uh, like behavioral, like. Pieces performance wise that you can have. And, um, I think Dan did pretty well there, but, um, I think, I think it was kind of like neutral maybe. Well , um, like I think there was slight frustration around, okay. I haven't seen this type of problem before. Um, and yeah, I think that, um, I think just going into every interview, kind of like with the expectation, like I'm gonna be in a moment where I have no idea what to do, um, and just be ready to like, kind of like have a positive attitude working through it rather than, um, like, Hey, I don't know. I don't know. Um, but again, I actually don't think it was extreme overall. I would've gone. Yes. In this interview. Uh, these were just some minor flags and then the impressiveness of just the execution speed and, and, um, and, uh, kind of cleanness of the code, uh, generally, um, kind of clearly puts this in a yes bucket for me.

Don Hansen:

okay. Uh, that was a lot of, a lot, really good feedback. Um, I know Dan personally is gonna really appreciate that. Uh, so I definitely wanna talk afterwards. Yeah, that's

Dan Cortes:

all

Sophie Novati:

awesome. Well, I guess I'll maybe see this after

Don Hansen:

yeah, he'll see it for sure. Um, so this is kind of like a mock position for a fake company, right. And it was a, a practice interview for more of a, a senior level position, correct?

Sophie Novati:

I, I suppose, yeah. I was, that was what I was thinking in my head, but yeah.

Don Hansen:

Okay. So I guess, you know, from Dan's performance and how he did with the interview, um, what kind of, and what level of positions do you feel like he would be qualified for in this company?

Sophie Novati:

So, um, I would say that coding interviews, it's really hard to place people into seniority buckets based on the coding interview. If I was doing that, or if I wanted to do that, would, I would definitely have to push a lot more on the behavioral portion of the interview. Um, so there's certain types of interviews where like the expectation is, is more split. Um, this was primarily an algo interview, which usually is like maybe 80 to 90%, like just coding, um, very light questions. But I think there's some interviews where it's like, you know, 20 to 30% maybe behavioral and we get more in depth than a particular project. Um, so, and I think more senior people that like will, will face that more. Um, the other thing is, um, systems design interviews are better at judging seniority, I think, than just the coding. Um, , but I would say that based on like the resume alone , but then also kind of like the fluency of the code and how like clean the code was like, tell, like gives me indications that this person seems to have worked in like a high quality code basis before and is really like solid. So yeah, I would, I would say there's not a lot of signal on like seniority. Um, uh, but you know, I would say that this, this passes the bar for, um, like a senior ish level coding only interview. And I wouldn't rely on other interviews in the loop for other skills important to senior engineers.

Don Hansen:

Okay. All right. Well, thanks so much, Sophie. Uh, I'm gonna toss you out and bring him in, stick around for a little bit, if you can, and we'll bring you back in will do all right. How's

Dan Cortes:

it going, Dan? Hey, can you hear me? I can loud

Don Hansen:

and clear. Cool. So how'd it go?

Dan Cortes:

Um, so I think. I think that, um, since here, I'll say this, when I, when I can actually like accomplish a task in any way, shape or form, be it like brute force or most optimal, I tend to feel pretty good. So so yeah, I mean, I feel, I feel like I did a, a fine job, um, especially given that, you know, we were definitely trying to like, um, do a task and like the, I guess, like the bar for like most optimal being like, oh one for this type of problem just seems like, you know, high and one that I didn't like necessarily get to without help, but like the fact that like, we were able to proceed through the interview and kind of like knock out some of those, uh, initial requirements, um, yeah. Gave me like a pretty good, yeah. I feel, I feel good. Um, I think it's funny cuz like once. um, you know, like there was that moment where, uh, Sophie was kind of explaining or like almost like leading me to that, uh, most optimal solution. And it was like hard to like, she clearly like, knew what she was talking about and she, you know, like she had this idea in mind for like a way to do this and like what ultimately ends up being like, um, oh one, which is awesome. Um, but for me it was like, oh man, like, what's you trying to say? Like, I, I , uh, you know, it took me a second to get there, but yeah, like once, once we got there, then it was like, oh cool. I understand what you're saying. And that's, what's really funny about stuff like this, cuz like it's like the concept is the hard part, like writing the code is, I mean yeah, at this point it's been, yeah, I've been doing this for, I've been writing JavaScript for long enough where it's like, I can translate the concept into code, but if I don't know the concept, well I'm gonna struggle um, but yeah, no, I felt really good about it. Um, . Yeah. And I was just actually thinking of just like, oh, what other ways can we do this? Um, and yeah, I, I feel like I, I thought of an interesting one. Um, I might ask Sophie what she thinks later. Okay. That sounds

Don Hansen:

good. And yeah, I'm, I'm glad you did struggle a little bit. I knew she would be the person to challenge you. I, I knew she'd be perfect for it. And you know, a lot comes out in an interview and just even like how you handle the situation, even just, you know, working with her, to be able to figure out the optimal solution that she's aiming for and how you go about it. Um, it's really interesting to see that, um, because a lot of people struggle with that concept. I think a lot of people are gonna love to, you know, watch you work through that. Um, but what are like, what's one main thing that you can improve looking back at your

Dan Cortes:

interview. Um, so let me think. I mean, I think I kind of hinted at this towards the very end when Sophie asked, uh, how it went, but I, I have like, you know, you tend to fall back to the tools that you're familiar with. Um, so to be honest, I don't know if I would've come to the, um, you know, dynamically building a dictionary with wild cards included. Um, because like, that's just a concept that I haven't like thought of. So I think just like trying to broaden the scope of potential solutions for stuff like this, um, would be helpful for me cuz it's, you know, it's one of those things where like, you don't know what you don't know. Um, and now I'm like, oh cool. Yeah. Like, you know, this solution makes sense. I can probably like, you know, I I'm likely never gonna have to solve this exact problem in the future, but one similar to it might come up and you know, if performance, uh, is. You know, super paramount then. Yeah. Maybe like doing a lot of upfront work so that you can get those, uh, that improved performance down the line might be like a, a good way to think about things. And I feel like this definitely like, taught me that cuz like, even with the original question, you know, like my mind was immediately like, why do I need a set up function? Like we can, we can literally just take the array, do a, do an includes or whatever, but like, yeah, like maybe, oh one isn't the best, uh, solution. Like maybe there's an actual like benefit in, in having this be like, oh one, you know? Um, but yeah, no, I think, yeah, that was like probably my biggest takeaway. Okay.

Don Hansen:

All right. Um, and I'm gonna share the feedback that she shared as well. Um, like I said, it was fun to watch. So, uh, I guess one more question for you going through this interview, do. what impression do you feel like this interviewer gave about the company that she's recruiting for?

Dan Cortes:

Um, so I mean, if I was interviewing for a like front end position, um, I think that this might be like, you know, not the most, I ideal just because like, this is not very like fun and related and it's very like, it's super Argo heavy, but that said, um, I think that this kind of question to me, like suggests that they're looking for people who have like a very strong understanding of, um, like fundamentals. Um, and it's definitely, I mean, it, it not gonna lie. It was a super interesting, challenging problem. Um, so like I had fun with it. Um, also the general, I guess, the general format I enjoyed, um, it was very like, you know, collaborative, um, which. You know, made me think that like the person that's actually interviewing me is also like, you know, highly technical, which is always appreciated. Um, yeah, I think, yeah, if I had any feedback, it did seem like we were, I guess, like striving towards a specific solution and it was maybe like more difficult to like, I didn't, I didn't know that upfront and maybe would've rather like, you know, been told that a little bit more explicitly. Um, but I mean, overall I think I had a really positive experience. That's the end of the

Don Hansen:

interview. If you liked it, please consider liking the video. It really helps boost the video in the algorithm. And I really appreciate Sophie and Dan for doing this. It's really hard to do something like this on camera in front of thousands of people. So, you know, props to both of them, but, uh, you know, Sophie, uh, is the CEO of formation and you know, what they focus on is helping early software engineers prepare for kind of like mid to senior level roles and technical interviews. Um, especially harder to get into companies like Google, Lyft, et cetera. So, you know, if you feel like you need that extra prep, feel free to check out form. maybe it's for you. Maybe it isn't, but check 'em out. Uh, but either way, uh, I'm gonna go ahead and link their socials in the description below. At the very least, I'm probably gonna link their LinkedIn so you can connect to them there. Let 'em know what you think, but more importantly, uh, we're probably all gonna be checking out the comment. So please leave a comment, let us know what you think of it. And if you wanna see more mock interviews like this, let me know as well. Thanks for watching everyone. And I will see you in the next podcast episode.