Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book


Transcript #150: Winning the Python software interview

Return to episode page view on github
Recorded on Wednesday, Sep 25, 2019.

00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to

00:04 your earbuds. This is episode 150, recorded September 25th, 2019. I'm Brian Okken.

00:11 And I'm Michael Kennedy.

00:12 And this episode is brought to you by Datadog. Check them out at pythonbytes.fm

00:16 slash datadog. More on what they have to offer later. But Michael, right now I kind of sense a

00:23 theme. Are you looking for a new job? Are you hiring somebody or what's going on?

00:27 I'm going to cover a couple of topics about getting better interviews. You know, I kind of

00:33 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

00:39 hunt for that. But I do have a couple of friends who are looking for jobs. And you know, I'm just a

00:45 little sympathetic to the challenges and whatnot. So I want to kick us off with a thing called how to

00:53 stand out in the Python coding interview. Okay, this comes from James Timmons on any rotor on

01:00 real python.com. So it's kind of a Python version of the stuff that it seems like the tech industry

01:07 thinks you should know. And I feel like it's a little bit better. I feel like the tech industry says,

01:12 oh, you know, which is better a bubble sort or a quick sort? You know what, I don't care. I call

01:18 sort on the list. And we're good. You know, I don't maybe sorted like you could debate dot sort versus

01:24 sorted. But who cares, right? Like, this is not a problem we need to keep solving. And yet it feels

01:30 like in the interview process, it falls back to, well, they asked about, you know, big O notation,

01:35 they asked about like, algorithms of that type, they asked about a data structure, like when would

01:41 I use a doubly linked list versus a, you know, single linked list. And like, ah, like, I can go build,

01:47 you know, a Python web app with SQLAlchemy and talk to Stripe and charge a credit card. But I forgot

01:53 when I use a single linked list, right? Single direction linked list. But that seems like what

01:58 people are testing. So here's an article that sort of covers those kinds of questions, but specifically

02:04 for the Python developer, I think it's pretty, pretty decent. So it's meant to help you kind

02:11 of navigate that space of Python and show you that you have some knowledge of the built ins

02:17 and of the language and things like that. And you can kind of write decent code. So it covers

02:22 a handful of things with a bunch of other stuff mixed in there. So how to use enumerate to iterate

02:28 both over a view of like collection to iterate both with indices and values. And if you've been

02:33 doing Python for a long time, that's obvious, we do that a lot. But if you come from a language like

02:38 C++ or Java or something that doesn't have this all of a sudden, well, then it's really weird,

02:45 right? And you don't know to use it. So it's good to have that in there. Debugging with breakpoint

02:49 formatting with f-strings, F yes, for that one. That's great. Sorting, right? Sorting lists. I

02:55 talked about that, like, you don't have to care about the algorithms. But knowing how to sort stuff is

03:00 really nice generators and it's pressure on memory, default values and dictionaries using the counter

03:07 class, and then just some standard library stuff. And I think knowing all those things kind of

03:11 puts a nice Python spin on that level of Python interviewing.

03:17 Yeah.

03:18 Do you do any interviewing?

03:19 I haven't actually applied for a job for several years.

03:22 Do you do it in reverse, though? Do you hire, I mean, like interview people for there?

03:25 Yeah.

03:25 Yeah, definitely a lot. And I help out with other teams, too, and they're hiring. And like,

03:30 for some reason, people know me as this person that knows Python. So I'll do the Python interview

03:34 part. But yeah, a lot of this stuff is stuff that I look for. If you actually say for I in length,

03:41 the interview's over. Just you don't know Python then.

03:44 Yeah. I mean, maybe if you're hiring for, like, I'm hiring a developer and it doesn't,

03:48 they don't have to know Python, but they're going to be doing it. So we're going to help

03:51 them along. And they are, they're really good at Java. You could probably mentor them over. But

03:55 if your goal is to hire an experienced Python developer and they don't know for item in

