Regular readers of this blog or followers of my LinkedIn or Twitter accounts will know that I’m currently looking for a new job. I’ve been doing the requisite searching and networking, and have taken some less typical approaches such as publicizing my magnum opus job application (which was actually an application to a prospective employer, with information about that prospect sanitized out) and ramping up my activities at local events (such as the recent Makers Hustle Harder hackathon, and various local meetups).

In this article, I’m sharing a Python program that I wrote as my solution to a programming challenge issued to candidates for a developer marketer position. I didn’t land the job, but going through the challenge was still a worthwhile experience, and worth sharing here.

The position and the challenge

The position for which I was applying was that of Developer Marketing Manager at a company whose online service allows users to integrate or “glue” various web and other applications together to create new functionality, without programming, in a “when a certain event happens, perform this defined task in response” fashion. For example, you could use their service to tie together email and SMS so that you would be sent a text message whenever you received email from a specific email address. You’ve probably heard of this company.

They wanted someone who could wear both marketer and developer hats. To test the developer hat, part of the application required submitting a response to a programming challenge.

The challenge was to take a CSV file with the following contents…

…and write an application that does the following for each non-heading row:

  • Perform a Google search for the item in the first column
  • Write the link from the first result of that search into the second column

Once this has been done for all the rows, write the results into a new CSV file. For the example search terms, the resulting file should look like this:

They wanted it implemented in Python, which is the language they use to implement their main product. Although it’s been some time since I’ve done any Python coding — and even longer since I’ve written any Python code professionally, I was confident that my familiarity with its syntax and my knack for picking up programming languages I haven’t touched in ages (go to my GitHub account and see this repo, this repo, and this repo for examples) would serve me well.

Before you code: Determine what’s on their mind

Sigmund Freud, who turned reading things into what people do and say into an entire industry.

Before you even begin to think about how you’d tackle the programming problem given to you, think about the question that they’re trying to answer by giving you the assignment. That question will depend on where the company doing the hiring is on the spectrum:

  • On one end of the spectrum are organizations like Google, Microsoft, and Amazon, who are in the business of making software, and have whole departments, complete with dedicated people and well-defined processes, dedicated to finding and evaluating prospective employees. They’re often looking to fill a specialized role on a larger team, and the question they’re asking is “Is this person someone with the developer skills to fill a very specific, well-defined role to meet our very specific, well-defined set of needs?”
  • On the other end are businesses made up of a handful of people — or perhaps only one person — who have been given the task of finding a new programmer in addition to all their other day-to-day responsibilities. They’re often looking to find a techie who can wear many hats, and the question they’re asking is “Is this person someone with the developer skills to fill a number of related roles to meet our amorphous, general set of needs?”

You’ll need to determine where the people interviewing you are on this spectrum, and tailor your answer accordingly.

You should also think about the company’s “obsessions”, by which I mean the topics, issues, areas of expertise, and programming tools and technologies that are the driving forces behind their technology. Their obsessions will often dictate the sort of programming assignment that they give, and may even give you an idea of the sorts of problems they’re trying to solve and skills they’re looking for.

Here’s a short list of programming assignments I have been given in the course of job interviews and application processes. Note the connection between what a company does and the programming assignment it issues:

Company description Programming assignment description
A large company (about 50,000 employees worldwide) in the search engine business.

Build a class that stores an index of web pages by their urls, with methods for adding a web page and for returning only those web pages that contain a given search term. It would essentially be a very scaled-down version of their own application.

They didn’t care what programming language I used, although their preferred programming languages are C++, Java, JavaScript, Python, and a couple of programming languages they developed in-house.

A growing company (just under 1,500 employees) whose service lets you store and share files in the cloud, as well as synchronize those files in the cloud with your own local filesystems.

Build a program that would let you create a nested hierarchical store of key-value data and write methods to create, read, update, and delete from this store. It would essentially be a very scaled-down version of their own application.

The application was to be written in Python, as this was their preferred programming language, adn used extensively on both the server and desktop client sides.

A training company with dozens of instructors that was looking for people to teach Windows/.NET desktop development to beginner/intermediate developers.

