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."
We're Number #1! /s
Your hair look like poop, Bob! - Wanker.
Write something in Forth.
I am not interested in articles about life extension advancements.
I donâ(TM)t work for free. If they want me to solve problems, they can sign a consulting contract.
But hereâ(TM)s an idea, if they are going to force software engineers to do this sort of thing, maybe they can break up some vexing Homeland Security software problem and piecemeal it out, sort of like crowdsourcingâ¦
If you want news from today, you have to come back tomorrow.
I cannot wait for a day when only people able to answer (fairly basic) software engineering questions can fly. Security will be a snap. Of course, I assumed I can answer the questions for them -- otherwise I'll be going sans my family and most of my friends.
The most surprising part of that is that questions were pretty decent. Although an abstract class is not a universal concept, and I'm not sure if we should be limiting things by choice of language. After all, we're the land of the free...
Your ad here. Ask me how!
I had to go through a 3 hour interview .. i mean policy interrogation in Israel to leave the country. They'll ask the same questions over and over again to see if you answer correctly.
He really should have messed with them. Binary tree? That is where we obtain the components for the binary explosive.
Perhaps he was being given a surprise job interview?
The Daddy casts sleep on the Baby. The Baby resists!
you fail.. the answer is
if (story) { interesting = true }
[The Universe] has gone offline.
The most surprising in this story that Custom officers were able to come up with the quoted questions.
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.
I wonder what kind of tests do they give them.
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?
And then the officer who fired the tazer went to prison for 30 months. Nice of you to leave that out.
"Old man yells at systemd"
Forgot the ; You fail! GET OUT!
The correct answer to all of these questions is "why don't you look on stackoverflow?"
It's been too long since I've seen a binary tree to remember that sort of thing, and as someone with mostly experience in C, I don't know much at all about abstract classes...
Surely it would have been easier to check if he was an engineer by forcing him to try to talk to a girl?
I've had border guards not be sure if I was really me when I was driving a rental car across the border. Drug traffickers will sometimes use rental cars and my driver ID happened not to match the location where I had rented the car. I'm not offended by the fact that they double-checked it was me. With this guy, they verified his story with his employer and asked him a question or two. Sure, it wasn't perfect, but there are much bigger things to worry about. And we don't know the circumstances from CBP's POV. (Did he match a pattern of people claiming to be software engineers from nigeria who turned out to be here for criminal purposes, for example? I don't know, and neither does he.)
Clearly, however, he should have been treated respectfully and with an "I apologize for the delay but we needed to verify your identity. I hope you have a wonderful time." They need to maintain authority, but it's also important to keep the country welcoming.
Real lawyers write in C++
...is EXTREME VETTING!!
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.
Perhaps you are in denial?
And then the officer who fired the tazer went to prison for 30 months. Nice of you to leave that out.
He didn't go to jail for 30 months for the death or firing the taser.
He went to jail for 30 months for perjury and colluding with his fellow officers before testifying:
https://en.wikipedia.org/wiki/...
Nice of you to leave that out.
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. If they did this to me, I would be more pissed about having to sit around for over an hour beforehand. Of course, it wouldn't happen to me because, hey, I'm white.
You've been stuck in Customs? For 30+ minutes? I usually walk through the "Nothing to Declare" side. Which usually takes about 10 seconds.
Now Passport Control is another thing entirely. Passport Control and Customs are two very different things. I can totally see being quizzed for lengthy periods of time at Passport Control. (Even if it's never happened to me.)
I don't think the "20 minutes" bit is the offending part, it's the "solve these interview questions" that's offensive. Had the dialog been focused on explicit work details -- as you have been subject to -- then sure, this would be a non-story.
There is a huge difference between being grilled on what you *actually do on a day-to-day basis* and what *people with similar job titles have to answer in interviews*. See other posts from software engineers (presumably gainfully employed) who haven't had to deal with this sort of thing in a very long time (binary trees not common in their work, language doesn't support abstract classes, etc.).
Yeah except he was already in the country at that point.
As an Iranian who lives in Canada I have had my fair share of run-ins with the great computer scientists at the CBP. I remember I was coming to the US from Canada in 2008 to attend a conference in Florida and I was selected for a "random" search. I had the poster for the paper that I was presenting with me and the officer asked me to roll the poster open and explain it to her! She even asked a few semi-intelligent questions about it!
Celestine Omin is an Nigerian national. Nigeria a country currently fighting (with US support) its own homegrown terrorist insurgency in the form of Boko Haram. This is an understandable and completely normal security precaution.
But not an understandable and completely normal procedure. From the Linkedin article linked from TFA:
On 3/1, a U.S. Customs and Border Protection spokesperson responded to the 2/27 request for comment. He said the agency "does not administer written tests to verify a traveler’s purpose of travel,” but would not comment on Omin’s case specifically. He added that foreigners trying to enter the country "bear the burden of proof to establish that they are clearly eligible" and "must overcome all grounds of inadmissibility."
So, Omin was required to satisfy the border agent that he was who he said he was, but not with a written test.
He had a B1 visa, obtained prior to travel. The visa said he's a software engineer, but doesn't prove he's a software engineer. It would have been prudent of him to carry additional documents, such as a transcript of courses he has taken.
To avoid SNAFUs like this, it's best to talk to an immigration lawyer before you get on the plane. Border agents are supposed to follow the law and their agency's rules, but unpleasant things can still happen.
If it weren't for deadlines, nothing would be late.
No wonder we have so many bugs in software...
if (story == true) { story = interesting; }
French historian detained for 10 hours
http://www.cnn.com/2017/02/28/...
Australian Children's author detained
http://www.smh.com.au/entertai...
I am Slashdot. Are you Slashdot as well?
We've got some smart border agents.
You work in a very, very different IT department than I do then. I would have a hard time finding someone I work with that is pro-trump...
interesting = story;
FTFY
Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion. -- Spazmania (174582)
You aren't in the country until you get through customs.
24 hours doesn't seem too unlikely.
I've spent 4 hours on an airplane for a 1 hour flight. We got on, got held for an hour on the ramp waiting to depart, then upon arrival got stuck for 2 hours while a series of thunderstorms rolled though and nobody could go near any aircraft for safety reasons to do things like push backs, luggage transfer, blue water removal ect...
I've also know of trips by air that took 36 hours from original departure to arrival at final destination that involved multiple stops in various countries along the way.
"File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
No commercial airline flight is 24 hours. There used to be a 19 hour one for a Singapore to New York flight but that's no longer in service.
The Mashable report quoted in the Slashdot summary uses a slightly different phrasing from the original LinkedIn report. The LinkedIn article actually says "after having spent 24 hours cramped in an economy seat on Qatar Airways".
Poking around a bit on Kayak, I see a bunch of Qatar Airways itineraries from Lagos, Nigeria (LOS) to JFK that involve three segments, with stops in Doha, Qatar (DOH) and western Europe (CDG, FCO, MAN, etc.). Total travel time is 27 or 28 hours, with nominal times in flight adding up to about 23 hours. Add an hour in a holding pattern somewhere (or queued up for takeoff on a taxiway, or waiting for a gate to open up), and the poor guy could easily have spent 24 hours in an economy-class seat on his way to JFK. Yeah, the phrasing's a bit sneaky since he would have had a couple of short "intermissions" to stretch his legs...but still, if we figure he arrived at LOS two hours before his flight, he would have been stuck in the international air transport system for better (worse?) than thirty hours all told.
~Idarubicin
...
"Write a function to check if a Binary Search Tree is balanced," and "What is an abstract class, and why do you need it."
I got nothin'.
It little behooves the best of us to comment on the rest of us.
Does C have abstract classes? Does assembly? If not, does that mean all programmers in those languages are incompetent, by your logic?
They didn't say, "programmer." They said, "engineer."
It little behooves the best of us to comment on the rest of us.
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.
They don't need to know if he got the question correct to be a 95% accurate test. They just need to see how he behaves when given the problem. Very few people can and will bullshit confidently in such a circumstance.
Socialism: a lie told by totalitarians and believed by fools.
Um, no, technically he wasn't in the country yet, he had yet to clear immigration and customs. There are a LOT of people who transit though a US airport who are never technically IN the United States even if they are on US soil. They are afforded the privilege of "passing though" to change planes as they move on to another destination and we don't require visa's. Not everybody is granted this, but for the most part we don't care who you are if you are not staying.
Many countries allow this at major airports. Technically you don't legally enter the country (and don't have to meet their entry requirements) but you must stay within the designated area of the airport until you clear immigration. It's how Snowden got stuck at the Moscow airport in transit after the USA pulled his passport. He got stuck because he couldn't (and didn't want to) get on a plane w/o a passport, couldn't enter Russia unless they let him in.
"File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
This.
The 911 airplanes were hijacked by, among others, ______. (hint: pilots)
It little behooves the best of us to comment on the rest of us.
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.
That's something that should be checked before issuing a Visa, not after they're already on the fucking plane here.
How? Sure you can check all you want before they are granted a visa, but how do you know that #1 The person that answers all the questions is who they say they are. And 2. The person who just got off the aircraft and is standing at the immigration counter is the person who answered the questions in the first place?
"File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
The USA does not have any airside international transfers. If you layover in the states, you must clear US passport control.
Many tech folks I've met are Pro-Trump. Not all, and maybe not even a majority, but it's a sizeable chunk. However, amongst the "tech" people I know (you know who I'm talking about), it's almost 100% against him.
It's almost as if people (across any given field) who have no real skills or understanding of business are threatened by someone who would rather see equal chances given to everyone instead of being forced to provide everyone with equal outcomes.
Omin was instructed to answer the following questions: "Write a function to check if a Binary Search Tree is balanced," ...
[ I'll add, seriously, that I couldn't write that function on the fly after a 20+ hour flight. ]
It must have been something you assimilated. . . .
The US Constitution applies to me, as an American, whether I'm walking down Whitehall in London, sitting in Nelson Mandela Square in Johannesburg, or walking through Times Square, NYC. I'm protected from the CIA, FBI, NYPD, and etc., regardless of where I am.
(Doesn't have anything to do with other countries law enforcement. If the London Metropolitan Police want to illegally arrest me, the US Constitution has nothing to say about that. I have to deal with the British legal system.)
There are those who like to claim that I'm mistaken, and that there really is some magical no-man's land where my Constitutional Rights don't apply. I don't subscribe to that theory. And I'll be happy to test it in court should it ever come to that.
I think I remember the quadratic formula, does that count?
My wife and I are American citizens. Nonetheless, we get a set of basic questions from the immigration officer that are obviously designed to make sure that the person to whom the American passport (or, in this case, visa) was issued is, in fact, the person standing in front of them. I'd be pissed about the wait, but it's an entirely legitimate function. They aren't usually this detailed, but we're American citizens, not foreigners from a country that isn't part of the visa waiver program.
It's usually pretty perfunctory by air - I'm sure they can see we had round-trip tickets, and that I probably wouldn't leave my traveling companion abroad - but we did get a little more than usual when we came back in from Canada by ground. Even then, though, it was: where do you live? Where are you headed today? Where do you work? Bring anything back with you? Then another set of questions for my wife, again designed to establish that she spoke colloquial American English and had a coherent story. He took a glance at the contents of the trunk and waved us on.
Now, when you pull up to these, there are at least four or five cameras in the lane. I'm near-certain that the guy had a Google Street Maps picture of my house pulled up on the monitors in his booth. He was just checking to see that we had stories that made sense.
So you've never been on a plane that has landed, been refueled and sent further on its journey I take it. Spending more than 24 hours on a plane, yes I've done it
"find . -type f -iname 'fuck you'" and then hand in the test. "And if you'd you need more answers please see consult /dev/null. If not satisfactory, have fun in /var/log universe because I'm going back ~. Bash bitches!"...Throw in some Tux gang signs. "Teeeee Unit!" And just stare at the blank faces in satisfaction because you know the guys giving the test have no clue what any of it means and that's as good as it will get.
No they aren't.
There are many domains where you can work as a programmer without ever encountering a binary tree or an abstract class.
And who just memorizes all these random algorithms just to recite them at a moments notice?
If I have to implement a binary tree for whatever reason I will read up on it.
Maybe instead they should have a test to implement the rs-232 protocol or maybe small micro controller simulator.
Or whatever particular topic some person thinks is absolutely a must know for you to be considered an engineer.
That's true, but a passport with the visa could've been taken away from the rightful owner. Border guards remain the last line — and have always been empowered to revoke any earlier-granted permissions/visas.
I was once grilled about the shopping malls around my house (or where I allegedly) live — and I am a US citizen... Of course, buying most things online, I was not well familiar with the malls. I guess, my facial expressions and body-language convinced the guy, I was not lying...
In Soviet Washington the swamp drains you.
Not once since college have I ever had a need to write code to construct or balance a tree on my own.
Neither have I, but it is a trivial task.
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
Really? You just walk the tree, and return false if any leaf is deeper than the others.
nor is there much real world need for most developers to do so.
That is sort of the point. It is a simple, trivial task like "reversing a string" that nobody actually needs, but is still a good test of basic competence.
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
If not, does that mean all programmers in those languages are incompetent, by your logic?
A professional programmer should be aware of common concepts even if he doesn't use them daily. An "abstract class" is not an obscure concept. Would you hire an EE who doesn't understand amps and volts, just because he specializes on VHDL digital logic?
All security can be bypassed by a sufficient expert. That's just how security works. But almost all criminals are idiots, and are easily caught by simple methods.
Socialism: a lie told by totalitarians and believed by fools.
Border guards, and not just American ones, always ask questions to see if you can answer them and then grill you harder if you don't answer them convincingly. Even as a tourist, I've been asked what I plan to see or do in a country, or what was my favorite thing I did by such and if I didn't have an answer quickly coming, I'd get the third degree. Since then, I've always had some answers prepped or just whenever they give me a question I can go on about endlessly, I do because after the specifics of who you are, where you are going and for how long, they're just asking you a general personal question to see if you break under questioning. After 24 hours on a plane without any sleep, he was probably asked what he did and mumbled some answer. When they asked him a more detailed one he probably was fairly vague in his description. Eventually red flags get raised and he's past the threshold of getting through with even more questions. I bet if he'd earlier just started talking about something he knew alot about in a technical manner till they told him to shut up, that would have been the end of it and he could have gone on his way.
We've got some smart ass border agents.
you've missed a word. I took the liberty of fixing it for you.
ELOI, ELOI, LAMA SABACHTHANI!?
The US is one of those "exception" countries since 9/11. If your flight stops over in the US for any reason, you will be counted as entering the US. Thus you must have a visa or be from a country that the US doesn't require a visa from, not be on the US no-fly list, etc.
This applies to flights over US airspace as well. If the airline is carrying anyone on the US no-fly list AND overflying the US (not landing at a US airport), the plane will not be allowed to enter US airspace without handing that person over.
Most "reasonable" countries do allow transiting without entry. The US is not one of them - landing on US soil counts as entry, even if everyone stays on the plane.
In fact, Boeing's plans for flights include being able to fly from Canada to Mexico without crossing US airspace (i.e., they have enough fuel to go around).
Just sayin'
I've been programming professionally for almost 20 years and I couldn't write a function on the fly to balance a binary tree, even if I was wide awake and refreshed; never mind after having been on a plane for 24 hours. It's not something I've ever, ever had to deal with except maybe in when the professor mentioned it in passing during algorithms class in college.
So I guess I'm incompetent.
Must be nice to be smart like you though.
They didn't ask him to write an entire balancing algorithm, they asked him for an algorithm to tell if the tree was balanced - a much simpler task, left as an exercise to the reader.
That is all.
no... you passed by spotting the deliberate error ;)
[The Universe] has gone offline.
No, he just wrote it in Scala.
Awesome furniture, accessories and cabinetry in Santa Rosa, CA: http://humanity-home.com/
Good practice would be:
If (true == story) {story = interesting;}
Avoid that potential assignment up front when someone else mucks in your code!
Browsing at +1 - no ACs, I ignore their posts. So refreshing!
not equivalent code - it may have been already interesting before the truth of story was checked...
interesting = story || interesting;
would work tho
[The Universe] has gone offline.
In this case, the B1-holder's sponsor (Andela) should have hired the lawyer to advise Omin and other foreign candidates what documents to bring.
Even with valid documents, someone can still be refused entry to the USA. It is not supposed to happen, but it does. Prior consultation with a lawyer can reduce the chance of this happening, but not eliminate it.
If it weren't for deadlines, nothing would be late.
So congrats, you weeded out the amateur criminals, and have a false sense of security about the professional ones.
No, you just realize that the security level necessary to stop a professional isn't feasible on a broad scale. We can't all run around with a security detail from the Secret Service. Not every building can be as hard to break into as the Pentagon. Advanced threats probably pass a border check with flying colors. But hopefully they're also going after advanced targets that have their own security measures.
Live today, because you never know what tomorrow brings
Surely it would have been easier to check if he was an engineer by forcing him to try to talk to a girl?
Thnks to the extreme sexual segregation of islamic cultures, most Jihadis would score as "engineer" on that test.
Bantam Dominique roosters crow a four-note song. Once you've heard it as "Happy BIRTHday" you can't NOT hear it that way
He went to jail for 30 months for perjury and colluding with his fellow officers before testifying:
And Al Capone went to prison for 8 years for tax evasion, not for the death of seven people in the St. Valentine's Day Massacre. I think most people accept that as a win for the public.
Just for fun, it's basically a header file, with the implementation left to the user. You can't run the code as recieved, because there is no implementation.
That's actually basically the definition of an abstract function (method). The presence of an abstract function makes the entire group of functions amd the struct which points to them non-instanceable. You can't create an instance of a struct which contains a pointer to a function you've not yet implemented.
Writing objects in C is fun (once).
Why not? If he's good at VHDL, he'll be fine.
Why wouldn't I want to hire a micro-controller programmer who didn't know what an abstract class was?
Would you hire a C++ programmer who didn't know what an SPI port was?
Play Command HQ online
Good thing he was not a Mechanical Engineer because they "build weapons".
Passionately Indifferent
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?
And then the officer who fired the tazer went to prison for 30 months. Nice of you to leave that out.
He didn't go to jail for 30 months for the death or firing the taser.
He went to jail for 30 months for perjury and colluding with his fellow officers before testifying:
https://en.wikipedia.org/wiki/...
Nice of you to leave that out.
Not only that, there were four perps and only one even faced criminal charges. This is, sadly, normal in the US and Canada.
Do you have ESP?
All classes are abstract. They're classes, not objects. (And someone will come along and say all objects are abstract. And they'd be correct.)
...I find this line of enquiry perfectly acceptable. I need to verify you are actually a hooker."
Care killed the cat, but satisfaction brought it back.
Better not change jobs. It's a pretty standard interview question these days. The answer is to use recursion.
SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
It's "sheer", not "shear." Back on the aircraft with you. We don' t like your kind.
I've fallen off your lawn, and I can't get up.
The 911 airplanes were hijacked by, among others, ______. (hint: pilots)
IIRC, a few of the 911 hijackers had taken flight instruction for a PPSEL (private pilot single-engine land) rating but not obtained their license. Technically that makes them student pilots. They weren't ATP (airline transport pilots) as your statement would imply.
Notice that this "pilot" status resulted in changes to security involving even $100 hot dog flyers.
left as an exercise to the reader.
Here's my solution. Can I visit America?
#include <stdio.h>
#define NOT_BALANCED (-1)
struct BinaryTree {
struct BinaryTree *left;
struct BinaryTree *right;
int value;
};
int
binaryTreeDepth(struct BinaryTree *t)
{
if (t == NULL) {
return 0;
}
int depthLeft = binaryTreeDepth(t->left);
int depthRight = binaryTreeDepth(t->right);
if ((depthLeft == NOT_BALANCED) || (depthRight == NOT_BALANCED) ||
(depthLeft != depthRight)) {
return NOT_BALANCED;
}
return 1 + depthLeft;
}
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.
That depends on your actual goals, doesn't it? If you all you really want or expect to successfully do to keep out the amateur and idiot criminals because you've got enough of them already, thanks, it works just fine. There are reasons to settle for this, too, such as the possibility that the costs will soar with little to show for it, and the unfortunate fact that a professional criminal may well do better at following local laws than your average tourist...
You've been stuck in Customs? For 30+ minutes? I usually walk through the "Nothing to Declare" side. Which usually takes about 10 seconds.
Now Passport Control is another thing entirely. Passport Control and Customs are two very different things. I can totally see being quizzed for lengthy periods of time at Passport Control. (Even if it's never happened to me.)
I've waited at customs AND immigration (passport control) for hours individually at times. Usually in Miami when all of the South America international flights arrive with in a couple of hours in the middle of the night. It's happened to me multiple times and is why I avoid Miami like the plague.. Well that and because as a fellow traveler once said as we where being herded into various queues for processing.. "I've been in South America for two weeks where nobody speaks anything but Spanish, then when I finally get back to the USA I find myself being yelled at in Spanish!" I told her she wasn't really in the USA yet, just southern FL where Spanish comes before English.
"File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
Most "reasonable" countries do allow transiting without entry. The US is not one of them - landing on US soil counts as entry, even if everyone stays on the plane.
That's not necessarily because of being reasonable. It is because the physical layout of U.S. airports and the absence of exit control.
All countries I have been to (with the exception of the U.S.), have exit control as well, meaning that they check your passport prior to exiting the country. In the U.S., when you enter an international departure terminal, you can walk out just like that, most of the time. So if you would arrive on an international flight and would have another one scheduled out of the same terminal, you would still be able to walk out without any immigration control.
I'm not a complete idiot... Some parts are missing.
No they were problems the Immigration Service were having with some software they are developing. They figure with so many skilled immigrants needing access to the country they have boundless tech support opportunities. I would expect the next traveler to be asked to reset a domain password.
Nullius in verba
Given what was done on 9/11, odds are the question ended up being which is preferable--risking having to shoot down a flight that wasn't supposed to do anything other than transit US airspace (because it got hijacked, ect, ect, you should know the story) or just having your standard be that if they can't even get to stay for a bit as a tourist, they can't fly over?
It'd work a lot better if the security was not effective as theater, instead of as actual security, however.
Tell that to any potnetial bombs he sets off.
He may not legally be in the country but he physically is, if he's an underwear bomber he's at a very busy point in a highly populated area, great place to do his damage. Legal technicalities won't protect people from the pressure or heat wave from his blast assuming hes a terrorist.
Why not? If he's good at VHDL, he'll be fine.
Except his FPGA fails when the clock speed is boosted because he doesn't understand what a bypass cap is for. Fundamentals are important, even if you rarely need to apply them.
but a non-programmer (such as a shoe or underwear bomber)
A real programmer would have noticed that these are NOT mutually exclusive. Why can't a programmer be a shoe bomber?
You're not a real programmer just because you know a few algorithms*. But that's how bugs happen. Forgetting to test for a 2nd condition after falsely asuming it would be implied by the first validity test and so on....
* I probably couldn't do a search tree balancing on a whiteboard, but better programmers couldn't, too
bickerdyke
BTW, it's unclear what was actually asked.
Omin's tweet states he was asked to balance a binary tree. But the story states that he was asked to write a function to check to see if a binary tree is balanced. The latter is part of the solution to the former.
Many smart people are breaking laws for idealogical reasons. The most successfull terrorists for some reason happen to be mostly Engineers (Maybe their education convinces them the normal folks are so dumb that killing normal folks is no different than butchering a pig). Many terrorists could easily pass coding and engineering questions.
**Life is too short to be serious**
They didn't ask him to write an entire balancing algorithm, they asked him for an algorithm to tell if the tree was balanced - a much simpler task, left as an exercise to the reader.
Pretty simple, actually. Here's my solution, coded about as fast as I could type it. Basic idea: walk the tree and find min and max depths. If they differ by more than 1, it's unbalanced.
Note that I have neither tested that code, nor proved it correct. It probably works, though, and I'm sure it would satisfy an immigration agent. I didn't just get off a long plane flight, but I have been working for 12 hours (trying to get stuff done to unblock some other people before I leave on vacation tomorrow).
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
The questions asked weren't relevant. At. All.
Appropriate questions would quiz him about his work and education. With followup if the border agent had the competency to further quiz, which they almost certainly would not. But they could at least try to sense whether he was BSing or not. And presumably, that's a skill that border agents possess, or should (detection of BS.)
The goal should be to determine if he actually does what he says he does for a living. Not to spring a pop-quiz on subjects that may or may not be of any importance in his job.
Honestly, the first question should be enough. Either the guy will prattle on with detail after detail without hesitation, or will be very vague.
The question was not about abstract class. It was "What is an absolute ass, and where do you find it?". The answer is the US immigration officer, and you find the best ones in NY JFK airport.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
> 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.
He didn't have to balance the tree, he just had to check if the tree is balanced.
Pretty easy to do with DFS (which the DHS agent obviously knew):
int depth_check(Node *n) {
if (!n) return 0;
int left = depth_check(n->left);
int right = depth_check(n->right);
if (left != right) throw exception;
return left;
}
You could probably simplify it a bit more and use unsigned ints for correctness, but this was off the top of my head.
The calling function would check for an exception being thrown, and return false, otherwise return true.
I could come with some answer after thinking for a while, but very probably will have some mistakes (after 24 hours flying). So, the best option could be to invent some language and to code that using your own rules based on theoretical libraries (who could argue that this is not a right answer?).
But the real problem here is that the US is imposing so many incoherent restrictions that soon or later it will stop being the main planet plane hub, hurting the own US economy and forcing to find a more open place welcoming people from other countries to share ideas and to contribute to the improvement of modern society.
If the US government is not welcoming visitors, then won't have them. Is this the right way to improve internal economy?
Not considering Programmers Are Confessing Their Coding Sins To Protest a Broken Job Interview Process https://developers.slashdot.or...
That's not what his tweet said. His tweet said he was asked to balance a tree.
The story states that he was asked to write a function to balance a binary tree.
It looks to me that the reporter misinterpreted Omin's tweet. The writer was probably winging it a bit, as tech reporters are seldom practitioners in the filed that they report on. Maybe there should be an entry test for tech reporters. A technical reading-comprehension test. If they get it right, they are not a professional tech reporter.
It's interesting that so many who have posted here missed this. Or they just automatically believed the "fake news", and ignored the source material (tweet) - which was present verbatim in the article - altogether.
Now, back to reading "The Society of the Spectacle." Seems relevant. More so every single day.
Yes except for perjury not for killing the poor guy. Either way this is how it was.
by TheSpoom (715771) Uncaring Linux user here. I have nothing to add to this but please continue. *munches popcorn*
Recursion is always the answer:
Or someone has found a really creative way to get someone else to answer their homework questions
It's pretty simple, but I sure didn't immediately think of the answer, and I'm in a low stress condition.
As for abstract class, I've never needed one. I could easily spout some gibberish about unified descent through to allow common access to methods by instances of derivative classes, but it would be nonsense, as I never do things that way. My real reason for using an abstract class would be something like "I'm stuck using a language that doesn't allow multiple inheritance and also doesn't have interfaces".
I think we've pushed this "anyone can grow up to be president" thing too far.
So, write it in Brainfuck.
Have gnu, will travel.
And who just memorizes all these random algorithms just to recite them at a moments notice?
You don't have to "memorize" any algorithms. You just need to be able use your brain, and understand some basic concepts, like "use recursive functions to deal with recursive data structures". That is something any freshman CS student should know. If they don't know it, President Trump should deport them.
Google doesn't do any more, and for good reasons.
FWIW, Google interviewers wouldn't (or at least shouldn't) ask "Write a function to determine if a binary tree is balanced" because it's too easy, and it's memorizable. Google interviewers ask questions which (ideally) you have never seen or thought about before and which require you to create a solution on the spot. The goal isn't to test your memory, it's to test your ability to think. Google questions also tend to be deliberately underspecified, to see how you go about gathering the necessary information, and to have various possible approaches, to give you a chance to discuss the tradeoffs involved.
However, the questions do tend to involve basic data structures and algorithms. Questions that involve traversing a binary tree wouldn't be unusual, though there'd need to be a lot more to it than just tracking depths.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
return left;
I think this should be
return left + 1;
Otherwise, your code looks good.
Welcome to America!
For all I know they called the conference organizers to verify my story. The questions to me ranged from what would be my topic (IPv6) and whether I would be paid (I wouldn't; it was an academic conference at a local university), to was I marketing my services to Canadian businesses (no). And many other questions in between that today I would have had the presence of mind to record, but not then. This was five or six years ago, long before the current immigration security flush.
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)) {
Nope. FAIL. Not correct.
Your solution only works if all leaf nodes have the same depth -- which is exceedingly unlikely.
You want:
if (abs(left - right) > 1) throw exception;
Just write a whole bunch of hexadecimal numbers and claim it is machine code for a new processor you're helping to develop.
Eventually more US companies will just move their coding expertise overseas and avoid all this trouble. Besides, it'll cost a lot less - no airplane tickets, no lawyers to bail visitors out of homeland security/TSA/customs custody and other expenses. Will this result in more employment of US citizens who are out of work and might be looking? No disrespect of coal miners, bu how qualified are coal miners at understanding binary search trees and abstract classes? It looks like some programmers posting here don't know or don't remember these subjects.
In a time of universal deceit, telling the truth is a revolutionary act. George Orwell
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
Really? You just walk the tree, and return false if any leaf is deeper than the others.
"Deeper"? There are multiple definitions of balanced. The usual meaning of balanced is if the difference in the number of nodes is no more than 1. Depth difference is usually AVL balanced (named after G.M. Adelson-Velsky and E.M. Landis). So, there are an arbitrary set of "balancing" rules. He could have, in theory just returned true. Or false....
Agent> So where would you find an abstract class?
Geek> What language?
Agent> Are you trying to sass me son? English! try again....
Geek> umm.... Wherever you defined it?
Agent> Thats not what I have here.
Geek> In RAM?
Agent> Final chance
Geek> Ummm...your question is meaningless....
Agent> The correct answer is: page 267 of "The C++ Programming Language" by Bjarne Stroustrup . Off to Gitmo with you!
Geek> aargh!
Perhaps I just don't automatically believe every story I hear. Especially the "interesting" ones.
I totally agree. I've been a software engineer for over 20 years and most of my experience is with C and assembly dealing with hardware issues, device drivers and bootloaders. I'm quite rusty on the details of object oriented programming and couldn't tell you the difference between an abstract class vs a regular class. I don't usually deal at the level of binary trees, though telling if a tree is balanced or not is a fairly simple recursive problem. Now if you ask me about things like i2c, SPI, flash, CPU caches and some low-level networking things I'd do quite well.
I haven't dealt with binary trees in ages and my C++ experience was many years ago.
This post is encrypted twice with ROT-13. Documenting or attempting to crack this encryption is illegal.
"Technically," they flew the goddam planes.
People who fly goddam planes are, "technically," called ____. (hint: goddam pilots)
It little behooves the best of us to comment on the rest of us.
You (and many others) are assuming that border agents require that gives you full marks in university examination. More probably they are observing your general attitude and approach to the question.
Not once since college have I ever had a need to write code to construct or balance a tree on my own.
Neither have I, but it is a trivial task.
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
Really? You just walk the tree, and return false if any leaf is deeper than the others.
Like alot of things, it's a trivial task *if you know the answer*. If you don't happen to have the answer in your head (and many application-level programmers don't deal with trees directly, so this sort of knowledge isn't immediately available) then it's damn near imposssible, especially in the stressed situation that we're talking about.
I'm sure you can imagine some questions you can't answer that would be considered obvious by other programmers in other fields.
FUCK YOU -- do you know the 1st thing about Boko Haram? Can you actually sit there and state that you have any evidence that shows that Boko Haram has any capability of employing any sort of tactics above brute force warlord style tactics on their immediate locality? Is there any evidence of Boko Haram having any sort of International Network or capability to strike the US? I would liken Boko Haram to be on par with street gangs here in the US Would you cry foul if other nations started detaining random Americans because the US was home to such "terrorist" organizations as the Crips and Bloods, Skinheads and Mexican Mafia? Because each those organizations are more sophisticated, organized and better armed than Boko Haram
The comment says it all. Please tell me I missed a month.
Your analogy is faulty. Amps and volts are fundamental forces that apply to everything involved in electronics and cannot be separated from them. Abstract classes are a language-specific feature that does not apply if the languages in use don't offer them in the first place. What is your definition of a "professional programmer?" It sounds like you mean "someone who writes code in certain popular object-oriented languages that support a certain feature."
I remember reading statistical analysis about profitability of being bank robber (how much you can steal before being caught, how long will you spend in prison etc). The results gave a pretty bad outcome compared to just working even for low salary. Still if you consider you dont have to spend anything during your stay at prison it wasnt that bad. Also being actually a smart guy might move this profitability much higher as statistics obviously included everyone that tried it.
"Technically," they flew the goddam planes.
Oh, I don't know about that. They manipulated the controls of an aircraft that was already in the air, some of the least complicated things a real pilot does. I've allowed many of my passengers to do the same thing, and none of them has had the nerve to claim they were a pilot based on that limited experience. CFIs do the same thing, and they would be insane to pull onto the taxiway after the first landing with a new student so they could hop out and let the new "pilot" make the next take-off by himself.
Why the hostility?
People who fly goddam planes are, "technically," called ____. (hint: goddam pilots)
You claimed they were hijacked by (hint) "pilots". They weren't flying the planes before they hijacked them, so they weren't pilots yet. And if your only criterion for calling someone a pilot is that they've manipulated the controls of an aircraft at some point in their life, your definition is amazingly useless in any serious conversation.
In the context of "occupations that merit increased interest in immigration interviews" that the AC you "this"d brought up, the fact that some of them touched the yoke in the airplane they hijacked is irrelevant. They weren't pilots in any useful definition of the word, as demonstrated by the ones who wound up in PA instead of NY or DC, and their new occupation as "pilots" has no bearing on any immigration processing they went through before they touched any aircraft controls.
Shit, I'd get sent back.
Table-ized A.I.
They give specific test questions to see if he's a techie, but in the end use a very subjective "don't look convincing".
Why fucking bother with the test if you are just going to guess out of your ass? Unless, maybe it was a stress test to see if he breaks. Cops sometimes use lie-detectors not to see actual lies, but as a shot in the dark to see if the stress alone induces confessions.
By the way, how about a more practical test question, like "Fix the Unicode problem on Slashdot."â(TM) If he solves it, give him citizenship.
Table-ized A.I.
Nope, it should be:
if (story.IsInteresting == true)
If you post as an AC, don't expect me to spend a mod point on you.
Or better yet:
if ((bool)story == true)
{
story.Flags.Add("interesting");
}
If you post as an AC, don't expect me to spend a mod point on you.
Remembering that the cold war was won by bankrupting the CCCP it makes me wonder if, assuming the rumours are true about Trump's strings being pulled by Putin, that their game plan is to destroy the American economy or weaken it.
Everything I've read about what Trumps has done, said or plans to do comes with a nasty long term economic cost.
Any other country would give their new borns to attract the worlds best minds to a "Bay Area", hot pot of technology star ups and world leaders.
Sure there's going to be plenty of abused H1B's but there's also going to be a heap of well deserved work visas which -smart- people won't be so keen on accepting in this current administration.
Cutting foreign aid, building walls, things that please those deluded enough to vote him in which will have a long term economic impact on the US and well as weakening it's world influence and power.
America's strength, which has given it world domination, has been it's economy and that's largely been driven by it's technology.
Pick a handful of American technological achievements and you'll find a large portion of them were created by immigrants not home born "presidential material".
Wake up America, your fucking yourself. Badly.
>after spending 24 miserable hours on a Qatar Airways flight,
I.. I don't think that's Trump's fault that your flight sucks ass.
And hilariously, if the flight was "that bad" then it was far worse and longer than the injustice he faced at the airport.
It's kind of a big deal because it's a new step into someone else's war - Saudi Arabia, that country where we had to put a lot of pressure on them before they finally made it illegal to send money and guns to ISIL/Daash. It needs a bit of picking over to see if we are being screwed over by a faction that wants us all dead or not. Not Trumps fault in any way, but a big deal just the same.
We've got some smart border agents.
No. You've got borderline smart agents. There's a difference.
I'm a minority race. Save your vitriol for white people.
We've got some smart ass border agents.
you've missed a word. I took the liberty of fixing it for you.
Is the ass border the one in the south?
I'm a minority race. Save your vitriol for white people.
And OP said nothing about the officers going to jail.
Play Command HQ online
Not really, the correct answer would be "I'm sorry, union rules means I can't freelance and offer work without an agreement in place to the pre-agreed rates. This 'early designing/random questions' is specifically prohibited. If you want me to do some work in the side by helping you with your problem here, you'll have to take it up with the office who probably force you to wait until the plumbings been put in".
Waiting for an amusing sig.
...to call BullShit on this story. Assuming someone hasn't already done so)
Sorry, it's simply not believable that he would have been given such a test, with such explicit, and actually fairly demanding questions.
Try again.
The US Government should be as picky when they hire political cronies that provide goods and services.
You know what's interesting. I'm not a programmer but have an amateur's interest in it and have dabbled for years. I couldn't write code to show this out of my head (except in pseudocode) but I knew what a balanced tree would look like from an xkcd comic.
Or start every sentence with "so", or "clearly". Or be as pedantic about these details as I'm being...
"Win treats sysadmins better than users. Mac treats users better than sysadmins. Linux treats everyone like sysadmins."
There is an updated Dragon Book. Looks like it was published in 06 and still has a dragon on the cover.
Time to offend someone
The standard example, the "hello world" of abstract classes I've always seen is Animal. Animal has a MakeNoise method. Subclass Pig says "oink", subclass Cow says "moo" - the same data type. You can't create a generic Animal, you have to subclass to some specific type of Animal.
So what's the difference between an abstract class and an interface? Animal can implement poop(). An abstract class has *some* abstract methods, an interface has *only* abstract methods.
> I think you'll find that you can in fact to that in C; ...
> As for why you might want to specify a (pointer to) an unimplemented functio in C - this would be one way to implement eg. a module that uses a callback function.
Exactly. A callback function is called an "event" in object oriented programming. It should be declared, but not implemented, by the class (module) that calls it. A method is a function that has to be be implemented by the class that calls it. Therefore on OOP we have to distinguish these two types of functions by calling one a "method" and the other an "event".
Say "HDMI" one more motherfscking time! Say it!
For some reason that whole image popped into my head...
Replace the word "calls" with "defines":
A method is a function that has to be be implemented by the class that declares it. An event should not be implemented by the class that declares it, since it's a callback.
"What is an abstract class, and why do you need it."
There are several ways to answer this question, many of them not necessarily compatible with one another, with enough differences to throw people into heated debates. I fail to see the intelligence of asking this question upon entry... unless they were monitoring Omin's behavioral response (to see if he would trip.)
It's almost like America needs a system for approving travel based on a set of responses to questions. We could even administer this system electronically and work with airline around the world to ensure its completed prior to travel. We could even give it a fancy name like ESTA.
Sorry for your loss.
It little behooves the best of us to comment on the rest of us.
My first civilian job interview for a real job using my electronics education, I was given a schematic of an op amp application, and asked to calculate the gain. I launched into a discussion of internal gain, input frquencies, what part number, and with that I could proceed. When the interviewer challenged me about that, since 741s were pretty simple, I spouted off a dozen part numbers I knew from the military equipment I was trained on, and that I assumed we were not talking about VHF/UHF applications, but probably audio, which two of the exotics I knew of were commonly used in signal processing. He gave in, I knew enough to know which leads to probe for what I wanted to know.
Mind you, this was for fixing calculators (no op amps there) and tape recorders (not yet using ICs), but he wanted to protect his employer from obvious rubes. I managed somehow to hold down that bench for 7 years before they folded the service department when calculators were no longer worth 15 minutes of work.
But two random questions at the border isn't doing much.
On another phone interview years and years later, after working in the desert sun for 6 hours, I was asked Novell questions for a GroupWise admin slot. I blanked on remembering NWAdmin was the primary tool for managing NetWare domains. Darn, that was a great opportunity. two weeks later I was hired for a temp job at Intel racking new servers, and no one including the full timers knew how to access and manage the EFI preboot. Got me two weeks of interesting work before we got those done and moved on to an unending stream of Proliant slices and obsolete images to be fixed without any real support. No one asked me about EFI during the interview process. No one really knew what the job would be, just that I could describe DHCP and iLO operation...
Random questions are tough. I feel for Celestine.
deleting the extra space after periods so i can stay relevant, yeah.
I am a Mexican, and I don't consider myself prone to confuse data types.
Also, mindwhip's version makes sense in many, many C-derived languages where every statement is evaluated to a truth value. Of course, setting interesting=true makes this code less useful for multi-story usage. I would use story.mark_as_interesting() or story.interesting=true... But that's just sugar :-]
Pro tip: when you decide to argue, read a source before citing it. The first sentence on the page you linked to says:
"an abstract type is a type in a nominative type system that cannot be instantiated directly"
Which happens to be more or less exactly what I said:
"That's actually basically the definition of an abstract function (method). The presence of an abstract function makes the entire group of functions and the struct which points to them non-instanceable."
Let's continue to the second sentence as well. Wiki says:
"Every instance of an abstract type is an instance of some concrete subtype."
I said the same, giving an example:
"The standard example, the 'hello world' of abstract classes I've always seen is Animal. You can't create a generic Animal, you have to subclass to some specific type of Animal."
Third sentence, Wiki says:
"An abstract type may provide no implementation, or an incomplete implementation."
Raymorris said:
An abstract class has *some* abstract methods. An abstract method doesn't provide an implementation. (In other words, the implementation of the class is missing or incomplete.)
Would you care to continue to the fourth sentence?
Trump is just making good on his promise -- EXTREME vetting.
If you're hiring him for VHDL and not circuit board design, he doesn't fail. The board designer did.
It's pretty simple, but I sure didn't immediately think of the answer, and I'm in a low stress condition.
Really? This seems very obvious to me, if you just think about what "balanced" means when applied to a binary tree. I immediately thought of two solutions: the min/max depth comparison that I implemented, and another one that involves counting the nodes in the tree and finding the max depth. If ceil(log_2(count)) My real reason for using an abstract class would be something like "I'm stuck using a language that doesn't allow multiple inheritance and also doesn't have interfaces".
I think that would constitute a solid answer to the question.
Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
It's just sad no one vetted Trump.
I'd ask you what "Bad boys rape our young girls but violet goes willingly." I've never forgot it since. Now if I could just find Violet.
I believe 62 million Americans vetted him through a process called voting.
I wrote "IT Consultant" on the immigration form when entering Costa Rica. To my surprise, the officer started asking what kind of failure a distinct clcking noise coming from the hard drive is. I was impressed that they seemed to have upped the ante on immigration checks!
Turns out that his kid's computer was doing the clicking, and he was desperate for some information on what to do. Nice guy!
Pura Vida.
Almost 65 came to the opposite conclusion. But you go ahead and hang with the people who pee down their legs 24 hours a day.
The real question to me is how a customs guy knew enough to make any sense of the answers.
And if he did, what is he doing working for customs?
End MGM. Get prospective parents of boys to Google: Men do complain
And I'd respond: Really? I learned it as "Black bastards rape our young girls but virgins go without."
Another one of my favourites is, "A Pussy So Tight No Dick Penetrates" (OSI network stack - Application, Presentation, Session, Transport, Network, Datalink, Physical).
The correct answer was the one that matched the answer he had on his piece of paper.
Wow... Well I'd let you through. Might want to use the one I use if you teach it today.
This. I've been writing code for 20+ years, in several languages. Could I write the b-tree piece they asked for after 20+ hours of likely no sleep, from the top of my head? Probably not. If I had to solve the b-tree problem as part of something I work on, I'd not even think to roll my own, I'd look at existing implementations and most likely find a library, where someone much closer to the problem as already solved it properly. Also, this exercise assumes they have someone on hand that would be able to evaluate the solution without bias.