04:01 collection, like, yeah, you're done.

04:03 Yeah. But I'm a pretty fair person. I talk through stuff. People can always recover. If you

04:08 freeze up, don't worry about it. Just flow with it. I think people should interview

04:11 more, even if they're not looking for a job, just to keep up their interview chops. It's good.

04:16 Yeah. Nice. I agree.

04:17 Speaking of being nice to people, we have a bit of news. And even though I didn't even actually

04:22 know this was an issue. So there was an announcement made that the PSF, the Python Software Foundation,

04:28 updated its code of conduct. And apparently the PSF had one code of conduct for the PSF and things

04:34 it was sponsoring and a different one for PyCon US. And now there's just one. So that's the big

04:41 news. And we've got links to the code of conduct and the enforcement guidelines and reporting

04:46 guidelines. And we hear about codes of conduct occasionally and stuff. And in the past, I've

04:51 thought, why do I have to care about this? I mean, just don't be a jerk and try to be a nice person.

04:56 Isn't that enough? And for the most part, yes. But if that was all there was to it and there

05:03 weren't any problems, then we wouldn't need these. And clearly we need them. Things come up. So I think

05:09 it's good for people to go. It's not a long read. I think people should read them, especially before

05:13 you go to an event to make sure you know what's up with that. The other thing that's nice to look up

05:19 is what is the reporting mechanism? So if you see somebody violating these or basically just somebody

05:26 being a jerk, what do you do about it? Who do you contact? And so that's good to just sort of at least

05:31 have read it once so that if it happens, you can look it up and figure out what to do.

05:35 At least know what it is. And you're kind of putting yourself in a space where you got to

05:40 know even a little more about it maybe, huh?

05:41 Right. So one of the things is that it covers things that the PSF sponsors also, sponsored

05:47 spaces. This includes a couple different, two or three of the Python meetups around the country.

05:52 They're not sponsoring us yet, although we probably should hit them up for that. But we are doing a

05:58 meetup here in Portland West coming up next month. And yeah, we probably ought to think about this,

06:03 of what to do if something happens. So yeah, Michael and I will probably talk about this

06:08 before the actual meetup.

06:10 Yeah, we'll figure it out. What's the date of the meetup again for people?

06:12 Oh my gosh, I should know this. It's like the second Tuesday in October. So that's

06:17 like the 6th or the 8th or something like that.

06:20 That would be the 8th.

06:21 Yes, 8th.

06:22 Yeah.

06:22 Awesome. All right. Well, for those of you who could make it, that'd be great to see you out there.

06:25 All right. Now, speaking of great stuff, before we get on to more interviewing on my theme here,

06:30 I want to tell you about Datadog. So Python Bytes is sponsored by Datadog. They're a modern cloud

06:35 scale monitoring platform that brings things like metrics, logs, and traces all in one place.

06:40 Their tracing client includes auto-instrumenting support for things like Django, Flask, Postgres.

06:47 That means you get visibility into what your entire application is doing,

06:50 not just maybe a trace out of your Python app or profiling just your Python app. But you can

06:55 troubleshoot slow requests and optimize your code within a few minutes. So start monitoring your

07:00 dynamic environment with a free trial. And Datadog will send you a free t-shirt as well. Just get

07:06 over to pythonbytes.fm/Datadog to get started. So this previous one that I talked about,

07:11 Brian, it was very much focused on sort of these, almost these data structure algorithm versions.

07:18 And it said, here's the Python equivalent of some of these conversations you might have.

07:22 This next one, I don't know how long it would take you to go through all this stuff,

07:27 but it would take you a good long while. This is by Ben Rogagen. I'm going to say,

07:33 sorry about that, if I got that wrong, goes by Seattle Data Guy. So it talks a little bit about

07:40 some of the silly stuff like FizBuzz and some of the traditional classical, I don't know,

07:45 silly algorithm problems like give us the M Fibonacci, et cetera, et cetera. And some things