Build an application that stores student information in a relational database. It should allow the user to create, read, update, and delete student information from the database. It would be the sort of application that graduates of their courses would need to learn how to write.

The application could be written in C# or Visual Basic, as these are preferred development languages for in-house line-of-business Windows desktop applications.

A consultancy of about 18 people that developed custom sites based on WordPress.

Build a plugin that would display the 5 most recent blog comments and links to them in the sidebar. They have to customize WordPress for their clients on a regular basis, and having a library of reusable plugins would help shorten the time it took to build custom sites.

The plugin was to be written in PHP, which is what WordPress is written in.

A three-person shop who needed a developer to help lighten the load.

FizzBuzz, that now-infamous programming exercise, which goes like this:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

The guy who interviewed me had been burned by a couple of hires (and fires) who said that they could program, and interviewed well, but when it came time to actually code, they couldn’t. He was using it as a “can you program or not?” filter.

He didn’t care what programming language I used, so for maximum portability, I did it in JavaScript.

In the case of this programming challenge, the company was about 50 people in size at the time, and as I said earlier, their main product was a “if a certain thing happens, perform a certain action in response” kind of online service. Many techies are familiar with their service, but not they’re not yet a “household brand”. The question they were trying to answer with this challenge was “Can this person program, and can he explain it to other developers?”, so I wrote my response with that in mind.

Eat the frog

This expression comes from Mark Twain, who said “If the first thing you do in the morning is eat a live frog, you can go through the rest of the day knowing that the worst is behind you.”

It’s a suggestion to tackle the worst, most unpleasant task of the day at the start. In the case of this programming assignment, I’m using it to suggest that you tackle the part about which you know the least.

This assignment breaks down into three major parts:

  1. Reading the given CSV file
  2. Performing the Google search
  3. Writing a new CSV file

Reading and writing files is pretty straightforward stuff, but until this assignment, I’d never needed to perform a Google search programatically. I declared that programmatic Googling would be the frog. It was time to do some research.

Google used to provide an API for web search, but they announced its cancellation in 2010 and its last day of operation was September 29, 2014. These days, they offer the Custom Search API, which won’t work for the purposes of this application, as it’s limited to either:

  • Creating a search engine for a single site
  • Creating a search engine that focuses on a particular topic, but searches across a collection of websites

Without an API, doing Google searches programmatically involves sending GET requests to Google and “screen scraping” the results page. Programming screen scrapers is tedious, trial-and-error work. Luckily for me, someone’s already done the work, and the result is the google Python package.

The simplest way to install this package is to use pip, the Python package manager. With pip, installing the google package is as simple as entering this at the command line:

If for some reason you don’t have pip installed, you can go to the google Python package page, and download the tarred-and-gzipped package. At the time of this writing, its filename is google-1.9.3.tar.gz. Once you’ve downloaded it, you’ll have a new directory named google-1.9.3. From the command line, go into the directory and run setup.py using the following command:

The google package function that I was interested in was search, whose signature is:

The function returns a generator that yields found URLs. Here’s a quick run-down of the parameters:

  • query: The query string, which must not be url-encoded.
  • tld: The top level domain, for which the default value is com.
  • lang: The language for the results, for which the default value is en.
  • num: Number of results per page.
  • start: An integer specifying the first result to retrieve.
  • stop: An integer specifying the last result to retrieve. The default is None, which means the search goes on forever.
  • pause: Time (in seconds) to wait between HTTP requests. Setting this too high slows down the search greatly, but setting it too low will annoy Google and may cause them to block your IP.

I installed the package using pip, and then took search for a test drive by opening a Python REPL and entering:

I expected that this test function would return the URLs for the first ten Google results for the given search term. I entered this at the Python prompt…

…and got this:

It worked! Now it was time to code the function I actually needed: one that would return only the URL for the first Google result for the given search term:

Remember, search doesn’t return a list, but a generator, so I set it to stop after one result, store the result in the variable url, and then return the value in that variable. The break statement is there because Python syntax doesn’t allow for empty loops, and to guarantee that the loop is exited after its first iteration.

I tested out the new function by entering…

…and got this result:

