Interview Questions
When I started working for my current company, they had me take an online test before I ever got an interview. Not a big deal, multiple choice, fairly easy stuff. When I finally got my interview I was told I did well and got a 70% on the test (better then anyone else that took it). That number always bugged me because it was a simple test. Today, randomly, I got to see my results for the test. Its not that I answered them wrong, its that the company did.
This one bugs me the most, a company that says it loves linux, is good with it, and bosses who like to say they know everything.
What command in a script would print on the screen the first variable passed into that script?a) /usr/bin/echo /$1
b) /usr/bin/echo $1
c) /usr/bin/echo \$1
d) /usr/bin/echo 1
For anyone with bash experience, the answer is pretty easy. its b $1 (even tho deprecated and should be ${1}) will output the first argument passed to a script. Their answer.. was c. If you put that in a script and run it, you will get the output “$1” because \ is an escape sequence.
There are plenty more examples in this ‘quiz’ of them being wrong, but I don’t feel like going into all of them right now.
