Last week, a video went viral that captures how technology is changing human behavior. The video, “A Magazine is an iPad That Does Not Work,” shows an adorable one-year-old girl frustrated by the lack of functionality in her magazine. From a toddler’s perspective, paper is just a broken touchscreen.

YouTube Preview Image

Times have changed. This toddler will never pick up a magazine at the grocery store or buy a textbook at the bookstore. She’ll probably never visit a newsstand or unfold a road map.

In today’s fast-paced world, we want more than just static content, we want the dynamic interaction that comes with apps. For the digital native generation, touchscreens will be the only way to access content, and the portal to the app world.

This isn’t just about the one-year-old girl. We all want more functionality in our lives, and technology is evolving rapidly to meet our needs. It is only a matter of time before we’re all saying, “Remember the days before apps, when things were in print?”

In our engineering interviews, we often ask candidates to write a binary search on paper, and the candidates always do it with lower and upper variables. But they almost always fail to maintain consistent semantics for these variables, and their algorithms are usually buggy as a result.

For example, this Quixey Challenge problem demonstrates a bug we often see during interviews. Can you find it?

def find_in_sorted(arr, x):
    '''
        Returns index of x in arr
        Precondition: arr is sorted
    '''

    def binsearch(lower, upper):
        if lower == upper:
            return -1
        mid = lower + (upper - lower) // 2
        if x < arr[mid]:
            return binsearch(lower, mid)
        elif x > arr[mid]:
            return binsearch(mid, upper)
        else:
            return mid

    return binsearch(0, len(arr))

We tell our interview candidates to take their time and make sure their algorithm is correct before we judge it. They often respond that it’s impossible to have confidence about their algorithm’s correctness before running it. This “guess and check” approach to algorithm design is fine for quick hacks, but we’re going to explain why it lacks something important.

Rice’s Theorem

You’ve probably heard of the halting problem, and you’ve probably seen a proof of why a program’s halting behavior is impossible to analyze in the general case. But you might not know there’s a profound generalization called Rice’s theorem which follows as a simple corollary.

Imagine you’re given an arbitrary computer program. You know you might not ever be able to figure out whether it halts, but it seems like you should at least be able to figure out whether its behavior is equivalent to the program print 'hello world', right?

Actually, Rice’s theorem says that computer programs are resistant to understanding of any kind in the general case. So no matter how much static analysis and simulation you run on the code, no matter how many different sticks you poke it with, even the seemingly trivial property of being a Hello World implementation is generally impossible to discern.

As a programmer, you have to wade into the Ricean ocean of un-analyzable code, and find a way to float. Each line of code you write is an opportunity to fall off the surface of provable correctness into the chaotic froth.

Invariants

In light of Rice’s Theorem, how can you manage to write correct programs? The answer is that you stay away from the Ricean “general case” by maintaining invariants – statements about your program that remain true as the program runs.

A common type of invariant you want to maintain is variable semantics. For example, a good binary search might maintain the invariant that the lower variable is always less than or equal to the algorithm’s final output (except when the binary search turns up empty-handed).

Another common type of invariant applies to the program’s control logic. For example, you can declare that any time the value we’re binary-searching for isn’t present in the input list, control must be routed to a single return -1 statement. Many engineering candidates fail to maintain this invariant, and their algorithms crash when given an empty list. If you’re careful to maintain the invariant above, an empty list won’t even be a special case, because your algorithm will handle it the same way it handles an empty search interval demarcated by the values of lower and upper.

It’s important to approach coding problems with invariants in mind. An invariant is like a fragile shell that protects the correctness of your code as long as it’s properly maintained. And if you’ve ever tried gluing a cracked egg back together, you know what it’s like to debug an algorithm with no well-maintained invariants.

When we watch an engineering candidate write code, we try to gauge how well they’re thinking in terms of invariants. If we see them adding a bunch of special-case logic to their binary search, it’s a telltale sign that they haven’t developed an invariant-savvy mindset. The best programmers have a high-level understanding of their code, and know how to wield invariants to gracefully avoid off-by-one bugs. That’s why we test engineering candidates by asking them to write a perfect binary search on paper.

What is an app?

October 17th, 2011 | Posted by Quixey in App Trends - (0 Comments)

It’s time we answer the question, “What exactly is an app, anyway?” Is it just a little square that lives on our mobile devices?

In reality, apps take on many different forms: mobile, desktop, web and browser based. It doesn’t matter where apps live. They all share a common purpose regardless of platform: enhancing the user experience. So today, we wanted to focus on the true definition of an app.

At Quixey, we define apps as simple tools to help you throughout your day. They are tools that add functionality to platforms (Mac, Windows, Chrome, Windows, Facebook, Web, etc). These tools enable you to utilize technology in a way you couldn’t before.

In the not-so-distant past, many of us remember the frustration of installing software (apps) via CDs on our desktop computers. “Software” is a term that has been around since the 1950′s. The way we receive and consume software has changed radically in just a short period of time (all of us at Quixey fondly remember accumulating stacks of AOL CDs back in the day).

We’ve seen software shift from large desktop applications to light apps installable on every platform. The rise of the cloud, increasingly cheap hosting solutions and simple APIs have enabled millions of new apps to reach the market.

Apps Live on Many Platforms

Apps used to be limited to desktop software. But nowadays, apps live on various platforms and many apps live on multiple platforms.