The function works, but since it’s making an online request, it’s a good idea to put in some error handling. Since this is just a programming test assignment and not a production application, it doesn’t have to be a lot of error handling — just enough to make it clear to whoever’s evaluating your code that you’re mindful that this operation might fail.

Here’s what the function looks like with just enough error handing:

With the frog eaten, it was time to code the other parts of the program.

Reading search terms from the CSV file

I needed a method to read the CSV file, so I wrote this one. Given a filename for a two-column CSV file, it returns a list of two-element lists, each of which represents a row in the file:

The real work is done is the try block, where:

  • The file is read line by line.
  • Each line has any leading and trailing whitespace stripped from it, and then is converted into a list, with each element representing a column in our table.
  • The newly-created list is added to our list of rows.

Once again, to communicate that I can write code that can deal with Murphy’s Law, I wrote the method with just enough error handling for this sort of assignment. It deals with cases where the file with the given name doesn’t exists, as well as general file I/O errors that may crop up from time to time.

Getting search results for the file

I now had…

  • a method that reads the CSV file and returns a list of two-element lists (read_input_file), and
  • a method that given a search term, returns the URL for the first Google result (first_google_result_url).

I could now write this method, which would be used to take the results of read_input_file and feed them to first_google_result_url:

This method returns a list of two-element lists, where the first element contains a search term, and the second element contains the URL for the first Google result for that search term.

Writing the results to a file

I needed a method that would write the results of get_search_results to a CSV file. Here’s what I wrote:

It takes these two arguments:

  • A list of two-element lists, which should be the result of get_search_results, and
  • the name for the file to be created.

Just as with read_input_file, I added just enough error handling to show that yes, I can write code that deals with the real world.

Tying it all together

I had all the methods I needed, so it was time to write a main method to tie them all together. I wanted the program to be called this way…

…so I wrote it to accept two parameters when called…

…and once again, with just enough error handling.

With main defined, it was time to place this at the bottom of the file:

This is a Pythonism that states “If this file is being executed directly rather than being imported, run the main method.” It encourages developers to write code in such a way that defined functionality is separate from function, and it also encourages code reuse.

Here’s the complete file:

 

Are you looking for your next great hire?

I’m looking for my next great job! If you’re looking for someone with desktop, web, mobile, and IoT development skills who can also communicate to technical and non-technical audiences, or a marketer or evangelist who also has a technology background and can code, you should talk to me.

If you’d like to learn more, you can:

{ 0 comments }

Here’s what’s happening in Tampa Bay and surrounding areas for developers, technologists, and tech entrepreneurs this week.

Monday, March 27

Tuesday, March 28

Tampa iOS Meetup is my Meetup group aimed at people new to software development or new to iOS development. Rather than study just a single aspect of iOS development, each Tampa iOS Meetup session is devoted to developing a complete app, and learning various things along the way.

On Tuesday, we’ll build a relaxation/mindfulness app at Tampa iOS Meetup, and in the process, learn about:

  • Error handling in Swift: responding to errors gracefully rather than having the app come to a crashing halt and annoying the user.
  • Playing sounds: Playing both short sound cues and effects, as well as longer recordings.
  • Auto layout: Building user interfaces that adjust themselves to the screen size, from the (relatively) tiny iPhone 4S all the way to the large iPad Pro.

Join me, next Tuesday, March 28th at 6:30 p.m. at the Wolters Kluwer office (1410 N Westshore Blvd, Tampa) in Westshore for Tampa iOS Meetup’s session on building a guided meditation audio app! We’ll provide food and drink — bring your Mac laptop, and be ready to code!

To register for this event, visit the event page. Registration is free! Please register by Monday, March 27th at 12 noon so that we can determine how much food and drink we’ll need.

 

Tuesday’s events:

Wednesday, March 29

Microsoft is hosting virtual bootcamps on building IoT solutions this week, where they’ll talk about Windows 10, Azure, and how they fit with IoT, complete with presentations and hands-on labs led by Microsoft presenters as well as these IoT industry speakers:

You can catch these bootcamps in the company of other Tampa Bay area people interested in IoT at Tampa Hackerspace — check out their events, which are taking place Tuesday, Wednesday, and Thursday.

 

