Python Bytes - #150 Winning the Python software interview

Episode Date: October 5, 2019

Topics covered in this episode: How to Stand Out in a Python Coding Interview The Python Software Foundation has updated its Code of Conduct The Interview Study Guide For Software Engineers re-asse...rt : “show where your regex match assertion failed” awesome-python-typing Developer Advocacy: Frequently Asked Questions Extras Joke See the full show notes for this episode on the website at pythonbytes.fm/150

Transcript
Discussion (0)
Starting point is 00:00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to your earbuds. This is episode 150, recorded September 25th, 2019. I'm Brian Ocken. And I'm Michael Kennedy. And this episode is brought to you by Datadog. Check them out at pythonbytes.fm slash datadog. More on what they have to offer later. But, Michael, right now I kind of sense a theme.
Starting point is 00:00:24 Are you looking for a new job? Are you hiring somebody or what's going on? I'm going to cover a couple of topics about getting better interviews. You know, I kind of hope I never have to apply for a job or go to a job again in my life. So no, I'm not actually on the hunt for that. But I do have a couple of friends who are looking for jobs. And, you know, I'm just a little sympathetic to the challenges and whatnot. So I want to kick us off with a thing called how to stand out in the Python coding interview. Okay. This comes from James Timmons on and he wrote it on real python.com. So it's kind of a Python version of the stuff that it seems like
Starting point is 00:01:07 the tech industry thinks you should know. And I feel like it's a little bit better. I feel like the tech industry says, oh, you know, which is better, a bubble sort or a quick sort? You know what? I don't care. I call sort on the list and we're good. You know, I don't, maybe sorted, like you could debate dot sort versus sorted but who cares right like this is not a problem we need to keep solving and yet it feels like in the interview process it falls back to well they asked about you know big o notation they asked about like algorithms of that type they asked about a data structure like when would i use a doubly linked list versus a you know single linked list and like ah, like I can go build a Python web app with SQL Alchemy and talk to Stripe and charge
Starting point is 00:01:51 a credit card, but I forgot when I use a single linked list, right? Single direction linked list. But that seems like what people are testing. So here's an article that sort of covers those kinds of questions, but specifically for the Python developer. And I think it's pretty, pretty decent. So it's meant to help you kind of navigate that space of Python and show you that you have some knowledge of the built ins and of the language and things like that. And you can kind of write decent code. So it covers a handful of things with a bunch of other stuff mixed in there. So how to use enumerate to iterate both over a view of like collection to iterate both
Starting point is 00:02:31 with indices and values. And if you've been doing Python for a long time, that's obvious, we do that a lot. But if you come from a language like C++, or Java, or something that doesn't have this all of a sudden, well, then it's really weird, right? And you don't know to use it. So it's good to have that in there. Debugging with breakpoint formatting with F strings F yes, for that one. That's great. Sorting, right sorting lists, I talked about that, like you don't have to care about the algorithms, but knowing how to sort stuff is really nice generators and it's pressure on memory default values and dictionaries using the counter class and then just some standard library stuff and i think knowing all
Starting point is 00:03:10 those things kind of puts a nice python spin on that level of python interviewing yeah do you do any everything i haven't actually applied for a job for several years do you do it in reverse though do you hiring i mean like interview people for there, yeah? Yeah, definitely a lot. And I help out with other teams too when they're hiring. And like, for some reason, people know me as this person that knows Python.
Starting point is 00:03:32 So I'll do the Python interview part. But yeah, a lot of this stuff is stuff that I look for. If you actually say for I in length, the interview's over. Just, you don't know Python then. Yeah, I mean, maybe if you're hiring for, like, I'm hiring a developer, and they don't have to know Python, but they're going to be doing it, so we're going to help them along.
Starting point is 00:03:51 And they're really good at Java. You could probably mentor them over. But if your goal is to hire an experienced Python developer, and they don't know for item in collection, like, yeah, you're done. Yeah, but I'm a pretty fair person. I talk through stuff. People can always recover. If you freeze up, don't worry about it. Just flow with it. I think people should interview more, even if they're not looking for a job, just to keep up their interview chops. It's good. Yeah, nice. I agree. Speaking of being nice to people,
Starting point is 00:04:19 we have a bit of news. And even though I didn't even actually know this was an issue. So there was an announcement made that the PSF, the Python Software Foundation, updated its code of conduct. And apparently the PSF had one code of conduct for the PSF and things it was sponsoring, and a different one for PyCon US. And now there's just one. So that's the big news. And we've got links to the code of conduct and the enforcement guidelines and reporting guidelines. And we hear about codes of conduct occasionally and stuff. And in the past, I've thought, why do I have to care about this? I mean, just don't be a jerk and try to be a nice person. Isn't that enough? But if that was all there was to it and there weren't any problems, then we wouldn't need these. And clearly we need them. Things come up. So I think it's good for people to go. It's not a long read.
Starting point is 00:05:11 I think people should read them, especially before you go to an event to make sure you know what's up with that. The other thing that's nice to look up is what is the reporting mechanism. So if you see somebody violating these or basically just somebody being a jerk, what do you do about it? Who do you contact? And so that's good to just sort of at least have read it once so that if it happens, you can look it up and figure out what to do. At least know what it is. And you're kind of putting yourself in a space where you got to know even a little more about it maybe, huh? Right.
Starting point is 00:05:42 So one of the things is that it covers things that the PSF sponsors also, sponsored spaces. This includes a couple different, two or three of the Python meetups around the country. They're not sponsoring us yet, although we probably should hit them up for that. But we are doing a meetup here in Portland West coming up next month. And yeah, we probably ought to think about this of what to do if something happens. So yeah, Michael and I will probably talk about this before the actual meetup. Yeah, we'll figure it out. What's the date of the meetup again for people? Oh my gosh, I should know this. It's like the second Tuesday in October. So that's like the 6th or the 8th or something like that. That would be the 8th.
Starting point is 00:06:21 The 8th, yeah. Awesome. All right. Well, for those of you who can can make it that'd be great to see you out there all right now speaking of great stuff before we get on to more interviewing on my theme here i want to tell you about datadog so python bytes is sponsored by datadog they're a modern cloud scale monitoring platform that brings things like metrics logs and traces all into one place their tracing client includes auto instrumenting support for things like Django, Flask, Postgres. That means you get visibility into what your entire application is doing, not just maybe a trace out of your Python app or profiling just your Python app. But you can troubleshoot slow requests and optimize your code within a few minutes. So start monitoring your
Starting point is 00:07:00 dynamic environment with a free trial. And Datadog will send you a free t-shirt as well. Just get over to pythonbytes.fm slash Datadog to get started. So this previous one that I talked about, Brian, it was very much focused on sort of these, almost these data structure algorithm versions. And it said, here's the Python equivalent of some of these conversations you might have. This next one, I don't know how long it would take you to go through all this stuff, but it would take you a good long while. This is by Ben Rogagen. I'm going to say, sorry about that if I got that wrong, goes by Seattle Data Guy. So it talks a little bit about some of the silly stuff like fizzbuzz and some of the traditional classical, I don't know,
Starting point is 00:07:45 silly algorithm problems like give us the Fibonacci, et cetera, et cetera. And some things that you might study and so on. But then there's a bunch of videos and I don't know how many videos. There are many, I would say at least 75 videos on different topics. And these are like 15 minute videos. So there's some on algorithms, there's some on data structures, there's some on big O notation, dynamic programming, string manipulation, system design, operating systems, threads, object oriented programming, design patterns, SQL, and more stuff. So if you are in the process of trying to learn these things to get one of these jobs or nail one of these interviews, you've got homework.
Starting point is 00:08:25 Oh, okay. That's a lot, huh? This is frightening, though. Yeah. Awesome that this resource is here. Especially you can pick a part where you had trouble with or maybe after an interview even and go, wow, I got asked this stuff and I didn't understand it. So maybe go review it then. I was just watching all of the different sorting algorithms.
Starting point is 00:08:44 I love videos of sorting algorithms. I know, the visualizations. Yeah, there's a big graphic of like 20 different sorting algorithms all sorting next to each other at the same time, right? Something like that. It's mesmerizing. And also, I would say there are maybe 15 pages of comments and the comments get kicked off like, I think we really need to face a reckoning
Starting point is 00:09:05 in our profession. And the reckoning is this, we require an overload of stuff that's simply not important on the job just to get through the interview process and land a position. So, you know, basically you've got to go through all these algorithms, kind of like I said, and then in the end you do a lot of Googling stack overflow and you find packages on awesome Python and then you install them and you roll. Right. There's a huge discussion about why that is, what we can do about it and so on. So it's I think it's great.
Starting point is 00:09:32 You should also check out the conversation in the comments on the other end of it. Just a devil's advocate. One of the reasons I know people do pick up algorithm type questions is because they work in a specific space domain. And it would be obvious to ask about that. But if they don't really, if they know they can train you on their domain, they have to ask you about stuff that is something generic. And that's where the algorithm stuff is. I still think it's bad. Things like what should you use a bubble sort of quick sort? That's a dumb question. But if you have like things, I don't know, fizzbuzz is kind of silly, but you should know it by now. And some of the other things, it's hard to come up with good questions
Starting point is 00:10:14 that are fair for anybody coming at it. So also, keep in mind that. Yeah. You know what I would much rather see is something live and in the tooling and environment that that person likes to work in. So if I was interviewing somebody, you know, it seems to me like I might set up like a zoom call and we do screen share and say, Hey, I would like you to create this kind of website and have it, you know, have a route that passes data to the view method or whatever, right? Like if it's a web job. Or I'd like you to have a program that reads a JSON file and prints out these things. And just say, okay, now go. Let's do it.
Starting point is 00:10:54 Talk me through building this app. And spend 15 minutes. You can tell if somebody is comfortable in the language and comfortable in their tools or they have just no idea. I know that's what Fizzbuzz is supposed to solve but you know if you can't load a json file which is like three lines of code and it just works with dictionaries after that you probably are not really capable in python yeah so i would much rather see something like that like a small task that's not super domain specific it's not really deep into some library that you could ask over all these crazy things and it seems like it'd be effective so i don't know that's my thoughts definitely cool so one
Starting point is 00:11:29 thing that does i would really hope i don't get asked in interviews is about is regular expressions because those things are like right only no no simple regular expressions are fine okay in regular expressions defense they're very useful to concisely say something, some string kind of matches some other string within, you know. Anyway, people know what regular expressions are for, hopefully. They're super powerful. If you're going to interview, you probably should look it up. Third thing. But one of the hard things, though, is if you, this is, I'm going to introduce a project by Anthony Sotile, Sotile?
Starting point is 00:12:06 Sotile? Oh, anyway. Sotile. Sorry, Anthony. Sotile. Called RE-Assert. And so what this is, it's just a new matcher that does better tracebacks for when the match fails. And so this is really helpful if you've got, if you want to do use regular
Starting point is 00:12:25 expressions for a test for a, for part of your test for your application, this string should say, hello, Michael, welcome to my website. And I know that the name is going to be different. So I'm going to use a regular expression to parse out the name. How do I make sure that that matches and have a useful answer when it doesn't? And that's where ARIA cert comes in. And it's pretty fun. And it's a fairly new project. So the documentation is a little on the light side. So I did what I often do with new projects is I jumped into the test code and looked at the test code for this to find out how it was used.
Starting point is 00:13:04 And it's kind of fun. Like, for instance, we're going to put in the show notes an example of just matching foo with fob and how that if you use just re.match, it just returns a none. It says no match. Yeah, so it's not going to tell you anything. But if you use the matches object within the REassert project, it gives you more detail of why it doesn't match. So I think this is for very specific use cases, it's very cool. I love it because one of the really frustrating things about regular expressions is you say, here's the thing and it should match this.
Starting point is 00:13:41 And it says, nope, doesn't match. Why don't you match? And this is really cool. So if you compare foo to fob, like foo is a regular expression, fob is the value for static characters. It just matches, you know, just tries to find that substring basically.
Starting point is 00:13:57 And the error is right here at the B, it didn't match. The F matched, the O matched, but the B didn't match. And that's super helpful. That's great. And there's a bunch of examples and especially in test code. But yeah, so check it out and good job, Anthony. Absolutely. You know, there's a bunch of awesome Python lists these
Starting point is 00:14:13 days, Brian. Yeah. We've got awesome ASGI. We've got awesome Python applications from Mahmood. And we've talked a bit about Python typing and type hints and whatnot. So of course, there's an awesome Python typing awesome list. Okay, nice. Yeah, it's a collection of awesome Python types, stubs, plugins and tools for working with them. So in terms of the tools, there's the static type checkers. There's stub packages, which define the types that go with other packages which is pretty interesting like typeshed so instead of actually putting the types in the libraries you can put them in these libraries that go next to your library and it will actually pull that it has stuff for python 3637 standard library like data classes and all of those things.
Starting point is 00:15:06 So yeah, it's pretty interesting. I put it in a PYI file and it will carry the types over to like, there's an example of dataclasses.pyi that'll apply the types to dataclasses.py. Oh, cool. So it's got a bunch of those. Typeshed is probably the biggest one there. It's got tools. This is like a super category of many other ones.
Starting point is 00:15:26 But one I thought you might like is PyTest MyPy. So MyPy static type checker plugin for PyTest. I think we covered that one at some point. Yeah, I think so. Yeah. And then cool articles like how to type check Django and Django REST framework. So which is a whole tutorial on doing that. Apparently, Django has a bunch of magic and it makes type checking it extra hard. So there's just a bunch of things like that in there that I thought people might,
Starting point is 00:15:49 if you know, if they're getting into this Python typing space, it's a lot of good stuff to go check out. And some of the, like even linters, um, cause some people, I mean, you try one and it's confusing. We'll try another one. Maybe it fits better for what you're doing. Yeah. There's a bunch of flake eight and some, I think some black stuff and things like that in there. Okay, cool. I haven't really worked with stubs yet. I think that's something I want to try soon. So yeah, neat.
Starting point is 00:16:11 Same here. What do you got for our last one? Last one. Oh, so we have actually in the space of like looking at people writing articles and speaking and stuff, we kind of do that a lot. We run across quite a few people that list developer advocate as their job title. And I don't really know exactly what that is. And I've asked a couple people and not quite understood it still. You did like an entire episode on it, didn't you?
Starting point is 00:16:36 I did. I did. I'm going to see if I can pull up the number. The number is, I'm not sure what the number is. I got to figure it out. I'll look. Keep going. This is from Dustin Ingram, an article called developer advocacy frequently asked questions and um the disclaimer he puts is that he is a developer advocate for google so other companies and other people might experience different things but first off just what is it and he says he helps represent the python community at google in his sense in case, but really at whatever company somebody's working for. Tries to get more involved with the Python community and then also try to represent the Python community within the company and represent the company in the community, kind of both ends of it. He has a chance to work on different packages that he cares about.
Starting point is 00:17:24 In Dustin's case, he works with the PyPI and with packaging and other things. Speaking at conferences, of course, that's what we assume. That's what I assume. But there are apparently some that don't do much speaking at conferences and some that just do like one or two a year, which that sounds fun. The thing that I think really sounds fun is being the user zero for new products or features for a company yeah that's pretty cool with the bent of thinking about python users and whether or not they like it and things like that he's got a whole list of different things that they do but um actually this sounds like a lot of fun to me actually be kind of cool i think this would be a great job yeah i interviewed a couple folks back onthon. It was a lot of fun to do that episode.
Starting point is 00:18:08 And yeah, I think it sounds like a great job. It's one of those jobs where you get to, you basically get to explore technology. Obviously, when you work for one of these companies, it's in the slant of that. So the three people I interviewed, Cecil Phillip from Microsoft, Paul Everett from JetBrains, and Matt McKay from Twilio, they all kind of work around their space. But I don't know, I think it sounds great. Like if you just like researching new stuff and playing with new ideas and talking to people, I would definitely do it. I kind of assumed that they even address the work-life balance. There's some people that do like to travel a lot, so you can do that, and some people that don't. I thought that maybe that was just required for a DA.
Starting point is 00:18:48 Maybe. I'm not really sure either. But work-life balance is interesting, right? Because a lot of times those folks would be working from home when they're not gone. They might have more time with their family, more flexibility to go to their kid's soccer game, but then make it up in the evening. Whereas people go to office every day, you know, maybe not so much. Definitely. I guess it depends on your life, right? That's right.
Starting point is 00:19:09 What do you call balance? Okay. So, do you got any extra stuff you want to share? We already gave a shout out to our Portland West meetup that you were doing out by your office. That's all I wanted to shout out. How about you? Yeah, that's on meetup.com, so people can check that out.
Starting point is 00:19:24 Nothing major. There was some interesting news we covered a while ago that some of kenneth wright's projects were being moved around and the biggest domino in that whole space was requests i can't remember exactly who jumped in but someone from the psf jumped in and said hey we'll take it we'll take care of it in this thing called the some project that the PSF runs that can take care of these types of projects when they become important and are teetering on being unowned or whatever. So there's a huge discussion on Reddit about how it actually has moved over. So it actually has moved over to the PSF for one. Okay. And so now the place for requests on GitHub, for example,
Starting point is 00:20:07 is github.com slash PSF slash requests. That's wild. Yeah. But there's a huge discussion around it on Reddit. And, you know, take that for what it is. It's Reddit. Like it's kind of a, you know, you get both sides type of place. But I think people find it interesting.
Starting point is 00:20:22 I didn't really know that there was actually there's quite a bit of stuff. There's a few projects under PSF. I imagine that will grow bigger now. Yeah, I would think so as well. Black is there. That's interesting. How interesting. Are you ready for some laughs?
Starting point is 00:20:34 I am. This one might hurt us a little bit. This is good. As in from laughing so hard. Okay. This one is called to our attention by Colin Martin and it's a set of web development merit badges. Go ahead and pull up the link for where you can see the badges, because you've got to see the picture that goes along with each badge.
Starting point is 00:20:54 Let's take them row by row. I'll do the first one. Each has a big circle, and it's got something in it. This one has a giant A, and it says, so you get this badge if you changed a DNS record and everything worked just fine. This one, I love this one. There's a forward slash bracket A dash brain bracket bracket. And it says comprehended someone else's regex.
Starting point is 00:21:17 Yeah, exactly. Definitely. And you just have a little bit of a web bent. Another one is like an expander thing. It says built an accordion from scratch. I've done that. I think you've done this next one, the one on the next row. So colon WQ for exited vim.
Starting point is 00:21:33 Exited vim. I love it. You want to do the next two? Yeah. So, oh, crud. You get it if you accidentally created your own CMS. And then a little painter. I like the little painter with the acorn hat. Yeah, it's like a French design painter. Yeah, pulled off. You get this if you pulled off a design you didn't think you could. Well, that's actually kind of nice. That is nice.
Starting point is 00:21:54 This next one is for the consultants out there. It's like a mallet banging down like a judge. And you get this one if you told a client or boss, no, we're not doing that. Yeah, that's awesome. Then there's one with some crazy matching symbols. It says you wrote an HT access redirect that included a capture group. And then this one's pretty funny.
Starting point is 00:22:14 You have a minus CSS red, pink, and a plus CSS, green. It says you refactored a large portion of CSS and you didn't break anything. Oh, yeah, that's good. There's some good ones. You want to just pick out a couple more? Yeah, Merge Master into a six-month-old branch. I love that one. There's like two arrows going sideways, two arrows going down. It says
Starting point is 00:22:36 centered an element horizontally and vertically. Oh, nobody can have that one. That's so hard. It's not possible, I don't think. I don't think it is either. I like the dude laying down on the ground says you pushed to production on Friday and didn't roll it back and over the weekend. Here's the undeclative one. Had a neglected site get hacked and spammed. Oh yeah. And then another one, there's a guy sleeping on a laptop and it says, solved a bug by taking a nap.
Starting point is 00:23:06 That's awesome. There's a semicolon for debug something for over an hour where the fix literally was one character. Awesome. Yeah. All right. Let's leave the rest for the listeners out there to go check out. You just got to see the pictures. These are brilliant. These are great. Yeah. First time I read it, my stomach hurt. It was really good. All right. Well, speaking of good, this was a fun show. Thanks, Brian. Thank you. You bet. Talk to you later. Thank you for listening to Python Bytes. Follow the show on Twitter at Python Bytes. That's Python Bytes as in B-Y-T-E-S. And get the full show notes at pythonbytes.fm. If you have a news item you want featured, just visit pythonbytes.fm and send it our way.
Starting point is 00:23:47 We're always on the lookout for sharing something cool. This is Brian Ocken, and on behalf of myself and Michael Kennedy, thank you for listening and sharing this podcast with your friends and colleagues.

There aren't comments yet for this episode. Click on any sentence in the transcript to leave a comment.