07:50 that you might study and so on. But then there's a bunch of videos. And I don't know how many videos

07:56 there are many, I would say at least 75 videos on different topics. And these are like 15 minute

08:03 videos. So there's some on algorithms. There's some on data structures. There's some on big O notation,

08:09 dynamic programming, string manipulation, system design, operating systems, threads, object oriented

08:15 programming, design patterns, SQL, and more stuff. So if you are in the process of trying to learn

08:22 these things to get one of these jobs or nail one of these interviews, you've got homework.

08:25 Oh, okay.

08:26 That's a lot, huh?

08:27 This is frightening though. Yeah. Awesome that this resource is here, especially you can like

08:31 pick a part where you, you know, had trouble with, or maybe after an interview even and go,

08:36 wow, I got asked this stuff and I didn't understand it. So maybe go review it then.

08:41 I was just watching all of the different algorithms, sorting algorithms. I love videos

08:45 of sorting algorithms. I know the visualizations. Yeah. It's, there's a big graphic of like 20

08:51 different sorting algorithms, all sorting next to each other at the same time. Right. Something like

08:55 that. It's mesmerizing. And also I would say there are maybe 15 pages of comments and the comments get

09:03 kicked off. Like, I think we really need to face a reckoning in our profession. And the reckoning is this,

09:08 we require an overload of stuff that's simply not important on the job just to get through the

09:14 interview process and land a position. So, you know, basically you've got to go through all these

09:18 algorithms, kind of like I said, and then in the end you do a lot of Googling and stack overflow and

09:23 you find packages on awesome Python and then you install them and you roll, right? There's a huge

09:28 discussion about why that is, what we can do about it and so on. So it's, I think it's great. You should

09:33 also check out the conversation in the comments. On the other end of it, just a devil's advocate.

09:37 One of the reasons I know people do pick up algorithm type questions is because they work in

09:44 a specific space domain and it would be obvious to ask about that. But if they don't really,

09:50 if they know they can train you on their domain, they have to ask you about stuff that is something

09:56 generic and that's where the algorithm stuff is, I still think it's bad. Things like,

10:02 what should you use, a bubble sort or quick sort? That's a dumb question. But if you have like things

10:06 like, I don't know, FizzBuzz is kind of silly, but you should know it by now. And some of the other

10:11 things, it's hard to come up with good questions that are fair for anybody coming at it. So also,

10:18 keep in mind that. Yeah. You know what I would much rather see is something live and in the tooling

10:25 and environment that that person likes to work in. So if I was interviewing somebody,

10:29 you know, it seems to me like I might set up like a Zoom call and we do screen share and say,

10:35 hey, I would like you to create this kind of website and have it, you know, have a route that passes data

10:42 to the view method or whatever, right? Like if it's a web job or I'd like you to have a program

10:48 that reads a JSON file and prints out these things and just say, okay, now go, let's do it. Talk me

10:55 through building this app and spend 15 minutes. You can tell if somebody is comfortable in the language

10:59 and comfortable in their tools or they have just no idea. Like I know that's what FizzBuzz is supposed

11:04 to solve. But, you know, if you can't load a JSON file, which is like three lines of code and it just

11:10 works with dictionaries after that, you probably are not really capable in Python. So I would much

11:15 rather see something like that, like a small task that's not super domain specific. It's not really

11:21 deep into some library that you could ask over all of these crazy things. And it seems like it'd be

11:26 effective. So I don't know. That's my thoughts. Definitely. Cool. So one thing that does, I would

11:31 really hope I don't get asked in interviews is about is regular expressions because those things are like

11:37 write only. No, no, simple regular expressions are fine. Okay. In regular expressions defense, they're very useful to

11:45 concisely say something, some string kind of matches some other string within, you know. Anyway, people know what

11:53 regular expressions are for. Hopefully, if you're going to interview, you probably should look it up. Yeah.

11:57 Third thing.

