💾 Archived View for g.mikf.pl › gemlog › 2022-02-17-interview.gmi captured on 2023-11-04 at 11:39:59. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-01-29)

-=-=-=-=-=-=-

How I did bad on my first recent job interview

2022-02-17

This interview was for a Linux Scripting Engineer position with Python. I was supposed to have a Linux computer prepared for the interview.

It was conducted via a Microsoft Teams link, and I first tried installing Microsoft Teams Preview for Linux on my PopOS laptop but it seemed not to allow me to use the app without a company account, although it then turned out that the link worked in it. So I thought I will have to use the web app in browser, and as MS Teams webapp didn't support Firefox, I installed Microsoft Edge for Linux specifically.

The link ended up xdg-opening the app on linux and so I joined through the app but I simulaltaneously expected it to fail so I immediately also went for the "in browser" link and began entering my name there. My speakers were a bit silent but I then heard something when I raised my volume and it turned out the app successfully joined the meeting.

But the performance of the app+laptop or, as they were nearly sure about, of the network connection which was also possible with the crappy router and this laptop only having 2.4GHz WiFi, was making sentences cut-off for them even after I disabled my webcam on their request. The Linux laptop sports an i7-3630QM CPU and 8GB of RAM, so it's not that I chose some weak one.

So I ran for my more performant Windows laptop with 5GHz WiFi and tried to open Teams on there, to no success. And Microsoft Teams were previously installed there with Chocolatey from the also-administrator account of my quasipartner. While in-interview, I attempted reinstalling microsoft-teams with chocolatey with --force, to no avail. It now turns out that there are package parameters like /AllUser and /AllUsers or something like that (there are two similarly named like that but distinct) that make the package install not in the default way of a system-wide -but- one-user installation.

I wonder if similar parameters exist for Windows Terminal because my quasipartner just needed it and I also thought I had it installed system-wide with Chocolatey from *my* account, and --force reinstalling (*from her account*) did nothing. We ended up installing it for her from the Store.

I ended up having the idea to try joining the call from browser from the more performant laptop

