Donald Trump's temporary immigration ban and the ensuing heightened security procedures for travelers from outside the U.S. have caused a great deal of trouble for visitors to the country.

On Sunday, though, things got taken to the next level when the Customs and Border Protection office reportedly claimed its latest victim: 28-year-old Celestine Omin, who was traveling from Lagos, Nigeria on business.

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.

"Your visa says you are a software engineer. Is that correct?" the officer reportedly asked Omin. After verbally confirming his occupation, Omin was given a piece of paper and a pen to test his knowledge as a software engineer.

Omin was instructed to answer the following questions:

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

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

I was just asked to balance a Binary Search Tree by JFK's airport immigration. Welcome to America. — Celestine Omin (@cyberomin) February 26, 2017

According to the LinkedIn post, Omin who has over seven years of experience in his department, was seriously sleep deprived and emotionally flustered by this point. Thus, he felt the questions were "opaque and could have multiple answers." In fact, to him they looked suspiciously like the officer simply Googled, "Questions to ask a software engineer," which he addressed in comments on his Twitter account.

@ssharwood sad thing is, if I didn't give the Wikipedia definition for these questions, it was considered a wrong answer. — Celestine Omin (@cyberomin) February 26, 2017

After Omin attempted to complete the ridiculous test designed to prove he was, in fact, a software engineer, he was informed by a customs official (who he suspects wasn't technically trained) that his responses were incorrect.

"No one would tell me why I was being questioned. Every single time I asked [the official] why he was asking me these questions, he hushed me … I wasn’t prepared for this. If I had known this was happening beforehand, I would have tried to prepare," Omin told LinkedIn.

"That is when I thought I would never get into the United States."

As Omin sat, convinced he would be denied access into the United States, an official suddenly told him he was free to go. Without any further explanation, the official apparently said, "Look, I am going to let you go, but you don’t look convincing to me."

Tired and discouraged, he simply walked out of the office without responding, and after posting about his experience on Twitter, received an outpouring of support from stunned followers.

@cyberomin I'm so sorry. Welcome to America. — Jessica Webster (@A2Jess) February 27, 2017

@cyberomin This is so unacceptable. I'm so sorry this happened. — Jen Aprahamian (@jennifermarie) February 27, 2017

@cyberomin I am so embarrassed of my country. I am so sorry. — Corey Ann (@coreyann) February 27, 2017

@cyberomin I'm really sorry that happened to you, it's really unacceptable. — Diego ArandaTeixeira (@DiegoATLaw) February 27, 2017

@cyberomin I'm so sorry you had to go thru this. Ordinary Americans are carrying out Bannon's inhumane actions. It's a travesty. — FranIAm (@Franterest26) February 27, 2017

@cyberomin Goodness gracious. That must have been so stressful :( — Rob Allen (@akrabat) February 27, 2017

Once Omin was released from the airport, he learned that U.S. Customs even called his employer, Andela, along with New York based firm and client First Access for additional questioning.

Christina Sass, co-founder of Andela, reportedly received the call about Omin, and explained this was the first time any of Andela's engineers have been grilled with questions specific to software engineering.

"Celestine was the first software engineer at one of the most visible e-commerce sites in Africa and is exactly the kind of person we want coming to America and sharing his skills," said Jeremy Johnson, co-founder and CEO of Andela.

"Tapping into brilliant minds like Celestine’s is a huge help to many American companies who are struggling to find talent," Johnson told LinkedIn. "We want to make sure that our team members around the world know what to prepare for and don’t get unnecessarily hassled for their work."

For fear of similar roadblocks taking place in the future, Johnson reportedly reached out to Customs and Border Protection to seek additional information surrounding the mishap with Omin's work visa.

In an email, a spokesperson from Customs and Border Protection said, "U.S. Customs and Border Protection (CBP) officers strive to treat all people arriving in the country with dignity and respect." However, they said that they are "not at liberty to discuss individual cases" as a result of the Privacy Act.

Additionally, the spokesperson explained that according to U.S. immigration law, "applicants for admission bear the burden of proof to establish that they are clearly eligible to enter the U.S." and encountering individuals traveling to the country with fraudulent documents "is not uncommon."

Mashable reached out to Omin for additional comment.

UPDATE: March 1, 2017, 12:47 p.m. EST Updated with comments from a Customs and Border Protection spokesperson.