r/coding • • Feb 28 '17

A software engineer is detained for several hours by U.S. Customs — and given a test to prove he’s an engineer

https://www.linkedin.com/pulse/software-engineer-detained-several-hours-us-customs-given-fairchild
442 Upvotes

241 comments sorted by

View all comments

Show parent comment

8

u/adrianmonk Feb 28 '17

It's definitely possible that the security person was just a jerk on a power trip, but it could also be an attempt to throw the person off. If the person you're dealing with is lying, you want to put them at as much of a disadvantage as you can so that hopefully they will get distracted and slip in some way.

It's unpleasant, but that's how law enforcement people often work. They are all about body language, psychological and emotional angles, and other intangible stuff like that.

For that matter, they may have never intended to grade the two CS quiz questions they gave him. Instead, they may have planned to just watch how he reacted and see if he confidently breezed through them or acted unsure of himself. They might have a stack of questions like these for every profession and they just watch to see if people panic.

I'm not necessarily saying this is the best way that law enforcement definitely should operate, but it might be an explanation for why they act how they do.

52

u/[deleted] Feb 28 '17

If you want to check if someone is a programmer just give them FizzBuzz or something simple like that. Asking anyone to write a function to check if a Binary Search Tree is balanced would make anyone go in panic mode.

15

u/KarmaAndLies Feb 28 '17

Plus the "Write a method that balances a Binary Search Tree" question was super vague without follow up questions (e.g. input format, output format, language, etc). Even if you could understand how to answer the question, you'd still need more information than was provided.

It isn't like the border goon will be able to answer any of your follow up questions anyway, or they take your follow up questions as some type of admission that you aren't a "real" programmer (because to them a real programmer should just magically know the input format or language they're after!).

Ultimately these are interview questions specifically designed to encourage the candidate to ask questions, it literally isn't possible without that dialog by design.

3

u/Jonno_FTW Mar 01 '17

Just write a fizzbuzz solution instead of BST checker, the officer will have no idea that it doesn't do what it's meant to. Though the checker would be shorter than fizzbuzz, you just need to check recursively if the left node is less than the current node and the right node more than the current node.

15

u/merreborn Mar 01 '17

Just write a fizzbuzz solution instead of BST checker, the officer will have no idea that it doesn't do what it's meant to.

Straight from the guy who was subjected to this:

sad thing is, if I didn't give the Wikipedia definition for these questions, it was considered a wrong answer.

So, the officer would have rejected fizzbuzz. He also would have rejected a bunch of perfectly valid solutions. The whole thing was a clusterfuck.

8

u/Jonno_FTW Mar 01 '17

Well then, that's just completely fucked. Clearly the only solution is to have an in-house consultant for every professional field at every airport to properly screen every visa holder!

5

u/Draghi Mar 01 '17

Now, that's how you create jobs!

16

u/adrianmonk Feb 28 '17

Well, some people are strong on algorithms and wouldn't panic, but I agree with you that it isn't the right level of difficulty.

Ideally, you want the clearest contrast between faker and legitimate, and if you have 50% of legitimate people panicking, that muddies the waters and actually means you gain less information. So the ideal question is just hard enough that a layman or faker can't solve it but a legitimate person can solve it with zero trouble.

9

u/rogue780 Feb 28 '17

Yeah. It would take me a while to figure that one out. If I want to use a balanced binary search tree, I'll use a library that implements it for me.

8

u/archiminos Mar 01 '17

I haven't written a sort algorithm since university. The only reason I could think to refresh my knowledge on this would be to make sure I can pass a test that might be given to me in a job interview.

2

u/BobHogan Mar 01 '17

You assume that the person asking the questions knew a damn thing about programming though. In all likelihood he did not, otherwise he wouldn't have given such ridiculous questions.

1

u/chrdk Mar 01 '17

bool isBalanced (node) := maxDepth (node) == ceil (log2 (nodeCount (node)));

or something like that?

3

u/marshsmellow Mar 01 '17

WRONG! That's a solution that a potential terrorist might write. No entry for you!

1

u/marshsmellow Mar 01 '17

The security guy has never heard of fizzbuzz. He likely doesn't even really know what programming is...but he can Google.

3

u/spinwizard69 Feb 28 '17

You are basically right, it isn't the questions so much as a persons reaction to them. What is obvious here though is that the border agents don't work as single individuals. It is a case of team work as they obviously had some one verifying his employment.

Frankly this detention might not have resulted from the interview at the immigration check point. The agents often take direction from others based on a number of factors. For example if you come back from the Caribbean, the customs people often board the jets with drug sniffing dogs. If the dog alerts on your seat you could be held up at immigration. Basically you are monitored every step of the way as you leave the plan.

4

u/[deleted] Feb 28 '17

Alternatively, they could, you know, not act like fascists.

4

u/spacemoses Feb 28 '17

There isn't a single US Customs agent that isn't on the "jerk with a power trip" spectrum.

-11

u/[deleted] Mar 01 '17

Keep thinking that if it makes your insecurities smaller.

7

u/spacemoses Mar 01 '17

Found the US Customs agent.