Wednesday’s events:

Thursday, March 30

Google has reached out to the TampaDev Meetup group and offered a free half-day seminar on the Google Cloud Platform. They’ll talk about the platform, Compute Engine, Kubernetes, Google data storage and data warehousing. This event will take place on Thursday morning and include breakfast.

 

Thursday’s events:

Friday, March 31

Saturday, April 1

Sunday, April 2

{ 0 comments }

In the coming weeks, I’ll be making a couple of presentations on developing two rather different types of mobile application development, for two rather different mobile platforms, for two rather different audiences programming in two rather different languages…

Tuesday, March 28: Building a guided meditation audio app for iOS

The “relaxation tape” came into being when the first personal music players — this was when cassette tapes were the most popular medium for playing music — became popular. These were recordings that featured soothing music and a narrator with a calming voice who would guide you through a relaxation or mindfulness exercise. As technology evolved, relaxation tapes became relaxation MP3s, and you can now find relaxation and mindfulness apps in the App Store, such as Take a Break (it’s free).

Tampa iOS Meetup is my Meetup group aimed at people new to software development or new to iOS development. Rather than study just a single aspect of iOS development, each Tampa iOS Meetup session is devoted to developing a complete app, and learning various things along the way.

This coming Tuesday, we’re going to build a relaxation/mindfulness app at Tampa iOS Meetup, and in the process, you’ll learn about:

  • Error handling in Swift: responding to errors gracefully rather than having the app come to a crashing halt and annoying the user.
  • Playing sounds: Playing both short sound cues and effects, as well as longer recordings.
  • Auto layout: Building user interfaces that adjust themselves to the screen size, from the (relatively) tiny iPhone 4S all the way to the large iPad Pro.

Join me, next Tuesday, March 28th at 6:30 p.m. at the Wolters Kluwer office (1410 N Westshore Blvd, Tampa) in Westshore for Tampa iOS Meetup’s session on building a guided meditation audio app! We’ll provide food and drink — bring your Mac laptop, and be ready to code!

To register for this event, visit the event page. Registration is free! Please register by Monday, March 27th at 12 noon so that we can determine how much food and drink we’ll need.

Wednesday, April 19: Android and Augmented Reality

Augmented reality — the overlaying of computer-generated images over a user’s view of the real world to provide an information-rich composite view — is a hot topic these days, what with enterprises getting excited about it, Gartner predicting that its mainstream adoption will happen in the next 5 to 10 years, and Apple’s apparent bet on it.

GDG Sun Coast is Tampa Bay’s Google developer group, run by Mike Traverso and Scott Thisse, and devoted to all matters related to software development for Google’s platforms. Mike’s invited me to speak at April’s GDG Sun Coast Meetup, where I’ll walk the group through building FaceSpotter, an Android app that adds cartoon-like features to people’s faces in real-time, in the style of Snapchat’s “Lenses”.

In the talk, you’ll learn about:

  • Incorporating the Face API into your own Android apps
  • Programmatically identifying and tracking human faces from a camera feed and getting their location and size
  • Identifying points of interest, such as eyes, ears, nose, and mouth on tracked faces
  • Drawing augmented reality text and graphics over images from a camera feed

Join me and the rest of the GDG Sun Coasters on Wednesday, April 19th at 7:00 p.m. at Tampa Bay WaVE (500 East Kennedy Boulevard, 3rd floor, Tampa) for GDG Sun Coast’s session on building an augmented reality app! Bring your laptop, and be ready to code!

To register for this event, visit the event page. Registration is free! Please register as soon as possible, so they can plan accordingly.

{ 0 comments }

Scan of a sidebar article from Harper’s Magazine: “The Elements of Guile”.

From Harper’s Magazine’s Twitter account. Click to see the source.

According to Harper’s Magazine’s Twitter feed, the list pictured above contains the sort of words and phrases that typically appear in work emails between “employees engaged in corporate wrongdoing.”

They were gathered by Ernst and Young in the process of developing their Fraud Triangle Analytics software, which “flags personal correspondence in which expression of ‘incentive/pressure’ and ‘opportunity’ coincide with ‘rationalization’.” Harper’s wryly observe that “In cases of corporate malfeasance, employees’ emails tend to rely heavily on terms like “want no part of this” and “deep shit.”

