# Python Interview with a Salesforce engineer

### Interview Summary

**Problem type**  
Make change  
**Interview question**  
1) Given two strings, is one of the strings a rotated version of the other?  
2) Given an array of numbers containing pairs of numbers, except for one single number, find the single number within the array.  
3) Given a dollar amount and a list of denominations, find the count of the optimal way to make change.

### Interview Feedback

**Feedback about Mighty Lemming (the interviewee)**  
**Advance this person to the next round?**  
Yes  
**How were their technical skills?**  
3/4  
**How was their problem solving ability?**  
4/4  
**What about their communication ability?**  
4/4

**Feedback about Epic Cheetah (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

### Interview Transcript

**Epic Cheetah:** Hello?  
**Mighty Lemming:** Hi. How are you?  
**Epic Cheetah:** I'm doing well. How are you?  
**Mighty Lemming:** I'm well. Thank you.  
**Epic Cheetah:** I'm an engineer with Salesforce.  
**Mighty Lemming:** Okay.  
**Epic Cheetah:** And I'm just you know, this is my second time on this platform, I'm just trying it out. By way of introductions, you can contribute as much as you're comfortable with.  
**Mighty Lemming:** Okay, well, I'm a self-taught programmer. I'm still looking for my first gig, so I'm using this platform to improve my coding skills and to my interview skills, as well as communication skills and I've been using it for a couple of months.  
**Epic Cheetah:** Nice.  
**Mighty Lemming:** And I'm really excited about it.  
**Epic Cheetah:** Cool. Cool. So did you say you are already working somewhere or are you trying to get into programming?  
**Mighty Lemming:** No, I'm still trying to get my foot in the door. I'm on the way hopefully.  
**Epic Cheetah:** I'm just trying to gauge, you know, the complexity of the questions I should start with. So do you understand the concepts of big O? Like time complexity and space complexity?  
**Mighty Lemming:** Yes. I mean, I might be confused once in a while like everybody else, but I understand the general picture and I can do the goal of space and time complexity analysis.  
**Epic Cheetah:** Okay, cool. Let's start then. You can choose whatever programming language.  
**Mighty Lemming:** Okay, I would go with Python. Python 3.

### Problem 1: String Rotation

**Epic Cheetah:** So, let me go ahead and clear this and get you your first question. So I'm gonna give you two strings. So what I want you to do is write a function that would output true if the second string is something that can be found by rotating string one.  
**Mighty Lemming:** Okay.  
**Epic Cheetah:** If you can get string two, just by rotating string one, then I want it to be true. If it is totally something else, like you have something that's missing let's say, you can't rotate a to get, in that case, I want the function to return false.

**Mighty Lemming:** Okay. The question seems clear.

...

**Mighty Lemming:** So, I checked the bill here. I checked that it's less than or equal to amount. Now what I'm gonna do is, when I'm gonna divide my amount by that bill, it's gonna tell me how many times I can use that bill. So instead of adding one to result here, what I can do is divide my amount by that bill, it's gonna be a number of these bills I've used on adding it to my result. And I also need to update my amount. And the amount that's left is gonna be the remainder of this operation. So remainder is modulo and then amount is gonna be equal to amount module bill, and that's gonna be my new amount. Right? Shall I run the code and give it a try?  
**Epic Cheetah:** Yeah tru, try to run it.  
**Mighty Lemming:** Oh, that was fast. That was really fast.

### Conclusion

**Epic Cheetah:** I think you did very well there. For someone trying to get into the software industry, you did fantastic, so yeah. You have very good communication skills, you can think out loud clearly, you know, go through base case, there's a brute force, explain the time and space complexity, and then build on top of that while trying to work on your optimal solutions, yeah I think I'm very happy with the way you have proceeded in solving these problems, nice.  
**Mighty Lemming:** Thank you, thank you very much. It's very kind words and it's very good to hear. I mean, I know I'm on the right track, thank you.