11:59 But one of the hard things though is if you, this is, I'm going to introduce a project by Anthony

12:05 Sotille, Sotille, Sotille? Sotille? Oh, anyway.

12:08 Sotille.

12:08 Sorry, Anthony. Sotille.

12:09 Called RE-assert. And so what this is, it's just a new matcher that does better tracebacks for when the

12:20 match fails. And so this is really helpful if you've got, if you want to do, use regular expressions for a test for a,

12:28 for part of your test for your application. This string should say, hello, Michael, welcome to my

12:34 website. And I know that the name is going to be different. So I'm going to use a regular expression

12:38 to parse out the name. How do I make sure that that matches and have a useful answer when it doesn't?

12:46 And that's where RE-assert comes in. And it's pretty fun. And I, it's a fairly new project. So the

12:53 documentation's a little on the light side. So I did what I often do with new projects is I jumped into

12:59 the test code and looked at the test code for this to find out how it was used. And it's kind of fun.

13:05 you like, for instance, I'm, we're going to put in a show notes, an example of just matching foo with

13:10 fob and how that, if you use just RE.match, it just returns a no match. Yeah. So it's not going to tell

13:19 you anything, but if you use the matches object within the RE assert project, it gives you more

13:28 detail of why it doesn't match. So I think this is for very specific use cases. It's very cool.

13:34 I love it because one of the really frustrating things about regular expressions is you say,

13:39 here's the thing and it should match this. And it says, nope, doesn't match.

13:44 Why don't you match? And this is really cool. So if, if you compare foo to fob, like foo is a regular

13:50 expression, fob is the value for static characters. It just matches, you know, just tries to find that

13:56 substring basically. And the error is right here at the B, it didn't match the F match the O match,

14:02 but the B didn't match. And that's super helpful. That's great.

14:04 And there's a bunch of examples and especially in test code, but yeah, so check it out and good job,

14:09 Anthony. Absolutely. You know, there's a bunch of awesome Python lists these days, Brian.

14:15 Yeah.

14:15 We've got awesome ASGI. We've got awesome Python applications from Mahmood. And we've talked a bit

14:22 about Python typing and type hints and whatnot. So of course there's an awesome Python typing,

14:29 awesome list.

14:30 Okay. Nice.

14:32 Yeah. It's a collection of awesome Python types, stubs, plugins, and tools for working with them. So

14:37 in terms of the tools, there's the static type checkers, there's stub packages, which define

14:44 the types that go with other packages, which is pretty interesting, like type shed. So instead of

14:50 actually putting the types in the libraries, you can put them in these libraries that go next to

14:55 your library and it will actually pull them out. It has stuff for Python, three, six, three, seven,

15:01 standard library, like data classes and all of those things. So yeah, it's pretty interesting.

15:07 I put them in a PYI file and it will carry the types over to like, there's an example of

15:14 data classes.py that'll apply the types to data classes.py. Oh, cool.

15:18 So it's got a bunch of those type shed is probably the biggest one there. It's got tools. This is like

15:24 a super category of many other ones, but one I thought you might like is pytest mypy. So mypy

15:29 static type checker plugin for pytest. I think we covered that one at some point. Yeah.

15:33 I think so. Yeah. And then cool articles like how to type check Django and Django rest framework. So

15:39 which is a whole tutorial on doing that. Apparently Django has a bunch of magic and it makes type

15:44 checking it extra hard. So there's just a bunch of things like that in there that I thought people

15:48 might, if you know, if they're getting into this Python typing space, it's a lot of good stuff to

15:53 go check out. And some of the, like even linters, cause some people, I mean, you try one and it's

15:58 confusing. Well, try another one. Maybe it fits better for what you're doing. Yeah. There's a bunch of

16:02 like eight and some, I think some black stuff and things like that in there. Okay, cool. Yeah.

16:06 I haven't really worked with stubs yet. I think that's something I want to try to tune to. Yeah.

