Watch a technical mock interview with a Square engineer
Eponymous Squirrel, a Square engineer, interviewed The Phenomenal Lemur in Java
Share
Summary

Problem type 

Sleep sort

Question(s) asked 

Given an array of integers, sort the list by spawning new threads and sleeping for the amount specified by the integer.

Feedback

Feedback about The Phenomenal Lemur (the interviewee)

Advance this person to the next round?
  No
How were their technical skills?
2/4
How was their problem solving ability?
2/4
What about their communication ability?
4/4
I would focus on two things: * try more practice problems to get more familiar with Java, if that'll be your language of choice for interviews; I'm a fan of https://projecteuler.net/ for practice problems * try to get to running code as soon as possible after starting on a problem; it makes iterative improvements possible, and also allows the interviewer to suggest specific places in the code to move forward Again, great job being communicative throughout the process! G'luck.

Feedback about Eponymous Squirrel (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
What worked well was giving me the liberty of using the internet to work out a problem like I would need to do in a real working environment. What I learned was to make sure I ask questions to clarify any uncertainties. Also, that I should try to use example code found online and modify it to solve the problem. This was a new and challenging experience for me and I really appreciate you helping me improve my interviewing skills.
Transcript
The Phenomenal Lemur: Hello. Eponymous Squirrel: Hey, can you hear me? The Phenomenal Lemur: Yeah, yeah, I can hear you. Eponymous Squirrel: Great give me a second. The Phenomenal Lemur: Okay. Eponymous Squirrel: Alright. How was your Thanksgiving? The Phenomenal Lemur: Good and yourself? Eponymous Squirrel: Not bad, I tried to go snowboarding but there was no snow to be had. The Phenomenal Lemur: Where do you live by? Eponymous Squirrel: Oh, California, so I went up to Tahoe Lake. The Phenomenal Lemur: Lake Tahoe or Tahoe Lake, is that different? Eponymous Squirrel: Lake Tahoe yeah. Yeah, it looks like it's starting to snow this week. So I just tried a week early. Yeah. Tell me a little bit about yourself. How did you arrive here? What are you looking forward to? What are you trying to get out of this interview? The Phenomenal Lemur: Okay, I'm student right now at Oxnard college and I'm transferring next fall. I'm a code 2040 finalists, so I guess my next step is to interview with companies and try to land the internship to be a full code 2040 fellow. What I hope to get out of this is just to, I guess, improve my interviewing skills. This is, I've only had a few interviews, so I'm trying to like improve the way I interview and my knowledge on how to properly answer these questions. And then as far as what language I use for these interviews, I think my strongest language is C++, but I took my first Java class this semester, and I'm starting to use that more for interviews. And, yeah, I think that's where I'm at right now. Eponymous Squirrel: Yeah, I would definitely recommend just using whatever you're most comfortable with. People don't tend to care about what language you use, as long as you solve whatever problems you are working on. Alright. So a little bit about myself. I've been in the Bay Area for six years... six, almost seven. I'm currently working at Square, mostly as a backend engineer. And I've been that Square for three and a half years. And I've mentored with code 2040, 2 years ago, and then I've just been in and out, trying to help wherever I can. The Phenomenal Lemur: Did you go to school in the Bay Area? Eponymous Squirrel: No, I went to school in the Dominican Republic. So I moved out here after graduating. The Phenomenal Lemur: And you're a code 2040 fellow, you said? Eponymous Squirrel: No, I'm been a mentor. But yeah, let's get started. Let me just come over here and paste a question. So yeah, sleep sort, a horrible algorithm, read through it. Let me know if I can clear anything up. The Phenomenal Lemur: Sleep sort, a horrible algorithm. Okay? So the integers, are they all positive integers? Eponymous Squirrel: Let's start with that assumption. The Phenomenal Lemur: Okay, all positive integers. What do you mean by create a new thread for each integer? Eponymous Squirrel: So are you familiar with threads? The Phenomenal Lemur: No. Because when I picture a thread, I picture like a thread in a forum. I Eponymous Squirrel: So in programming languages, threads are just a way of being÷ able to do concurrent programming, so parallel programming. So in the same program, you can have three threads running code, and they're running it at the same time. So imagine a thread is just a piece of code that's running independently and concurrently of other pieces of code. The Phenomenal Lemur: Hmm. Okay, I think that's... because the way I thought programming is that, like, it runs each line of code at once, but a thread is doing multiple things at once? Eponymous Squirrel: Yeah, it's a way of being able to do multiple things at once. Yeah. The Phenomenal Lemur: Okay. And when you say sleep for the integer value, that means it would pause for the integer value. Eponymous Squirrel: Correct, yes. The Phenomenal Lemur: And pause, seconds or milliseconds? Eponymous Squirrel: Doesn't matter. The Phenomenal Lemur: That doesn't matter. Eponymous Squirrel: Yeah, that's my question, does it matter the time units that we use. The Phenomenal Lemur: I would think it would. Eponymous Squirrel: How would it matter? The Phenomenal Lemur: Would it affect the other programs? Eponymous Squirrel: Well, but if all the threads are using the same time units, whether we scale it up or down, all them would be the same amount right? Or the same in reference to each other. So given that you have all these threads running and each one is sleeping for the about, can you see how this algorithm can take an unsorted list and turn it into a sorted list? The Phenomenal Lemur: Yeah. Eponymous Squirrel: So can you walk me through an example? The Phenomenal Lemur: Okay. So you're saying for an example of that unsorted list to make it into a sorted list. Eponymous Squirrel: Yeah. The Phenomenal Lemur: Why don't you just use like a sorting algorithm to sort one of them? Eponymous Squirrel: Oh, yeah, well, you could do that. But I'm using these three steps, you should be able to get a sorted algorithm just with these three values. The Phenomenal Lemur: Okay, and then... Eponymous Squirrel: So for example, let's say that we take our first three numbers, 3 1 5. So we're going to have three threads. And so let's just sort of pseudocode this out here. So according to our algorithm, one of them is going to be five, one is going to sleep one, then this one's going to sleep three. So out of these threads, which one would finish first? The Phenomenal Lemur: The second thread. Eponymous Squirrel: Right? And so we say... the algorithm says that once it's for the integer value, then we add it into the resulting collection. So let's say that we have a result here, and we're going to add that value. And so like you, like you said, the first thread that's going to finish is one. So result is going to be going to have a one at that point. What's the second thread that we finish? The Phenomenal Lemur: It'll be the first one. Eponymous Squirrel: Right. And then after that, the third one would finish. That's how like after the first one should be this, then it would be this. And finally you have all three. So you get now how the algorithm works? The Phenomenal Lemur: Yeah. Eponymous Squirrel: Yeah, so that's all there is to it to the algorithm, so let's try to implement it in whichever language you prefer. Since you're not familiar with threads, I would suggest using Java just because the documentation for that will be easier to understand. The Phenomenal Lemur: For my understanding is that you said to use all tools available for use for this? Eponymous Squirrel: Yep. I fully recommend you to look up documentation for this, Google for examples, etc. The Phenomenal Lemur: So in Java, is thread a class or no? Eponymous Squirrel: Yes. The Phenomenal Lemur: Yes. Okay. I guess my first step will be just to look up the thread class for Java, the docs. I guess what I want to do first is write down... So online it says every thread has a priority threads with higher priority are executed in preference it says to a lower priority. Eponymous Squirrel: Yeah, I think in this case we don't have to consider priority. So that's important if we want certain threads to have more runtime, but since in this case, all threads should have the same priority, we don't have to consider different priorities. The Phenomenal Lemur: You don't have to consider that. All right. The integers are going to be in an array, correct? Eponymous Squirrel: What would be a good API for this function? Let's just assume that it's an array. The Phenomenal Lemur: Okay. What do you mean by what would be a good API? Like you're saying? Eponymous Squirrel: Oh, I meant if we were making... let's say that we were making a class or sorry a method called a SleepSort(). So what would be a good signature for it? What would you expect to receive as input and what would be your output? The Phenomenal Lemur: In a right way? What would we want it to return? Eponymous Squirrel: Yeah, and what would we want to take in as well? Like what would make sense? The Phenomenal Lemur: What do we want to pass in, the integers in there? Eponymous Squirrel: There are several ways of passing in a set of integers, right? The Phenomenal Lemur: Yeah. Eponymous Squirrel: And so you can pick whichever makes most sense to you. The Phenomenal Lemur: Okay. So maybe I'll probably go with an ArrayList right? Eponymous Squirrel: Okay, that makes sense. The Phenomenal Lemur: Oh, it's already there. And we want integers right? And then I guess I'll do... I'm just going to add some numbers to it. Eponymous Squirrel: Sounds good. The Phenomenal Lemur: And then just so I could write some tests. And then I'm gonna print the sleep sort method. And then I pass in nums. You want it to return the integers in sorted order, right? So does it matter the way you want it to be returned? Eponymous Squirrel: What do you mean? The Phenomenal Lemur: So, like comma separated or just like a space separated or just like? Eponymous Squirrel: Oh, just like you said that we're taking an ArrayList here. We're taking... or let's just say a list of integers here... I think we can just return the same here. The Phenomenal Lemur: Okay. Eponymous Squirrel: And then you can format it however you'd like after the fact. The Phenomenal Lemur: So this will be a multi threading problem, correct? Eponymous Squirrel: Yes, correct. The Phenomenal Lemur: So it said I could create a thread by extending the class... Okay so sleep sort... I'm going through their thread docs right now. I guess there's three ways... or various ways to create a thread. I'll go with extending it. I'm going to loop through the list. I need to figure out what runnable does. Do I need to create a separate class or does it have to be a method? Eponymous Squirrel: No, you can create a separate class. Absolutely. The Phenomenal Lemur: I'm looking at... code on GitHub. I'm going to try to use that to try to figure out how to work this out. Looks like they're using some classes. I need to look up and figure out how they work. Eponymous Squirrel: So you have mentioned inheriting from threads. The Phenomenal Lemur: Yeah. Now I'm looking at some other code that I found online where people did it. They use two different classes. Eponymous Squirrel: How did the two different classes interact? The Phenomenal Lemur: So the other class kind of just calls the sleep sort class and other ones a lead sort test runner and that one just calls the sleep sort class and then calls like a sort method and passes in the integers in there. Eponymous Squirrel: I would still recommend going to the inheriting from thread class, I think that might be an easier implementation. The Phenomenal Lemur: Easier, okay? I will just expand... Eponymous Squirrel: Or not the solution actually, you could extend like down here. The Phenomenal Lemur: Extend or implement? Eponymous Squirrel: Yeah, I think or it might be extend because I think thread is an actual class, not an interface. Yeah, so the sample that I'm seeing from the Oracle docs has something like this. That's the class that's gonna be running the thread. Especially run the code you would do what's underneath there. The Phenomenal Lemur: Okay. This changes back. In the docs, they use extend. Should I use extend here? Eponymous Squirrel: Yeah. The Phenomenal Lemur: Loop through the values. Eponymous Squirrel: Okay, so what's your approach here? The Phenomenal Lemur: I'm still going through some docs, trying to figure this out. I see some people using hash maps. I'm kind of lost right now. Eponymous Squirrel: Um, so let's see. So in this prime threads example, it looks like they have a constructor and then they have this run method. And inside of the run method is where all the logic happens. So if we were re implementing that here, let's see. We'll need a constructor for our SleepSort class. Let's have an empty constructor for now. And then we want to implement public void run. So here, according to the algorithm here is where we sleep for an amount and then push into a results. Does that make sense? So, how can we implement line 32 and 33 here? The Phenomenal Lemur: Go to sleep for an amount. That should call this sleep method. Eponymous Squirrel: Yeah. The Phenomenal Lemur: Which causes the thread to sleep for a specific number of milliseconds. Alright. Okay, so we want it to sleep for a certain amount of time. So I guess here we would pass in the array of integers right and then we will pass it into the sleep method. Eponymous Squirrel: Yeah, that sounds good. Except that so if we change the signature then we're not overriding threads run method anymore. Which we need to do in order to... because if you look at line 56, so this p.start, this runs p.run in a separate thread. Which means that run can't take any arguments. So what's another way that we could pass in the number? Or the number that we want to sleep for? The Phenomenal Lemur: Can we make it an object? Eponymous Squirrel: What do you mean by creating an object? So to have a better idea, so here we add to each of the numbers on line 13. Then here we can say for integer n in nums. So for each one of these, we want to create a thread. And so according to this example, we would do new SleepSort. Then we do thread.start. Yeah, and so then this would run, but this would execute the run method. The Phenomenal Lemur: To begin executing, okay. Eponymous Squirrel: So the question is still how do we make it so that all the numbers here... The Phenomenal Lemur: And we call thread.run and then test them. Eponymous Squirrel: If we do that, it will just run it in the same thread. Like it won't do anything different from calling a method. So it would be synchronous if we did that. And so what's the way we can make data accessible in this run method. The Phenomenal Lemur: Making the ArrayList global. Eponymous Squirrel: That's one way. Yeah. What else... When you're creating an instance, what's the way that you can pass data to the instance? The Phenomenal Lemur: The constructor? Eponymous Squirrel: Yes, okay. Could we pass? The Phenomenal Lemur: So yeah, when we make a new constructor pass in here? Let's make a new list of integers. Eponymous Squirrel: And does that have to be a list? It sounds like we're creating a new thread for every number. And we're already doing that on line 15. The Phenomenal Lemur: So make a new thread. Eponymous Squirrel: So, we're already creating a new thread on line 15. And so here, all we need is to set up the data run, the sleep and top portion of the algorithm. So in order to do this, those two steps of the algorithm, what data do we need? Or what data structure do we need? The Phenomenal Lemur: So we just need the array? Eponymous Squirrel: Well, but we're not... So in thread up here, in the sleep sort thread, it's a single thread, and we need many threads to run concurrently for the algorithm to work. So passing in the entire array here is unnecessary, we just need to know how long a single thread is going to sleep for. So for example, if in line 15, we pass in just num. Then here, let's say that we have integer, so that's how long we're gonna sleep for. Then down on line 39 we could sleep for that amount. Does that make sense? The Phenomenal Lemur: Yeah, yeah. Eponymous Squirrel: So now this would run in a separate thread. At this point, we just want to... just to see that. I think this is thread.sleep. Let's push now. So let's see. We have an extra at the bottom. Let's say that there's no method add for... Oh, because we're trying to add a string, I think and it's expecting an integer. And I think it can't find sleep sort because it doesn't exist that way. And then thread dot sleep throws an exception. So let's just catch it and do nothing. So it's kind of hard to understand, but so let's sleep for a little bit longer so that it's easier... So in this case, we're going to be flipping for sleep amount of seconds. In line 36, are you with me? The Phenomenal Lemur: Yeah. Eponymous Squirrel: And so when we run this, we should see that the thread prints out on line 37, it should print after sleep amount seconds have passed. And since they're all running concurrently, then they're all going to start at the same time. So the first one should print after one second. And then after three seconds, the next one after five. So one second passes, three seconds pass, five seconds pass. So if they weren't running concurrently, then it would take three seconds after the first one finishes, and five seconds after the second one finishes. But instead it takes however long from the beginning of the program. The Phenomenal Lemur: So when you make a thread... So the thread starts here. And then these are individual threads. Eponymous Squirrel: Yeah, so we're creating a thread for every single number in nums. So yeah, so in line 27. When we're creating this constructor, this is a single thread. The Phenomenal Lemur: So there are four threads while the program is running? Eponymous Squirrel: Three threads that we create, plus a main thread. Yeah. Yeah, so we are still missing one part, which is adding to the list. So right now we're just printing the numbers. But we really want to do is add them to some sort of collection result that we can then print out. The Phenomenal Lemur: So this part here, the push into the result. Eponymous Squirrel: Yeah. The Phenomenal Lemur: Okay. So would it be fine just to put it in like an ArrayList? Eponymous Squirrel: Yeah, I think that'll work. The Phenomenal Lemur: So here when you caught the thread, is this creating a new thread? No, right? Eponymous Squirrel: So in this case, this is sleeping in the current thread. So this puts the current thread to sleep. The Phenomenal Lemur: Okay. We can just add each sleeping amount, right? Eponymous Squirrel: Well, not each one right? Ao I mean, this is a single thread, so we only have one sleep amount. So if we run this like it is now, every thread would have its own num be ArrayList, but we want all of them to be adding sleep amount to the same list. The Phenomenal Lemur: Oh here you're looping through the list. Eponymous Squirrel: So what are you thinking? The Phenomenal Lemur: Okay, I just looked through the docs really quick. So you're saying this would create a new ArrayList for each one? Eponymous Squirrel: Yes, because because it's inside of the run method during the context of one of the threads you created. The Phenomenal Lemur: You want to hold it somewhere, right? So we just can't print everything out. Eponymous Squirrel: Right. And so I think that the idea of having an integer array here is correct. But since we want all of them to have the same access to the same one, we can just pass it in the constructor. Let's call this result. We can say this result equals result, and all the threads can have access to the same reference. We can cut that out, just put result that I had. And then outside of here, we need to create this result list. That's it in results. So then on line 50, if we just print out a result as we're adding stuff in, we should see the result build up. We can comment out the other thing. Does that make sense? The Phenomenal Lemur: So you put in the constructor. Why did you put in the constructor again? Eponymous Squirrel: The constructor is the way that we have to pass in data into a thread. The Phenomenal Lemur: And then this way, it doesn't create various lists. Eponymous Squirrel: Right. Because otherwise, if you're creating a new one in every thread, then that result that you want to create will only have one element in it. When the result is you want to do is list with all the integers that we passed in sorted order. So in order to do that, every thread needs to have access to the same result that you're going to pass back. The Phenomenal Lemur: Okay. Okay, so I guess let me just try to run through the problem just to make sure I understand it correctly. Eponymous Squirrel: Yeah. The Phenomenal Lemur: So here is just creating an ArrayList and adding some numbers into the list. And then here this is another ArrayList for results to hold the sleep amount count. Eponymous Squirrel: It's going to hold the same integers in sorted order. The Phenomenal Lemur: So this will hold all the same integers in order. Eponymous Squirrel: Yep. The Phenomenal Lemur: And then hear you loop through the the nums ArrayList and then here you're creating an object of SleepSort. And then you pass in each element. Eponymous Squirrel: Yeah, we're passing in three, then one, then five. And the result of this. The Phenomenal Lemur: And then it's called. This executes too? Eponymous Squirrel: Yeah. So that exactly. Starts the thread and yeah, whatever we had before. Yeah, so that's what if you did call start, then you would have the thread, but the run method would never actually get called. The Phenomenal Lemur: Why would it never get called? Eponymous Squirrel: Well, if we don't have this, you created thread, but you haven't done anything else with it. Same as if you create a list or any other object, like you just created it, you allocated it in memory, but it's not running any code. The Phenomenal Lemur: Why wouldn't you call thread.run? Eponymous Squirrel: So if you call thread dot run, it's going to run sequentially. And so let's say... so when we call start, they all... were did I forget to change it in? 31? Yes. So we start, the entire thing should take five seconds, because they also start at the same time and they're running concurrently, right? If you call run, then this is not doing anything different than a normal method. So normally when you call a method it executes, and then nothing else runs while it's executing, right? Like it's sequential. So in this case, it's gonna take one second plus three seconds plus five seconds. Oh, and also it does it in the same order. So like it goes, it grabs the three, creates the SleepSort thread, then runs. And so it only calls three to resolve at that point, right? So if you call the run method, you're not starting a new thread. The Phenomenal Lemur: And that start method is from the thread class. Eponymous Squirrel: Correct. Yeah. The Phenomenal Lemur: Okay. And then this, for the sleep amount, and then this is for the result. Here in the constructor, you're passing in each element from the array list up here and the result. Eponymous Squirrel: Yep. The Phenomenal Lemur: Here when you're passing result in, isn't result empty. Eponymous Squirrel: Yeah, it's empty initially. The Phenomenal Lemur: Initially and then we... and then how does it added it to result? The result list. Eponymous Squirrel: What do you mean? The Phenomenal Lemur: Because it's initially empty, and then we pass it in here to the constructor. How does it know what to store into the result? Eponymous Squirrel: On line 50 is when we add something to the result. The Phenomenal Lemur: Okay, then we added the sleep amount, okay. And then the run function. And then the try and catch, why do we do the try and catch? Eponymous Squirrel: Because thread dot sleep throws an exception. Specifically throws an interrupted exception. So we need to catch it just because Java likes catching things. The Phenomenal Lemur: And if you don't catch it, you'll get get an error? Eponymous Squirrel: You'll get a compilation error. Yeah. The Phenomenal Lemur: And then here you add it, and then you print out the result. Okay. Okay, makes sense. This will be considered a sorting algorithm? Eponymous Squirrel: Yeah. This would be a very, very bad sorting algorithm. So yeah, that's all the code we wrote. And now we can sort any any list we want in a very inefficient way. The Phenomenal Lemur: And are there any alternative ways to like different data structures you can use to make this better or? Eponymous Squirrel: Not really, like that implementation is pretty straightforward. Like you said, Java has a lot of different ways of starting up threads. This is one of them. You could play with the others and see if it makes the code easier to follow. But over all, this is all you need. The Phenomenal Lemur: As far as runtime complexity? Is this O(n)? Eponymous Squirrel: So it's interesting, right? Because it doesn't really have to do with how many elements there are. It has to do with what the largest number is, which is not the usual thing in an algorithm right? So underneath it all, the reason why this works is because when you call thread dot sleep, the way that thread dot sleep is implemented is usually with a priority queue somewhere deep down in the operating system level or maybe the JVM level. And so, that priority queue itself is whenever you put a thread to sleep, it's putting that thread... it's sorting that thread into a priority queue that determines when it's going to wake up. And so that itself has its own complexity, which is hidden away here because the operating system just does it for us. So if we ignore that part, then it's going to be sort of O of whatever the largest number is, in terms of what's going to really make the algorithm take longer. If we're just counting the number of iterations, then yeah, it's O(n) because we just go through the numbers, go through every number, and then just start the thread and then wait for that to finish. So that's O(n). The Phenomenal Lemur: Got it. Interesting. Yeah. I think the whole concept... Eponymous Squirrel: Yeah. So when I ask people this question, it's sometimes people are not familiar with threats or at least are not that familiar with the Java API. So that's why I totally expect people to be able to look up documentation and in which case, and I'm sort of looking to see how quickly they can read an example code or read through a doc and apply it and actually come to a solution. Being familiar with the concept of threads or at least how to run code concurrently though is, it does help a lot with this particular problem. The Phenomenal Lemur: What are other approaches? What are the best approaches? Eponymous Squirrel: Can say that again? The best approach is that what? The Phenomenal Lemur: For the type of problem where I guess, figure something out. What would do you do? Like a problem you need to figure out how something works. Eponymous Squirrel: Yeah. So there are several layers. So let's say that I don't understand a particular programming concept. So let's say that happened. I've never heard what a thread is before, or I've never heard of what a Unix socket is or anything, what have you. In that case, I think it's up to the interviewer to sort of guide you and explain what the concept is. And so as I was walking through how threads work, if you didn't understand something that I explained, I would encourage you to always speak up and be like, Oh, can you actually go deeper into that? Because an interview should never be about... it's not entirely about what predefined knowledge you have, but more just how you work through a problem. After that, if I already knew how threads work, I just didn't know how they worked in Java, for example, then there are two approaches, either you can read through the documentation and get a really good understanding of how it works. But I feel that that can take a little bit longer. The other option is just looking for some example code on Stack Overflow or what have you. And then trying to make that code run here in coder pad or assuming that you're not doing some whiteboarding exercise, right? So take an example, getting it to run like actually run inside of coder pad and then starting to modify that code to make it work with whatever problem I'm trying to solve. The Phenomenal Lemur: Basically getting some code that you found online and trying to like, figure out how that runs, and then try to modify that. Eponymous Squirrel: Yeah. So I would have googled for Java thread example, copy that code, get it in here, understand how the threads are working, and then modify it to whatever specific aspects this problem has. The Phenomenal Lemur: Yeah. Yeah. Eponymous Squirrel: I will say though, I feel like a lot of... this took a lot does because if you weren't familiar with threads, and I think you could also get a little bit more familiar with Java as a whole. You mentioned that you do more C++ and just picked up Java recently. But throughout it all, I think that you were really good about communicating where your thought process was and where you are getting stuck or not. Which is, I think, worth more than people realize. The Phenomenal Lemur: Yeah, I think I was trying to read through the docs too much and I spent too much time there. But I think that approach of like taking an example and then modifying it, I think that would probably worked out better. Eponymous Squirrel: Yeah, in general, if you're trying to run your code, more often than not, that tends to guide you towards the solution that you want. The Phenomenal Lemur: Yeah, that makes sense. Eponymous Squirrel: And yeah. Anything else I can answer for you? The Phenomenal Lemur: You said you mentioned you work at Square, you said you work more with back end right? Eponymous Squirrel: Yes. The Phenomenal Lemur: What type of technologies do you really work with? Eponymous Squirrel: So on the back end, at Square, we use either Java or Ruby or Go. And we limited to those three languages because it makes overhead easier. Like if you have to switch between projects, you don't have to learn Closure or some other esoteric, more esoteric language. And that's language wise. In terms of framework for Ruby, we have Ruby on Rails. But for Go and Java, we have our own in house builds, sort of frameworks. The Phenomenal Lemur: Like private frameworks for Square that are open source. Eponymous Squirrel: They're private, so we call it service container. It brings in a lot of different things. So for example, if we're talking to the database, it will use hibernate or juke. So these are those are open frameworks, but then the way that we get them all to work together is is proprietary. The Phenomenal Lemur: Yeah. Okay, now that, uh, that problem, that was a really great example because I've met like all the other questions I've kind of like done are more like I guess more straightforward, like implementations of data structures, but I like this problem because it kind of like made me have to like, kind of figure out how to kind of put something together and look through docs and examples of code. So I thought this was a really good problem. Eponymous Squirrel: Yeah, I'm glad you found it enlightening. That's what I go for with it. Yeah, it's great to hear that you're doing practice interviews. That's definitely the way to go with this. More practice interviews you, do the better you'll get. The Phenomenal Lemur: Yeah. Well, I really appreciate your time and taking the time out of your day and helping me. I really enjoyed this and I feel like this is really this interview really helped me for future interviews. Eponymous Squirrel: Yeah, totally. Keep doing what you're doing. I think this is the right approach. The Phenomenal Lemur: Well, thank you again and hope you have a good rest of your night. Eponymous Squirrel: You too. Take care. Bye.
Want to get some practice yourself?
Become awesome at interviewing, and get actionable feedback from engineers at top companies – it’s 100% anonymous!
©2020 Interviewing.io Inc. Made with <3 in San Francisco.