The words and phrases are listed below. The list is rather enlightening:

  • cover up
  • gray area
  • special payment
  • off the books
  • facilitation fee
  • bullshit
  • cash incentive
  • special service
  • under the radar
  • cookie jar
  • offshore
  • quid pro quo
  • adjust invoices
  • shady deal
  • hush money
  • friend fee
  • massage earnings
  • I’m the boss
  • for crying out loud
  • corrupt bastard
  • deep shit
  • want no part of this
  • hit the fan
  • It’s gonna be my ass
  • Everyone does it
  • too stupid to figure it out
  • fresh start
  • I don’t get paid enough
  • told me to
  • gambling problem
  • not a good idea
  • ticking time bomb
  • tired of this
  • It’s immaterial
  • treat me this way
  • part of my job
  • phony
  • divorce
  • girlfriend
  • medical bills
  • vacation home
  • wife is demanding
  • broke
  • charade
  • ploy
  • play ball
  • red tape
  • sweetener
  • Don’t worry about it
  • No one will notice

Thanks to Frank McGillicuddy for the find!

{ 0 comments }

Painting of a rock concert with a “Star Wars” twist: It’s Princess Leia on lead vocals, Darth Vader on bass, Luke Skywalker and Han Solo on guitars, Chewbacca on drums, and C-3P0 and R2-D2 on keyboards.

Click the image to see the nerd rock stardom at full size.

Techmeme in the spotlight

There are still times in a conversation with techies when I’ll mention Techmeme and they’ll have no idea what I’m talking about. Simply put, Techmeme is the technology news aggregator, and BuzzFeed News has seen fit to write about it and its creator, Gabe Rivera (pictured on the right). “I’d say Techmeme is still really a niche site,” says Rivera, but when the heads of Facebook, Google, Microsoft, and LinkedIn read it, it’s the kind of niche that you want to be in.

Using a combination of site-reading automation and human editorial, Techmeme provides people eager to follow the latest technology happenings with listing of current tech news articles. It’s an ever-updating “Page One” featuring breaking tech news stories and commentaries on those stories, from big tech news sites to tech blogs (ranging from big, corporate-funded ones to one-person developer blogs).

Better still, Techmeme leads you to interesting places. Not only do the big tech stories of the moment appear on Techmeme, but so do stories that link to that story. As a result, you get not just what’s going on, but also links to articles that follow up on, expand, provide context for and even counterpoint to that story, resulting in a rich tech news digest. This unique view into tech news is why tech reporter M.G. Siegler wrote that only three elements mattered in tech blogging: pageviews, scoops…and Techmeme.

This isn’t the first time that Techmeme’s been featured in an influential tech piece. In fact, it was due — every three years, the big news deal of the moment publishes a piece about it. Business Insider did it in 2014, The New York Times covered it in 2010, and TechCrunch founder Mike Arrington sang its praises in 2007.

Read the article, and then if you don’t already, read Techmeme regularly!

How to harness Techmeme for your own tech rock stardom

And now, the part you’re really interested in: how to get some of that Techmeme Googlejuice and readership for yourself.

The trick is a simple one: it’s to get Techmeme to mention your blog articles in the “Discussion” section for its stories, or better still, make one of your articles a featured article. Once that happens a couple of times, you’ll notice that your readership will grow from the “Techmeme bump” and if you play your cards right, all sorts of opportunities will follow. It’s worked for me at Global Nerdy, which often gets listed in “Discussion” lists for Techmeme articles and has had a few articles as feature articles, and it’s grown from zero readers in 2006 to over 8.7 million pageviews to date.

How do you get that? I gave away this secret back over a decade ago, all the way back in 2006, in an article titled Jason Calacanis Swiped Our 5-Step Plan for Becoming an A-Lister! It goes as follows:

  1. Go to Techmeme.
  2. Blog something intelligent about the top story of the day.
  3. Link to and mention all the people who have said something intelligent.
  4. Repeat for 30 days.
  5. Go to a couple of conferences a month.

That’s all there is to it: find featured articles in Techmeme, write something intelligent about it in your blog (don’t forget to link to the article!) and keep doing it. Like a lot of other things in tech, as long as you’ve got the threshold amount of smarts, it’s all about perseverance.

If you take on this challenge, let me know how it goes!

Are you looking for your next great hire?

I’m looking for my next great job! If you’re looking for someone with desktop, web, mobile, and IoT development skills who can also communicate to technical and non-technical audiences, or a marketer or evangelist who also has a technology background and can code, you should talk to me.

If you’d like to learn more, you can:

{ 0 comments }

Until his resignation yesterday, Jeff Jones was the second-highest ranking executive at Uber, where he held the title of President.

Here’s his full statement on his departure:

I joined Uber because of its Mission, and the challenge to build global capabilities that would help the company mature and thrive long-term.

It is now clear, however, that the beliefs and approach to leadership that have guided my career are inconsistent with what I saw and experienced at Uber, and I can no longer continue as president of the ride sharing business.

There are thousands of amazing people at the company, and I truly wish everyone well.

Jones had been with Uber a mere six months. His prior job was at Target, where Recode reports he was “its well-regarded CMO”, and in addition to being the president of its main ride-sharing business, his was the responsibility “to remake the company’s tainted image”. In order to get lured away from such a position at Target, Jones was probably offered a salary of considerable size and stock options of even greater potential value. Walking away from them — especially well before those options would’ve vested — wouldn’t have been a decision that he would take lightly. There’s also the fact that you can tolerate a lot when you’re one of the top dogs at a place that’s been valued as high as $70 billion.

Many of the stories that you’ll read about Jones’ departure will cite Uber’s problems as his reason for leaving, such as its “aggressive, unrestrained workplace culture” of “brilliant jerks”, bad driver relations, and its infamous discrimination issues as cited in engineer Susan Fowler’s blog entry about why she quit, as well as the firings of their SVP of engineering for not disclosing that he had to leave Google due to a sexual harassment allegation and their VP of product for sleazing at a company party. Accepting those reasons at face value requires assuming that he did no due diligence before taking the position, and read none of the stories about the problems at Uber that were circulating last year, and that he wasn’t explicitly hired to help improve Uber’s reputation.

If you’ve been on the internet over the past five or so years, you’ve likely heard the maxim that people don’t quit their jobs; they quit their bosses. This generally traces back to a 2008 article written by Jennifer Robison in Gallup’s Business Journal titled Turning Around Employee Turnover, whose conclusions are based on “Gallup research, which included a meta-analysis of 44 organizations and 10,609 business units, Gallup Polls of the U.S. working population, exit interviews conducted on behalf of several companies, and Gallup’s selection research database”.

“Most people quit for a few explainable reasons,” Robison wrote, and “at least 75% of the reasons for voluntary turnover can be influenced by managers.”

She also observes that after a certain point, no amount of money will make up for a bad manager. I understand this completely — I once took a 25% pay cut by changing jobs to get away from a management team that was slowly turning the workplace into something like Italy around the time of the Borgias.

As the number two person at Uber, Jones would’ve had only one boss with no one above him: Travis Kalanick, an almost cartoonishly-stereotypical Silicon Valley Ayn Rand fan. Given Recode’s reports that Jones is conflict-averse, that Kalanick is scrappy, tenacious, and amoral, and that the organization takes its cultural cues from Kalanick, it’s hard not to see Jones’ departure through the “people don’t quit their jobs, they quit their bosses” lens.

And once again, because it’s worth viewing if you haven’t seen this video yet:

Are you looking for your next great hire?

I’m looking for my next great job! If you’re looking for someone with desktop, web, mobile, and IoT development skills who can also communicate to technical and non-technical audiences, or a marketer or evangelist who also has a technology background and can code, you should talk to me.

If you’d like to learn more, you can:

{ 0 comments }

Here’s what’s happening in Tampa Bay and surrounding areas for developers, technologists, and tech entrepreneurs this week.

Monday, March 20

Tuesday, March 21

Wednesday, March 22

Thursday, March 23

Friday, March 24

Saturday, March 25

{ 0 comments }