16:10 Neat. Same here. What do you got for our last one? Last one. Oh, so we have actually in the,

16:15 the space of like looking at people writing articles and speaking and stuff, we kind of do that a lot.

16:22 We run across quite a few people that list developer advocate as their job title. And I don't

16:28 really know exactly what that is. And I've asked a couple of people and not quite understood it still.

16:34 You did like an entire episode on it, didn't you?

16:37 I did. I did.

16:38 Okay.

16:38 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

16:42 to figure it out. I'll look. Keep going.

16:43 This is from Dustin Ingram, an article called developer advocacy, frequently asked questions.

16:48 And the disclaimer he puts is that he is a developer advocate for Google. So other companies and other

16:56 people might experience different things, but first off, just what is it? And he says he helps represent

17:03 the Python community at Google in his sense, in his case, but really at whatever company somebody's

17:09 working for tries to get more involved with the Python community. And then also try to represent

17:14 the Python community within the company and represent the company in the community that kind of both ends

17:20 of it. He has a chance to work on different packages that he cares about. In Dustin's case, he works with

17:26 the PyPI and with packaging and other things, speaking in conferences. Of course, that's what we assume.

17:31 That's what I assume, but there are apparently some that don't do much speaking in conferences and some

17:37 that just do like one or two a year, which that sounds fun. The thing that I think really sounds

17:42 fun is being the user zero for new products or features for a company.

17:46 Yeah, that's pretty cool.

17:47 With the bent of thinking about Python users and whether or not they like it and things like that.

17:52 He's got a whole list of different things that they do, but actually this sounds like a lot of fun to

17:57 me. It'd be kind of cool.

17:59 I think this would be a great job. Yeah, I interviewed a couple of folks back on Talk Python.

18:04 It was a lot of fun to do that episode. I think it sounds like a great job. It's one of those jobs

18:11 where you basically get to explore technology. Obviously, when you work for one of these companies,

18:18 it's in the slant of that. The three people I interviewed, Cecil Phillip from Microsoft,

18:23 Paul Everett from JetBrains, and Matt McKay from Twilio, they all kind of work around their space,

18:28 but I don't know. I think it sounds great. If you just like researching new stuff and playing with new

18:33 ideas and talking to people, I would definitely do it.

18:36 I kind of assumed that they even address the work-life balance. There's some people that do

18:41 like to travel a lot, so you can do that, and some people that don't. I thought that maybe that was

18:46 just required for a DA.

18:48 Maybe. I'm not really sure either. But work-life balance is interesting, right? Because a lot of

18:54 times those folks would be working from home when they're not gone. They might have more time with

18:57 their family, more flexibility to go to their kid's soccer game, but then make it up in the evening,

19:02 whereas people go to office every day. Maybe not so much.

19:06 Definitely. I guess it depends on your life, right?

19:08 That's right. What do you call balance? Okay. So, do you got any extra stuff you want to share?

19:13 We already gave a shout-out to our Portland West meetup that you were doing out by your office.

19:19 That's all I wanted to shout-out. How about you?

19:21 Yeah, that's on meetup.com, so people can check that out. Nothing major. There was some

19:25 interesting news. We covered a while ago that some of Kenneth Wright's projects were being moved

19:31 around, and the biggest domino in that whole space was requests. I can't remember exactly who jumped in,

19:39 but someone from the PSF jumped in and said, hey, we'll take it. We'll take care of it in this thing

19:43 called some project that the PSF runs that can take care of these types of projects when they become

19:49 important and are teetering on being unowned or whatever. So, there's a huge discussion on

19:57 Reddit about how it actually has moved over. So, it actually has moved over to the PSF, for one.

20:03 Okay.

20:03 And so, now the place for requests on GitHub, for example, is github.com/PSF slash request.

20:10 That's wild.

20:11 Yeah.

20:11 But there's a huge discussion around it on Reddit, and take that for what it is. It's Reddit. It's kind

