top | item 13741746

“I was just asked to balance a Binary Search Tree by JFK's airport immigration”

660 points| z3t1 | 9 years ago |twitter.com

314 comments

order
[+] rjtobin|9 years ago|reply
Once (also in JFK) I was quizzed a bit by the CBP officer. I told him I was a math grad student, he said "well, then tell me about the Euler problem". I explained that Euler was a fairly prolific guy, and asked if he could be more specific. He didn't relent, apparently he had seen some documentary that was all about the "Euler problem".

Eventually, we moved on to my background, and I mentioned I had done a masters in computational neuroscience. He said something like "oh neuroscience, my great aunt had that", I think he thought it was an illness? Was sort of expecting the reality TV cameras to be busted out at that point...

He let me through though! Usually I clear immigration in Ireland (one of the few places you can do the immigration before you leave), and those folks are always much more pleasant.

[+] minipci1321|9 years ago|reply
I was going to SV and landed at SFO. The flight was long and I was tired, and raised additional suspicion of the security guy. He asked me about the purpose of my (two-week-long) visit. I replied "software integration". He asked then, "what sort of software integration can be done in only 2 weeks?" I must say, this question remained unanswered. He let me in, it was 2006.
[+] yzmtf2008|9 years ago|reply
I was once traveling back from Italy after attending PKDD conference. I was really sick and had a really bad headache, so the following exchange really scared me:

    "Why did you go to Italy?"
    - To attend a conference.
    "Which conference did you attend?"
    - European Conference on Machine Learning
    "Machine Learning? (smile) How do you learn from machines?"
I forgot the exact answer I gave, but I was pretty afraid that he had a Wikipedia page on "Learning from Machines" and would not let me pass if I failed.
[+] bane|9 years ago|reply
One time, while going into Panama, the border agent wrote a couple words on a sheet of paper and asked me to pronounce them: ship, sheep. Thinking this was some kind of shibboleth, I complied. She then wrote a couple more, I think they were chair and share, again I complied. Finally she wrote another pair, I don't remember what exactly, but I was getting very worried that this was some kind of bizarre profiling by accent and I was about to find myself in a Panamanian detention center.

She looked up and laughed, and in very broken English explained she was trying to use the accents of incoming Americans to improve her accent to help in her job when dealing with English speaking foreigners.

[+] areyousure|9 years ago|reply
As an additional data point, in 2000, both a fellow traveler and I were asked mathematical questions by US immigration officers in Canada. He answered correctly, I was unable to do so, but we were both allowed to enter without further investigation. I thought the experience was fine.

