Software Engineer Detained At JFK, Given Test To Prove He's An Engineer (mashable.com)
New submitter mendred quotes a report from Mashable: Celestine Omin, a software engineer at Andela -- a tech startup that connects developers in Africa with U.S employers -- had a particularly unwelcoming reception when he deplaned at John F. Kennedy Airport and was given a test to prove he was actually a software engineer. A LinkedIn post detailing Omin's challenging experience explained that upon landing in New York after spending 24 miserable hours on a Qatar Airways flight, he was given some trouble about the short-term visa he obtained for his trip. According to the post, an unprepared and exhausted Omin waited in the airport for approximately 20 minutes before being questioned by a Customs and Border Protection officer about his occupation. After several questions were asked, he was reportedly brought to a small room and told to sit down, where he was left for another hour before another customs officer entered and resumed grilling him. Omin was instructed to answer the following questions: "Write a function to check if a Binary Search Tree is balanced," and "What is an abstract class, and why do you need it."
Write something in Forth.
I am not interested in articles about life extension advancements.
It's been so long since I even looked at having to do one of those, that I would be put back on the next plane home, LOL.
It's total nonsense that the USA is detaining and turning away so many people at the border. By the time someone gets to the border (with visa in hand), the only question should be whether they match the visa - whether they are who they say they are. The "extreme vetting", or whatever you want to call it, should have already happened when the were granted the visa.
Of course, if you really have evidence that someone is planning a terrorist attack on the USA then rather than simply turning them away to try again later you should be letting them in - and then throwing them straight in jail.
That's something that should be checked before issuing a Visa, not after they're already on the fucking plane here.
Your hair look like poop, Bob! - Wanker.
This is an understandable and completely normal security precaution.
Really?
Haven't most of the Islamic terrorists who've been caught trying to fuck with airports and air traffic been trained engineers?
The correct answer to all of these questions is "why don't you look on stackoverflow?"
He sat there an hour while someone consulted someone else who consulted someone else who knew someone in Government that knew someone in private industry to ask what kinds of questions would be asked of a software engineer.
In the ensuing game of telephone the declared needs changed. Questions that probably should have been as simple as "What extra include is necessary in C++ over C" and "What is an IDE?" which very few non-programmers could answer anyway were replaced with ones that are harder to answer.
It's actually not an entirely bad idea to confirm that someone coming in for a specific reason for a specific class of visa is here for legitimate purposes, but if the Government is issuing th visas in the first place then it should not be difficult to know what kinds of questions need to be asked, so that there isn't an hour delay, and so that the questions are considered and reasonable.
Do not look into laser with remaining eye.
Like it or not that's what a sane immigration policy looks like.
Lol no sane immigration policy has border patrol agents administering visas at the border. This shit woulda been done when the visa was issued waaay before he gets to the border.
Let me guess, you work in one of those "diversity" hell-holes where management is much more concerned about the penis:vagina ratio and could care less about whether or not the people there know what they're doing? And all the competent people have long since moved on to places where they get paid better for knowing how to do the work and aren't just there to be a special snowflake?
I am impressed with the questions. These are questions that any competent programmer should be able to answer, but a non-programmer (such as a shoe or underwear bomber) would not have a clue. This actually seems like a pretty good test.
Call me incompetent, then. I've been making a decent living as a software engineer in this country for 25 years, having graduated from a reasonably prestigious school with a 4 years CS degree. Not once since college have I ever had a need to write code to construct or balance a tree on my own. I doubt very much that I could come up with a function to balance a tree out of the blue with no prep or review, nor is there much real world need for most developers to do so.
Not to mention after 24-30 hours on a plane.
-=This sig has nothing to do with my comment. Move along now=-
Almost nobody today has a need to know how to balance a B-Tree. Unless they happen to work on the innards of a database system, library, etc.
Sure, I learned this 35 years ago, and sure we had to do it for some class. I suppose Computer Science students still have to do it today. I've even done it in practice, but it was a LONG time ago. I would have to look it up, as would most software engineers.
In fact, any software engineer that would write something like this off the top of their head is engaging in bad practice. That would be my answer!
As a practical matter today, if you really needed to do it, you would search for best algorithms. And then question whoever asked you to do this, as B-Trees are pretty old and lame at this point There are better data structures to accomplish the goal.
What next? Ask somebody to write a compiler? "Sure, get me the Dragon Book..." (But, as well, that is surely obsolete today, as well.)
The border agent either Googled for some questions to ask a software engineer, or failed a Google interview exam. Which - I've read, Google doesn't do any more, and for good reasons.
Well... I didn't want to go there anyway.
const int one = 65536; (Silvermoon, Texture.cs)
SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
Except, you know, an expert at getting through borders undetected, or anyone who has experience with social engineering...
So congrats, you weeded out the amateur criminals, and have a false sense of security about the professional ones.
As a potential lottery winner, I totally support tax cuts for the wealthy
I had something similar although less exciting happen to me in early 2004. On claiming to be an electrical engineer, the immigration agent or whatever the US calls him scrawled a physics equation on a piece of paper and asked me what it meant to me. He was satisfied with whatever explanation I gave and let me through. I don't know if they've always done this, or if it's a post-9/11 thing, but it's been happening for more than a decade.
Of course it's been happening for a long time. Obama sent more illegals back home than all previous Presidents combined.
None of that mattered.
When Trump became President, suddenly this is a big deal.
I heard the news today talking about the SEAL operation in Yemen where one of our sailors died. They're picking it apart trying to figure out if the operation was a "success", "worth it", etc. What a welcome change after 8 years of nobody talking about *anything* that happened in the Middle East because we had to pretend that the Nobel Peace Prize winner wasn't actually bombing the shit out of something like 5 different countries with drones, killing kids and anyone else who happened to be in the wrong place at the wrong time. I'm guessing that's going to suddenly be a big fucking deal again.
Do you have ESP?
Nope. FAIL!
Your implementation only works for trees where all leaf nodes are at the same depth.
A binary tree is still balanced if one branch is depth n depth and the other branch is depth n+1.
So you have to compare like this:
(abs(depthLeft - depthRight) <= 1)) {
Most nations are smart and know that just having one part of a gov giving out a visa in another nation is not really that secure.
No actually they do not know that because that is what every government I have ever applied for a visa from has done. How is this any less secure than a passport?
So a second line of questions are in place to ensure the visa and person are correct when entering the USA.
This second line of questions needs to be ones that the border guard is qualified to ask and understand the answer to. Such as who you are, what your business is etc. Having an unqualified individual trying to ask technical questions they do not understand is just stupid. When I worked at Fermilab 10+ years ago a colleague of mine was stopped at the US border and when he said he was a physicist the guard got out a large book, flipped through it, and asked him what "potential energy" was but, despite answering correctly, because he did not reproduce the exact answer given in the book he almost got denied entry.
By all means protect your borders but please do it in a sensible, effective manner.