Slashdot Mirror


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."

75 of 553 comments (clear)

  1. USA! USA! USA! by OverlordQ · · Score: 5, Funny

    We're Number #1! /s

    --
    Your hair look like poop, Bob! - Wanker.
    1. Re:USA! USA! USA! by Anonymous Coward · · Score: 5, Funny

      This is completely justified.

      We shouldn't let anyone into the country who can't write a procedure to tell if a Binary Search Tree is balanced, or doesn't know what an abstract class is.

    2. Re: USA! USA! USA! by LiENUS · · Score: 4, Insightful

      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.

    3. Re: USA! USA! USA! by Anonymous Coward · · Score: 5, Funny

      I know I know! An abstract class is one where they talk about binary search trees!

    4. Re: USA! USA! USA! by bobbied · · Score: 2

      No that there is funny!

      --
      "File to fit, pound to insert, paint to match" - Aircraft Maintenance 101
    5. Re:USA! USA! USA! by Anonymous Coward · · Score: 3, Informative

      I don't know what an abstract class is or why it's useful. I write in C, not whatever language is hot shit in Current Year(tm). I can, however, balance a binary search tree, so I guess I'm half eligible to not get deported.

    6. Re: USA! USA! USA! by lgw · · Score: 2

      Like it or not that's what a sane immigration policy looks like.

      While I agree with that, this wasn't immigration, this was a short-term work visa. I guess it's the equivalent of the Canadian border guys saying "what exactly will you be doing and why can't a Canadian do that?", except we probably didn't apologize afterwards.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    7. Re:USA! USA! USA! by AmiMoJo · · Score: 4, Insightful

      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
    8. Re:USA! USA! USA! by w1z7ard · · Score: 2

      ...or doesn't know what an abstract class is.

      What about functional programmers?

      --

      "Recursive bipartite matching"- try it!

    9. Re: USA! USA! USA! by PCM2 · · Score: 4, Informative

      Lol no sane immigration policy has border patrol agents administering visas at the border.

      Traveling on a U.S. passport, I've been to several countries where yes, they do indeed issue you a visa at the border.

      --
      Breakfast served all day!
    10. Re: USA! USA! USA! by LynnwoodRooster · · Score: 2

      And others do not... China, for example. Most EU countries if staying more than 90 days. Much of the Middle East. And some countries, like Thailand, have different rules; if you're entering as a US citizen for tourism, no visa for up to 30 days. For business? You need a visa. Peru was the same way. When I went to visit as a tourist, no problem. When I went to do business, I had to have a visa.

      --
      Browsing at +1 - no ACs, I ignore their posts. So refreshing!
    11. Re: USA! USA! USA! by Cinnamon+Beige · · Score: 2

      And others do not... China, for example. Most EU countries if staying more than 90 days. Much of the Middle East. And some countries, like Thailand, have different rules; if you're entering as a US citizen for tourism, no visa for up to 30 days. For business? You need a visa. Peru was the same way. When I went to visit as a tourist, no problem. When I went to do business, I had to have a visa.

      Actually, you're rather wrong--what you don't need to do is apply for a tourist visa in some countries. What they put in your passport when you're entering is a visa, and it's automatically issued to people from certain countries. The deal is typically reciprocal, though you're not necessarily certain of getting one--usually, from what I've heard, it's when you've gone and come back to try to 'renew' your tourist visa. (If there's a formal/proper process, it's so well-hidden as to be practically not existant.)

    12. Re:USA! USA! USA! by ghoul · · Score: 2

      This is completely justified.

      We shouldn't let anyone into the country who can't write a procedure to tell if a Binary Search Tree is balanced, or doesn't know what an abstract class is.

      I agree. In fact we should go a step further. We should start revoking US citizenship and deporting folks who cannot write the same. A much smarter nation will result.

      --
      **Life is too short to be serious**
    13. Re:USA! USA! USA! by amxcoder · · Score: 3, Interesting

      Agree, I've been a professional programmer for over almost 20 yrs, but I specialize in embedded platforms and automation control. I can't tell you how to balance a binary search tree because in my field, that concept is not even used, or able to be implemented with the limited and custom "subset of C language" compilers I have to work with. I DO however know what an abstract class is though, just from studying OOP programming in general, so I guess I would only get half credit on that exam?

    14. Re: USA! USA! USA! by Roger+W+Moore · · Score: 4, Insightful

      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.

    15. Re: USA! USA! USA! by amxcoder · · Score: 2

      The automation I do is not PLC based. I do AV automation aka Crestron/AMX. Those platforms started out with custom languages that are based on C, but are slowly moving to C#, Java, and one manufacturer is using Python now... so I would say yes, it's real programming, but just within a smaller sandbox.

  2. In What Language? by lazarus · · Score: 3, Insightful

    Write something in Forth.

    --
    I am not interested in articles about life extension advancements.
    1. Re:In What Language? by GerardAtJob · · Score: 2, Informative

      Brainfuck should be better for this case.

      --
      I can't call that English ;-)
    2. Re:In What Language? by sconeu · · Score: 2

      Even bettter, APL. It's not humanly readable.

      --
      General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
    3. Re:In What Language? by OrangeTide · · Score: 5, Insightful

      "What is an abstract class, and why do you need it"

      Not a very FORTH friendly question. I'm an old C programmer and while I could make an educated guess, I don't think I would be able to confidently answer the question after a long flight.

      Checking if a binary search tree is balanced is something a student has to do, you usually have to write these sorts of things once or twice in your entire career.

      On the other hand I could sit down and discuss HDMI specification all day and night with border agents. They'd likely pass out from boredom.

      --
      “Common sense is not so common.” — Voltaire
    4. Re:In What Language? by Lab+Rat+Jason · · Score: 2

      I'm pretty sure "pink" would have been an acceptable answer... how the hell is someone in border protection going to know if the answer was right or not?

      --
      Which has more power: the hammer, or the anvil?
    5. Re:In What Language? by MightyMartian · · Score: 5, Funny

      Nonsense. They have tasers. They could keep themselves amused all night.

      You, on the other hand, might enjoy it less.

      --
      The world's burning. Moped Jesus spotted on I50. Details at 11.
    6. Re:In What Language? by CaptainDork · · Score: 2

      An abstract class is offered at an art school.

      I gotta think of everything.

      --
      It little behooves the best of us to comment on the rest of us.
    7. Re:In What Language? by OrangeTide · · Score: 2, Interesting

      I wonder what the eye diagram for a taser's waveform would look like.

      --
      “Common sense is not so common.” — Voltaire
    8. Re:In What Language? by OrangeTide · · Score: 2

      CEC doesn't matter.
      X11 reads the EDID and parses it itself, you can override the modes all you want.
      The output selection is controlled by the driver. Some drivers tend to be monolithic and kind of a pain to alter the policy, like the VideoCore (Broadcom/Raspberry Pi) or NVIDIA proprietary drivers. Others should be pretty straight forward like the Intel drivers, as there are tables in the laptop firmware that describe the routing and the open source driver knows how to find them.

      I power off HDMI TVs and power them back on without a problem. But this doesn't not necessarily generate a hotplug, as the spec does not require it to. Some TVs do, and some don't. (and simply pretend to be plugged in even though they are off, or possibly even unplugged). But usually TVs that have HDCP will unplug if they go into their lowest sleep state.

      Poking the display driver from outside of X might get it back, echo 4 > blank ; echo 0 > blank but probably not, you'd have to see if any mode is currently set to tell if it might work. If no mode then you have bigger problems and need the hotplug and EDID reading to work again.

      You can probably restart X without restarting Linux and have it poll for the EDID again. You may be able to do event injection to get X to think a hotplug has occurred, causing it to read EDID and re-intialize.

      --
      “Common sense is not so common.” — Voltaire
    9. Re:In What Language? by painandgreed · · Score: 2

      On the other hand I could sit down and discuss HDMI specification all day and night with border agents. They'd likely pass out from boredom.

      I've found that this typically works as they are usually just asking you questions to see if you sweat or have trouble answering them. Even for tourists, they'll ask what you are really looking forward to seeing or what you really liked about your trip. I've found that if you already have something in mind and can just wax endlessly about it till they tell you 'that's enough', that that will also be the end of the interview and they'll let you go. I wouldn't be surprised if in earlier questioning, he was asked about what he did and gave vague answers where if he had gone on about something like HDMI specifications till they passed out from boredom, they wouldn't have made him take that test.

  3. Crowdsourcing! by Frosty+Piss · · Score: 4, Funny

    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.
  4. Israel has been doing this by Anonymous Coward · · Score: 3, Informative

    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.

  5. Creative answers by Anonymous Coward · · Score: 3, Funny

    He really should have messed with them. Binary tree? That is where we obtain the components for the binary explosive.

  6. Re:Interesting story by mindwhip · · Score: 3, Funny

    you fail.. the answer is

    if (story) { interesting = true }

    --
    [The Universe] has gone offline.
  7. TSA knows? by qQ7eBMsfM5gs · · Score: 3

    The most surprising in this story that Custom officers were able to come up with the quoted questions.

    1. Re:TSA knows? by TWX · · Score: 3, Insightful

      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.
  8. I'd fail that binary search tree test by mfearby · · Score: 5, Insightful

    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.

    1. Re:I'd fail that binary search tree test by loufoque · · Score: 2

      That's not how you check whether a binary tree is balanced.
      The answer in the other part of the thread is wrong as well.

      It's scary how some so-called "software engineers" can't even solve such a trivial problem.

  9. proctologists and gyanecologist by Anonymous Coward · · Score: 5, Funny

    I wonder what kind of tests do they give them.

    1. Re:proctologists and gyanecologist by TWX · · Score: 3, Funny

      Substitute TSA screener.

      --
      Do not look into laser with remaining eye.
  10. Not at the border by Anonymous Coward · · Score: 5, Insightful

    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.

  11. Re:Not in the summary: by OverlordQ · · Score: 5, Insightful

    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.
  12. Re:Not in the summary: by Anonymous Coward · · Score: 4, Insightful

    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?

  13. Re:He's lucky it wasn't Canada by SirSlud · · Score: 5, Informative

    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"
  14. The correct answer: look on stack overflow by mveloso · · Score: 5, Insightful

    The correct answer to all of these questions is "why don't you look on stackoverflow?"

    1. Re:The correct answer: look on stack overflow by Anonymous Coward · · Score: 3, Funny

      The correct answer is that solving the problem would incur a consulting fee, but you are not allowed to work on a tourist visa (or as a visitor under a visa waiver program), so he'll have to ask someone else.

  15. I'd fail both questions, and I'm a USAian! by amigabill · · Score: 2

    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...

  16. Easier test by quadrantviewer · · Score: 5, Funny

    Surely it would have been easier to check if he was an engineer by forcing him to try to talk to a girl?

    1. Re:Easier test by Anonymous Coward · · Score: 4, Funny

      Torture is forbidden by law.
      Most of the time anyways.

    2. Re:Easier test by chooks · · Score: 2

      Would this be torture for the engineer, or torture for the girl?

      --
      -- The Genesis project? What's that?
    3. Re:Easier test by Cro+Magnon · · Score: 2

      Would this be torture for the engineer, or torture for the girl?

      Yes.

      --
      Slow down, cowboy! It has been 4 hours since you last posted. You must wait another few hours.
  17. Well... by SeattleLawGuy · · Score: 4, Interesting

    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++
    1. Re:Well... by Obfuscant · · Score: 2, Informative

      It happened in an environment where this same organization (part of the Executive branch) has just been found by the Ninth Circuit courts to be attempting to specifically ban as many adherents of a specific religion as they could,

      First, the executive order suspending immigration did not do so based on religion, only on citizenship in seven specific countries. There was an exemption for refugees from religious persecution, but no mention of Islam or muslims at all.

      Second, the Ninth Circuit made no such finding in their stay. In fact, the article you linked to was quite explicit in saying exactly the opposite:

      The court discussed, but did not decide, whether the executive order violated the First Amendment's ban on government establishment of religion by disfavoring Muslims.

      The Administration isn't appealing it any further, which is essentially and admission.

      "And [sic] admission" of what? And they haven't YET appealed it, but that does not mean it will never be appealed. In fact, the article you linked to explained why it might not be appealed immediately. Did you read it?

      So harassing a valid Visa holder from this same country, in context, no longer looks particularly innocent.

      You know, I hope, that a stay on an immigration policy that bars admission temporarily does NOT mean that there can be no barriers at all to immigration?

      It looks very much like someone possibly literally being in contempt of court.

      It looks like no such thing, once you understand what the executive order actually says, and what the court said about it. The court did not stay any and all immigration policies or practices for those seven countries, just the limited set defined by the executive order.

  18. Re:Interesting story by _merlin · · Score: 4, Informative

    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.

  19. Re:Interesting story by Anonymous Coward · · Score: 3, Informative
  20. Re:He's lucky it wasn't Canada by Anonymous Coward · · Score: 3, Informative

    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.

  21. Re:Interesting story by ShanghaiBill · · Score: 2

    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.

  22. Re:Not in the summary: by ClickOnThis · · Score: 2

    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.
  23. Nothing new by OzPeter · · Score: 4, Informative

    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?
    1. Re:Nothing new by Anonymous Coward · · Score: 2, Informative

      French historian detained for 10 hours
      http://www.cnn.com/2017/02/28/...

      Australian Children's author detained
      http://www.smh.com.au/entertai...

      Both of those stories are from this week. I think that qualifies them as "new".

  24. Re:Interesting story by behrooz0az · · Score: 2

    interesting = story;
    FTFY

    --
    Moderating "-1, Disagree" is simple censorship. Have the guts to post your opinion. -- Spazmania (174582)
  25. Re:Interesting story by Idarubicin · · Score: 4, Informative

    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
  26. Re:Interesting story by Anonymous Coward · · Score: 5, Interesting

    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.

  27. Re:Interesting story by lgw · · Score: 2

    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.
  28. Re:Interesting story by bobbied · · Score: 2

    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
  29. Re:Not in the summary: by CaptainDork · · Score: 3

    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.
  30. Re:Interesting story by Calydor · · Score: 4, Insightful

    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=-
  31. Almost nobody needs know how to balance a B-Tree by jtara · · Score: 5, Insightful

    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.

  32. Re:Interesting story by citylivin · · Score: 5, Insightful

    "Very few people can and will bullshit confidently in such a circumstance."

    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
  33. Re:Interesting story by lgw · · Score: 2

    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.
  34. Re:Interesting story by frank_adrian314159 · · Score: 2

    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.
  35. It's a .h with no .c (an interface) by raymorris · · Score: 3, Informative

    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).

  36. Re:Interesting story by Boronx · · Score: 2

    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?

  37. Re:Interesting story by Trailer+Trash · · Score: 2, Insightful

    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.

  38. Re:Interesting story by dfsmith · · Score: 3, Funny

    Recursion is always the answer:

    • something with trees: recursion!
    • GUI window placement: recursion!
    • use after free bug: recursion!
    • my stack keeps overflowing: recursion!
  39. Re:Interesting story by flargleblarg · · Score: 2, Insightful

    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)) {

  40. Economic war by seoras · · Score: 2

    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.

  41. The government should be as picky... by mschaffer · · Score: 2

    The US Government should be as picky when they hire political cronies that provide goods and services.

  42. Could return any type. Standard example Animal by raymorris · · Score: 2

    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.