I have had less pleasant, aggressive questioning dealing with British immigration when flying into Heathrow as well as Irish immigration when flying out of Heathrow, though in the latter case the proximal cause was my fellow traveler choosing to lie. :(

[+] jlg23|9 years ago|reply
> Usually I clear immigration in Ireland (one of the few places you can do the immigration before you leave), and those folks are always much more pleasant.

FYI: It's not just Ireland that let's you clear US-immigration before departure: https://en.wikipedia.org/wiki/United_States_border_precleara...

I've been going through Dublin myself for years, and I can highly recommend it: In worst case, you'll be told to leave the terminal, but you won't go into a holding cell - and yes, officers there are much more friendly than their counterparts in the US (I guess they are all infected by the Irish hospitality).

[+] peteretep|9 years ago|reply
I entered the US a few times on a visa waiver for business, and (truthfully) stated my business as "teaching dating advice to men". I got a lot of laughs, but luckily no actual in-depth questions.
[+] xyzzyz|9 years ago|reply
He probably meant the problem of the seven bridges of Koenigsberg, which was solved by Euler, and is one of the easiest to explain to laypeople, which is good for making documentaries.
[+] xster|9 years ago|reply
I'm not saying we shouldn't resist these types of arbitrary unofficial screening processes whenever we encounter them but if I weren't such a confrontational type of person for these things, I would just listen to my lawyers and just bring employment verification letter and visa letters with me whenever I travel abroad.
[+] seanmcdirmid|9 years ago|reply
Most of Canada has USA immigration in their airports, so it's not exactly rare.
[+] belltaco|9 years ago|reply
I wonder if P = NP would end up being proven by someone who didn't want to be sent back after 23 hours of traveling.
[+] egeozcan|9 years ago|reply
More I read about things like these, even more I love Germany (my new home). The officers in Frankfurt Airport are always nice and I never had any problems nor heard about one. I hear it's even better in Berlin.

I don't understand why host countries don't try to make themselves the most favorite country in the world for their guests. I believe, "not allowing terrorists/drug dealers/illegal workers etc. etc. inside" is just the marketing as I seriously doubt people who slip through the cracks of a saner screening process would be a significant problem. Therefore, I wonder the real reason but can't think of any.

[+] jpalomaki|9 years ago|reply
In a away this actually makes sense. Instead of relying on automatic systems and algorithms, you rely on people, namely the agent performing the interview. A short chat about selected topics might be actually quite revealing. Point not being if you know the exact right answer for the BST question but more how you react and if there are inconsistencies in your story (most people are pretty bad at lying).

All of this could be backed by the personal data has been collected before hand.

The old (and often linked?) article about airport security in Israel[1] describes how the actually rely a lot on people being able to spot strange behavior.

[1] http://www.huffingtonpost.com/daniel-wagner/what-israeli-air...

[+] madeofpalk|9 years ago|reply
What would happen when I answer with "I don't know what a Binary Search Tree is or how to balance it - I'm just a shitty CSS developer"?
[+] cperciva|9 years ago|reply
This is exactly correct. When I returned from a weekend vacation in New York a few years ago, Canadian customs asked me about the tourist sites I visited. It's not that they thought attending a musical and visiting the 9/11 memorial was suspicious; it was just a convenient topic of conversation while they watched to see if I seemed nervous or otherwise suspicious.
[+] donretag|9 years ago|reply
I agree. I once was returning to the US via Newark airpot (in New Jersey) and the agent asked me what subway stop I lived by since I lived in NYC. I knew that I could have responded any answer, so he just want to see how I would react.

Once I was returning from a year long trip where I visited 16 countries. Too many for the immigration form, and half of them were visited on another passport (dual citizen). Immigration asked me what country I visited and hesitated a bit. Then I told him that I did not know how to answer since I have been traveling around the world!

[+] tn13|9 years ago|reply
Sorry but that is the worst idea ever. CS is a far too wide a subject and border agent is a pen pusher who does not possess competence to ask any questions on that subject.

I know several engineers who are very good and probably have never heard of BST because they are too busy writing CSS or designing circuitboards.

[+] wink|9 years ago|reply
I'd love to know if there are as many false positive detainments for no apparent reason in Israel as in the US (percentage-wise of course) - because all the people I know who ever travelled there found the security measures to be "maybe a bit much" but never "ridiculous, while also a total security theater" like in the US. Or didn't I just hear the stories?
[+] fny|9 years ago|reply
+1: On more than one occasion I've had to fly without my driver's license, and the agent has always grilled me with the clear intent to see if I'm lying.

1. Why'd you lose your wallet? [Uhh...?]

2. When'd you lose it? [At a software conference this past weekend]

3. What languages do you know? [Ruby, JavaScript, Java, Some C]

4. So how many days ago did you lose your wallet again?

[+] imode|9 years ago|reply
oddly enough, I'd probably get more attention from border agents than my actual colleagues.

I wonder how long they'd put up with my ramblings about memoization and search optimizations before they let me through. :P

[+] BHSPitMonkey|9 years ago|reply
Wouldn't a deceitful person just claim to have an occupation that they are actually knowledgeable about? This is basically just taking a test where you get to pick the subject.
[+] joncrocks|9 years ago|reply
I think the point is whether it's a good allocation of resources.

Lets say you have two borders. One has a cursory check of documentation, so allows people to sail through. This costs 2X to man. Another has a more interactive exchange, but each interaction takes longer, so costs 5X to man.

So you either pay 5X, or 2X and then have 3X to do something else with. Could you use that 3X to better protect the border through pro-active investigation and analysis?

[+] ubernostrum|9 years ago|reply
On the other hand, attempts to do this in the US have led to the "behavior detection officers". And you can Google that phrase for a roundup of how poorly it's performed.
[+] peterkelly|9 years ago|reply
This happened to an Australian guy recently. Was asked to code up some stuff in Python.

http://www.news.com.au/travel/travel-advice/travellers-stori...

[+] caf|9 years ago|reply
What happens if you're a plumber - do they get you to fix a dripping tap?
[+] John23832|9 years ago|reply
I'm sorry, but after the stress of traveling though an airport, I'm not coding anything until after I get home (or to a hotel) and rest.
[+] orless|9 years ago|reply
Around 2002 we (a group of Russians) were returning with friends from a ski trip in Austria back to Germany. There happend to be a police control in the train. Then I've realized I had no passport with me. The best ID I had was my business card (of course, no photo on it).

So the policeman looks at it and says "Oh, the database department. Which databases do you guys use?" Basically I was able to identify myself with some Oracle and knowing who Scott Tiger was.

The policeman appeared to be an IT drop-out who switched to police.

[+] pfarnsworth|9 years ago|reply
I'm going to wait for more information before believing this. There have been so many cases of fake twitter outrage that it makes sense to wait a day or two before taking out the pitchforks.

What's sad is that in this climate it's not completely unbelievable that something like this could happen.

[+] gk1|9 years ago|reply
Something similar happened to me around 5 years ago. I'm a white 20-something male and was returning from Colombia on my own, with no bags except a small backpack. I guess that seemed suspicious enough that I was asked specific, quiz-like questions about my profession, and then sent to secondary screening.

In other words, this does not seem to me like anything new.

[+] wrasee|9 years ago|reply
I think there's been quite a bit of overreaction here.

Part of their job is simply to determine that you are who you say you are. They do this every day - within reason I expect they can ask you any arbitrary question related to you and your life to observe how you respond. They just want to catch those out that aren't, for whatever reason, being genuine about their story. I think there's a false assumption here that somehow @cyberomin's ability to actually _solve_ a BST was in some way tied to his likelihood of entry. That's obviously ridiculous. I imagine his response was still genuine enough that they believed him. Frankly as another commenter joked, I think they could have asked him to prove P=NP. It's when you reply confidently with an 'obvious' solution that they might raise an eyebrow.

Yes it would be unreasonable if their ignorance actually lead to you being denied entry. But in not one of the experiences here, or with @cyberomin, was that actually the case. The thing is, of course, that they're aware of their ignorance and the absurdity of their questions. You see, they know that they're bluffing. That's kind of the point.

It is, perhaps rather unfortunately, part of their job to make you feel uncomfortable, ask probing questions and weed out inconsistencies in your responses. Isn't that part of professional questioning? I can understand the frustration at the abruptness of the questioning, and it's hardly a friendly welcome. I've been angered leaving immigration before and I have to remind myself that ruffling my feathers is all part of the act. When first complaining to a friend she asked, "what did they insult you or something?" Actually, no. They just asked me lots of questions.

Clearly I'd like to think some questions are off-limits - I know there have been justified concerns about this - especially recently. And I understand this is hot topic right now - precisely why I think we should be careful - more careful than ever - not to overreact. From what I observe: The guy arrived, he was asked questions about his profession, his answers were evidently sufficient and he was let in. It happens to thousands of people every day. Honestly? I don't think there's a story here.

[+] everybodyknows|9 years ago|reply
Returning from Canada back in the 90's, I was asked what I had been doing there.

"Attending a conference on computational geometry."

"What's that?"

Pause for thought -- several seconds.

"Applying computers to solving problems in geometry."

This got me waved in. Co-workers told of the encounter later on proposed an alternative reply: "You wouldn't understand." Given the tone of the agent, those might have been very costly words.

[+] cperciva|9 years ago|reply
Could have been worse. If you had been at a conference on algebraic geometry, you might have been the mathematician who started talking about blowing up points on the plane while in the security line up...
[+] petee|9 years ago|reply
After watching too many episodes of border patrol-like shows, I agree that it would be a very bad route to take: If you are demeaning, they'll only dig deeper; if they "don't understand" they _will_ find someone who does, or take your phone and call your boss to find out.
[+] fahimulhaq|9 years ago|reply
I want to joke that CBP might be looking for referral bonuses by referring great candidates to tech companies.

However, if it's really true, it is depressing. He was actually given an A4 sheet to balance a BST. Wow.

What if he failed the test? I assume that CBP cannot deny you entry because you didn't brush up on your algorithms and data-structures during your flight. But, they can still keep you detained for secondary screening.

[+] misja111|9 years ago|reply
Not as spectacular, but 4 years ago when I arrived at SF airport after a 11 hour trip the immigration officer asked why I was there. I told them I was visiting a software conference. To my surprise he then asked me to write 16 in hexadecimal. Luckily I didn't screw up.

I asked him how come he knew about that stuff and he told me that in a former career he was working in IT as well. I thought it was funny.

[+] officelineback|9 years ago|reply
I was just overcome with anxiety...the answer is 10, right?
[+] shostack|9 years ago|reply
Goes to show you never know what someone knows from their previous life experiences, and that you should not judge a book by its cover.

Given how poorly academics, research and other fields pay, I wouldn't be entirely surprised to find that there are highly educated people trying to make ends meet working for the TSA or Customs. And odds are they are eager to dust off that knowledge and put it to use when they can.

[+] sAbakumoff|9 years ago|reply
December 2016, I arrive in JFK from Moscow and a border officer asks me about the purpose of my visit. I explain that I attend the business meeting in NC. She wants to help and informs me that I have to pick up my luggage in NYC and then check it in for my next flight. I smile and reply "fortunately I don't have any luggage". Immediately she becomes suspicious of me and asks "But you are here for a business meeting, where is your business suit?" I explain that I am IT and everyone in my company is OK with a casual style". She nods and let me go. "Thanks God IT does not really care about my clothes" I think and successfully enter the land of the free.
[+] baursak|9 years ago|reply
Plot twist: she knew you didn't have any luggage all along. That information is available to her when she pulls your info up on her computer.
[+] vickychijwani|9 years ago|reply
I have a theory on how CBP is trained to scan people, that seems more plausible without assuming malicious intent: they're not expecting you to know exactly how to balance a BST, but just enough to hold a conversation about it while they look for telltale signs. My guess is that even a reply like, "Look, I'm a self-taught web developer and I don't deal with algorithms day-to-day, sorry. But you can ask me web dev questions if you wish." would work.
[+] Main_|9 years ago|reply
Agent: "wrong answer,you are not allowed entry, good bye".
[+] zwischenzug|9 years ago|reply
Not even close, but similarly: travelling to Israel for work some years ago I was asked what I did for a job. Software engineer, I said. 'Where is your laptop?' I explained I didn't have one, that I worked only on desktops. It took some persuading the guy that you could be a software engineer without a laptop.
[+] mstade|9 years ago|reply
I flew to the USA late last year, through London. When going to the desk for my connecting flight at LHR, the gentleman there did some sort of pre-authorization and asked me a number CS question. Nothing as specific as the above, but things like what languages I used for work, specific tooling, who my clients were etc. It felt quite strange to be asked these things, it's never happened to me before when traveling anywhere including stateside. What's more, this was a person hired by American Airlines, not some CPB officer – or, at least, it seemed that way.
[+] Corrado|9 years ago|reply
At first I thought this was a joke, but after reading some of the comments here I'm truly scared of traveling abroad. I've been programming computers for 25 years and I don't think I could build a binary search tree, let alone balance one. :O
[+] ankurdhama|9 years ago|reply
Potential answer: "Call the balance method on the BST object"
[+] dorfsmay|9 years ago|reply
The best CS subject to talk about in such context would be "race conditions"!
[+] khazhou|9 years ago|reply
Google's recruiting tactics are getting ridiculous!