Let’s do a quick quiz. When you check Facebook.com on your laptop, is that an app? How about when you check Facebook on your Android phone? Are they the same app?

The answer is yes across the board. The only difference between Facebook.com and Facebook for Android is where the app lives. Facebook’s website lives on the web, and you can access it through any browser you want. The Android app lives on your phone, and you access Facebook’s content through their app built specifically for Android. Both are driven by the same content but are accessed from different digital mediums. As a matter of fact, Facebook is one of the few apps accessible from eight different platforms.

Apps as Platforms
We are starting to see apps develop into their own platforms. At this past TechCrunch Disrupt, everyone and their mother was trying to be the “platform for x.” By becoming a platform and releasing an API for developers, apps can offer third-party functionality to their users.

One of the best examples of an app as a platform is Facebook. Let’s look at FarmVille, one of the most famous Facebook apps of all time.

FarmVille runs on top of Facebook as a third-party app. FarmVille leveraged Facebook’s social graph and users to build one of the internet’s most popular games. In return, FarmVille gave back to Facebook by adding functionality to their platform. Zynga enabled Facebook to become a popular place for millions of people to play games all day long.

A platform provides the basis for an app’s development. In return, that app brings additional functionality back to the platform.

Why the Definition of an App is So Important to Quixey

Apps are everywhere. This is at the core of Quixey’s philosophy. That is why we are constantly adding new platforms to our search. We want to make sure you can always get the most out of your technology by finding the right apps, regardless of the platform or device.

The Scobleizer has spoken…

A week ago, we met with the legendary Robert Scoble at his house in Half Moon Bay to catch him up on Quixey’s progress.

Our co-founders, Tomer Kagan and Liron Shapira, dove into everything ranging from our company philosophy, to hiring, to how our database works. They even gave away a bit of our secret sauce…

As Tomer says in the video,”Once an investor asked us, ‘What’s the special equation that makes this work?’ and Liron jumped in and said, ‘There isn’t a special equation, nothing we do is special; it is just a thousand really clever things that you can come up with easily.’”

Enjoy the show!
YouTube Preview Image

Here at Quixey, we often ask our friends, “If you didn’t have Quixey, how would you find apps?” We usually get one of two answers: browsing the app store and asking friends for recommendations. And, in both cases, discoverability is limited.

 A number of startups make it easier to see what apps our friends like. For example, one company uses the notion of a friend’s “stamp of approval” to influence our behavior. This startup is betting that you are more likely to download an app if your friends have already approved of it. This is the same logic behind Google’s +1. They both bet that you are more likely to chose a search result if your friends “like” that result.

Although social recommendations play an important role in app discovery, they have one critical shortcoming: you only know as much as your friends know. This is especially a problem when you are looking for a utility app, one that does something specific.

Unless you have a friend who is already using the exact app for what you want to do, chances are slim you will find what you want. Have you ever turned to your friend and asked, “Do you know if there is an app for tracking medical records?” only for them to reply with a semi-related app or a shrug?

In the case that your friend doesn’t know the app you’re looking for, you set out to find it on your own. At your disposal are the categories in the app store, and Top 10 lists as well as review sites. But the app store is large, and narrowing down categories to your exact needs is cumbersome. Further, trying to find valuable information to help you decide on an app can be so unwieldy that you often don’t even bother.

Luckily, there’s search. A good search is quick to use, and gives you all the relevant apps instantly, regardless of whether your friends know of them. It also helps you decide which app is best. It does this by providing all the information you would have found had you browsed through apps and read their reviews. This is exactly why we scrape blogs, review sites, and other social media to learn about each app and put this data in one place.

Ultimately, social recommendations and app categories are great features, but are not enough to depend on for discovery. Quixey develops a comprehensive picture of what an app is capable of doing, and draws on the collective knowledge across the app space. As a result, we are able to return the best possible results, no matter the query.

We hire engineers who think in algorithms, dream in code, and eat control structures for breakfast (e.g. Froot Loops). We’re looking for people with a sixth sense for good code – people who can fix bugs with their mind. So today, we’re introducing the Quixey Challenge.

The Quixey Challenge
We show you a famous algorithm with a bug, you fix it in 1 minute or less.

The Prize

If you successfully complete the challenge, we’ll send you

  1. $100
  2. An exclusive “founder’s edition” Quixey T-shirt

Not bad for 1 minute!

Ground Rules

  1. The algorithm will be implemented as a Python function.
  2. The function will not have a syntax error.
  3. The function won’t always return the correct thing.
  4. It will be possible to make the function return the correct thing either by adding one line of code, or by modifying one line of code.

Test Drive

YouTube Preview Image

Winners

  1. Tom McCabe
  2. Mathijs Vogelzang
  3. Zachary Travis
  4. Andy Terrel
  5. Zack Bloom
  6. Tanooj Luthra
  7. Dylan Lukes
  8. Felipe Restrepo
  9. David Bieber
  10. Jacob Hurwitz
  11. Mark Vitale
  12. Karl-Aksel Puulmann
  13. Arjun Comar
  14. Anand Oza
  15. Shawn Park

How to Play

Got a minute? Just send an IM to Skype user quixeychallenge. We’ll be monitoring that account today (Monday, October 10) from 7am to 7pm PDT. Good luck!

*Update: Due to the success of the Quixey Challenge, we created quixeychallenge.com, where you can complete practice questions and qualify for upcoming challenges.