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 Okken.
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. 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 any rotor on
real python.com. So it's kind of a Python version of the stuff that it seems like 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,
you know, a Python web app with SQLAlchemy and talk to Stripe and charge 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, 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 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 those things kind of
puts a nice Python spin on that level of Python interviewing.
Yeah.
Do you do any interviewing?
I haven't actually applied for a job for several years.
Do you do it in reverse, though? Do you hire, I mean, like interview people for there?
Yeah.
Yeah, definitely a lot. And I help out with other teams, too, and they're hiring. And like,
for some reason, people know me as this person that knows Python. 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 it doesn't,
they don't have to know Python, but they're going to be doing it. So we're going to help
them along. And they are, 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, 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? And for the most part, yes. 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. 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. 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.
Yes, 8th.
Yeah.
Awesome. All right. Well, for those of you who could 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 in 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
dynamic environment with a free trial. And Datadog will send you a free t-shirt as well. Just get
over to pythonbytes.fm/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 FizBuzz and some of the traditional classical, I don't know,
silly algorithm problems like give us the M 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.
Oh, okay.
That's a lot, huh?
This is frightening though. Yeah. Awesome that this resource is here, especially you can like
pick a part where you, you know, 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 algorithms, sorting algorithms. I love videos
of sorting algorithms. I know the visualizations. Yeah. It's, 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 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 and 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. 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 or quick sort? That's a dumb question. But if you have like things
like, 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 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. 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. Like 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. 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 of these crazy things. And it seems like it'd be
effective. So I don't know. That's my thoughts. Definitely. Cool. So one thing that does, I would
really hope I don't get asked in interviews is about is regular expressions because those things are like
write 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, if you're going to interview, you probably should look it up. Yeah.
Third thing.
But one of the hard things though is if you, this is, I'm going to introduce a project by Anthony
Sotille, Sotille, Sotille? Sotille? Oh, anyway.
Sotille.
Sorry, Anthony. Sotille.
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 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 RE-assert comes in. And it's pretty fun. And I, it's a fairly new project. So the
documentation's 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. And it's kind of fun.
you like, for instance, I'm, we're going to put in a show notes, an example of just matching foo with
fob and how that, if you use just RE.match, it just returns a no match. Yeah. So it's not going to tell
you anything, but if you use the matches object within the RE assert 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. And it says, nope, doesn't match.
Why don't you match? And this is really cool. So if, 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. And the error is right here at the B, it didn't match the F match the O match,
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 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 type shed. 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 them out. It has stuff for Python, three, six, three, seven,
standard library, like data classes and all of those things. So yeah, it's pretty interesting.
I put them in a PYI file and it will carry the types over to like, there's an example of
data classes.py that'll apply the types to data classes.py. Oh, cool.
So it's got a bunch of those type shed is probably the biggest one there. It's got tools. This is like
a super category of many other ones, 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, 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, cause some people, I mean, you try one and it's
confusing. Well, try another one. Maybe it fits better for what you're doing. Yeah. There's a bunch of
like eight and some, I think some black stuff and things like that in there. Okay, cool. Yeah.
I haven't really worked with stubs yet. I think that's something I want to try to tune to. Yeah.
Neat. Same here. What do you got for our last one? Last one. Oh, so we have actually in the,
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 of people and not quite understood it still.
You did like an entire episode on it, didn't you?
I did. I did.
Okay.
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 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 his 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 that kind of both ends
of it. He has a chance to work on different packages that he cares about. In Dustin's case, he works with
the PyPI and with packaging and other things, speaking in conferences. Of course, that's what we assume.
That's what I assume, but there are apparently some that don't do much speaking in 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 actually this sounds like a lot of fun to
me. It'd be kind of cool.
I think this would be a great job. Yeah, I interviewed a couple of folks back on Talk Python.
It was a lot of fun to do that episode. I think it sounds like a great job. It's one of those jobs
where you basically get to explore technology. Obviously, when you work for one of these companies,
it's in the slant of that. 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. 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.
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. Maybe not so much.
Definitely. I guess it depends on your life, right?
That's right. 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. 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 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, is github.com/PSF slash request.
That's wild.
Yeah.
But there's a huge discussion around it on Reddit, and take that for what it is. It's Reddit. It's kind
of a, you know, you get both sides type of place, but I think people find it interesting.
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?
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 got to see the picture
that goes along with each badge. Let's take them like row by row.
Okay.
All right. I'll do the first one. They each has a big circle, and it's got like 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.
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.
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.
Yeah, this is nice. 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 like some crazy matching symbols. It says you wrote an HT access redirect that
included a capture group. And then this one's pretty funny. 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.
Yeah, you want to just pick out a couple more?
Yeah.
Merged master into a six month old branch.
I love that one. There's like two arrows going sideways, two arrows going down. It says centered
in 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 undecutive 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.
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, I was 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. We're always on the lookout for sharing something cool. This is Brian Okken,
and on behalf of myself and Michael Kennedy, thank you for listening and sharing this podcast
with your friends and colleagues.