20:18 of a, you know, you get both sides type of place, but I think people find it interesting.

20:22 I didn't really know that there was, actually, there's quite a bit of stuff. There's a few

20:26 projects under PSF. I imagine that will grow bigger now.

20:29 Yeah, I would think so as well.

20:31 Black is there. That's interesting.

20:33 How interesting. Are you ready for some laughs?

20:34 I am.

20:35 This one might hurt us a little bit. This is good. As in from laughing so hard.

20:39 Okay.

20:40 This one is called to our attention by Colin Martin, and it's a set of web development merit badges.

20:48 Go ahead and pull up the link for where you can see the badges, because you got to see the picture

20:52 that goes along with each badge. Let's take them like row by row.

20:55 Okay.

20:56 All right. I'll do the first one. They each has a big circle, and it's got like something in it.

21:00 This one has a giant A, and it says, so you get this badge if you changed a DNS record and everything

21:06 worked just fine. This one, I love this one. There's a forward slash bracket A dash brain bracket bracket,

21:14 and it says comprehended someone else's regex.

21:16 Yeah, exactly. Definitely.

21:18 And you just have a little bit of a web bent. Another one is like an expander thing. It says

21:23 built an accordion from scratch.

21:24 I've done that.

21:25 I think you've done this next one, the one on the next row.

21:29 So, colon WQ for exited Vim.

21:32 Exited Vim. I love it. You want to do the next two?

21:36 Yeah. So, oh, crud. You get it if you accidentally created your own CMS.

21:42 And then a little painter. I like the little painter with the acorn hat.

21:46 Yeah, it's like a French design painter.

21:48 Yeah. Pulled off. You get this if you pulled off a design you didn't think you could. Well,

21:52 that's actually kind of nice.

21:53 Yeah, this is nice. This next one is for the consultants out there. It's like a mallet banging

21:58 down like a judge. And you get this one if you told a client or boss, no, we're not doing

22:04 that.

22:04 Yeah, that's awesome.

22:05 Then there's one with like some crazy matching symbols. It says you wrote an HT access redirect that

22:12 included a capture group. And then this one's pretty funny. You have a minus CSS red, pink,

22:17 and a plus CSS green. It says you refactored a large portion of CSS and you didn't break anything.

22:23 Oh, yeah, that's good. There's some good ones.

22:26 Yeah, you want to just pick out a couple more?

22:27 Yeah.

22:28 Merged master into a six month old branch.

22:31 I love that one. There's like two arrows going sideways, two arrows going down. It says centered

22:36 in element horizontally and vertically.

22:38 Oh, nobody can have that one.

22:40 That's so hard.

22:41 It's not possible. I don't think.

22:43 I don't think it is either.

22:44 I like the dude laying down on the ground says you pushed to production on Friday and

22:49 didn't roll it back and over the weekend.

22:51 Here's the undecutive one. Had a neglected site get hacked and spammed.

22:58 Oh, yeah.

22:59 And then another one, there's a guy sleeping on a laptop and it says solved a bug by taking

23:06 a nap.

23:06 That's awesome. There's a semicolon for debug something for over an hour where the fix literally

23:12 was one character.

23:13 Awesome. Yeah. All right. Let's leave the rest for the listeners out there to go check out.

23:19 You just got to see the pictures. These are brilliant.

23:21 These are great.

23:22 Yeah. First time I read it, I was my stomach hurt. It was really good.

23:25 All right. Well, speaking of good, this was a fun show. Thanks, Brian.

23:30 Thank you.

23:31 You bet. Talk to you later.

23:32 Thank you for listening to Python Bytes. Follow the show on Twitter at Python Bytes.

23:37 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

23:47 send it our way. We're always on the lookout for sharing something cool. This is Brian Okken,

23:51 and on behalf of myself and Michael Kennedy, thank you for listening and sharing this podcast

23:55 with your friends and colleagues.

Back to show page