( /fortunately/s Windows had Microsoft Edge preinstalled besides my Chocolatey-installed Firefox *(hey, I don't recall that one needing an installation to be parametrized for all-users!)* )

and that let us begin with the call at last.

After a lengthy introduction on the position, I got asked several questions about my personal past and motives which I answered in a somewhat weird way but it might have been not that bad. I managed to speak about needing to learn things and have knowledge to share - present and blog about -, and about the need not to feel worthless, and about a job being a cure for my burnout to allow me to return to university in a few years time. I mentioned I once frequented certain meetups in another city that the company organized.

For the tech interview I was supposed to open a shell and share the view as presenter in the call, they expected an interactive interview. As I was now running Windows, I first tried running a WSL Ubuntu, but as it started they replied that them being unsure of its limitation they would rather not work with it.

So I decided to ssh, from a Powershell tab in Windows Terminal, to my Linux laptop standing on my right hand side. And here it all started.

When typing in the password I was asked if I know about other ways of logging in without a password, I mentioned public keys and that there are other PAM methods like one-time passwords.

First they asked me to show them how would I check what distribution am I running.

 1   less /etc/os-release

Then they asked to show how I would check hardware information, connected devices, later mentioning CPU... I first started typing `lsusb`, `lspci` but ultimately I decided on

 2   lshw
^C^C^C^C^C
 3   sudo lshw
 4   sudo lshw | less
 5   cat /proc/cpuinfo

Then I got asked to check what kernel version am I running. Now that I think of it from head, I could have used `uname` ig, but I ended up with

 6   ls /boot/
 7   file /boot/initrd.img

I then got asked to print just the last word of the output of !7

file /boot/initrd.img | awk {^H^H^H^H^H^H^H^H^H^H^H^H^
 8   man bash
 /   /EXPANSION
 9   RES="$(file /boot/initrd.img)" echo ${RES##* }
10   RES="$(file /boot/initrd.img)" echo ${RES##.* }

and here they asked me to even just print the variable

11   RES="$(file /boot/initrd.img)" echo $RES
12   echo $RES

yes I guess !12 wouldn't haave shown anything and that was verbally communicated

13   RES=abc
14   echo $RES
15   RES="$(file /boot/initrd.img)"
16   echo $RES
17   echo ${RES##* }

Here I got asked to use the shell variable in a sentence, so they meant string interpolation and I decided to do that neatly and not just echo

18   RESS="The last word of \$RES is ${RES##* }."
19   echo $RESS

I then got asked to explain pipes

So I mentioned there are named pipes and anonymous pipes, named pipes are special files while anonymous pipes are kernel constructs that are issued two file handles for assigning to two file descriptors table entries to two programs so that they are able to communicate with each other as if they were writing (or reading) to a file.

20   cd /etc

and then I was asked to *use a pipe* to search the directory listing for "pass"

21   ls | grep pass
22   ls
23   man ls
24   ls -C
25   man ls
 /   /1      # I got assisted with advice to search for "1"
nnnnppppnnn
26   ls -1
27   ls -1 | grep pass
28   ls -1 | grep "pass.*d"     # now with a d at end
29   ls -1 | grep "pass.*?d"    # how do i greedy??
30   ls -1 | grep "pass.*d$"
31   ls -1 | grep "^pass.*d$"   # now make sure it won't start with sth else

Then I got asked to show the permissions on that file and read them

32   stat /etc/passwd

I mentioned that there was no sticky bit or anything and elaborated the permissions briefly. I was then told to create a file in temp.

33   cd /tmp
34   touch a
35   stat a
36   chmod o+x    # I SOMEHOW WENT WITH o AS IN owner !!
37   stat a
38   chmod u+x
39   chmod u+x a
40   chmod o-x a

But I then said I went for this format for tidyness sake and I'm usually using the numeric notation, so I got asked to use it

41   stat a
42   chmod 764 a
43   stat a

I got asked to explain what each digit means, I elaborated on the fours the twos and the ones and the most significant bit and the least significant bit and then I was getting questions calling octal digits octets which were supposed to be tricky to check my knowledge I suppose.

Then I was asked to write a command that would depend on a file existing

44   test -f a
45   echo $?
46   test -f b
47   echo $?
48   if test^H^H^H^H[[ -f a ]]; then echo a; else b; fi
49   if [[ -f b ]]; then echo a; else b; fi
50   if [[ -f b ]]; then echo a; else echo b; fi
51   cd /etc
52   grep -r root
53   grep -r root | less -r
54   grep -r root /etc
55   clear

Now how would you schedule tasks?

56   systemctl status crond
57   systemctl status atd
58   systemctl status cron
59   crontab -e
   00 00 5^H^H^H^H^H^H^H
   0 0 5 *^H^H^H
   0 0 * * 5 bash -c "touch /tmp/a-$(^H^H^H^H^H^H^HH^H^^H^H^
   0 0 * * 5 touch /tmp/a

Haha now my laptop will do this every Friday "Yes don't forget do remove that later"

Now please write a script that will accept two arguments and divide them.

"In Python or in Bash?" - In Bash, we are focusing on shell scripting in this interview.

60   cd ~
61   vi div.bash

Here my PowerShell-ran ssh lags terribly, arrows or sth fail sometimes and result in As and Bs being typed, I :q! even struggling to do so a bit because of lags

62   nano div.bash
   !/usr/bin/env bash
   
   expr $1 / $2
63   chmod +x div.bash
64   ./div.bash 15 3
 :: ./div.bash: line 1: !/usr/bin/env: No such file or directory
 :: 5
66   nano div.bash      # adding the she in shebang
67   ./div.bash 15 3
 :: 5

"But what if 0 is the second argument?" - Only now that I'm writing this I am realizing that I totally was mindless about having to account for edge cases in this brief interview task, when the time was rushing us verily after first losing over 15min over the MS Teams complications and that was very expressed to me.

68   ./div.bash 15 0
 :: expr: syntax error: unexpected argument '0'
69   nano div.bash
   #!/usr/bin/env bash
   
   if [[ $2 != 0 ]]       # first having typed == and fixing lines later
   \t      then expr $1 / $2
   \t      else echo "Division by zero not allowed." >&2
   fi
70   ./div.bash 15 0
71   nano div.bash   # that what you did at the end of there [...]

So I got here asked about it and said it was the standard error output, standard diagnostic output; got asked if I know what the other output is and I said there is standard output at 1.

Then I got asked to show how I would clone a repository

72   git clone git@github.com:mkf/3manchess
73   cd 3manchess/
74   git checkout -b feature-1
--   git push -u origin feature-1

And then I got asked about what I would do if there were to be other changes on the base branch in the meantime and I responded that I could do a rebase, for example with interactive rebase.

So that's all I remember for now, there may have been a few more things between the lines (literally haha) but I feel like I can't remember there being any other things to write down.

I was terribly embarrassed about this interview and I don't think they will pick me. I was running around the flat in stress with chest pains, finally cuddling up to my quasipartner on the couch for comfort; *sweats typing this*. I will receive feedback within two weeks.

~~~~~~~~~~

Edits: