A software engineer from Lagos, Nigeria, is claiming that he was made to sit a written test by US airport immigration officers because they weren’t convinced he was telling the truth about his skills.

According to social networking site LinkedIn, Celestine Omin, 28, landed in New York’s JFK airport last Sunday after a 24-hour flight from Nigeria. Mr Omin is employed by Andela, a tech start-up with offices in New York, Lagos, Nairobi and San Francisco.

The firm says it recruits “the most talented developers on the African continent” and connects them with tech employers in the US for potential job vacancies. Facebook chief Mark Zuckerberg visited Andela’s office in Lagos last year.

Mr Omin had reportedly been granted a short-term visa to work with First Access, a financial technology company in New York’s Manhattan district. After being asked a series of questions by a US Customs and Border Protection officer, he was taken into a room for further checks.

“Your visa says you are a software engineer. Is that correct?” an officer is reported to have asked Mr Omin.

He says he was then given a piece of paper and a pen and told to answer these two questions to prove he is actually a software engineer:

“Write a function to check if a Binary Search Tree is balanced.”

“What is an abstract class, and why do you need it?”

Mr Omin told LinkedIn it seemed to him the questions had been “Googled” by “someone with no technical background”.

He said later on Twitter that he was “too tired to even think”, and told the officer they could “talk about other computer science concepts”.

After he handed back his answers, he was told by the officer that they were wrong. He said he presumed he was required to provide “the Wikipedia definition” for the questions.