How Do You Prepare for a Job Interview as a Software Engineer?

Question
How do you prepare for a job interview as a software engineer?

Answer
You may want to go to these pages:

Buy books on technical aspects of coding or one that is geared toward technical questions that may be asked. Here are some options:

How Do You Find the Largest and Smallest Numbers in a Python List in O(N^2) Time?

Problem scenario
You want to write a Python program that will accept a list of integers interactively. You want the program to find and print out the largest number and the smallest number of the list entered. You do not want to use the max() or min() functions (which work in Python 3 without importing any library).

What do you do?

Solution

def extremefinder(mainlist):
a = len(mainlist) – 1
b = len(mainlist)
maxnum = 0
minnum = 0
for x in mainlist:
low = 0
high = 0
for y in mainlist:
if (x y):
low = low + 1
if (low == a): # This never evaluates if x == y. …

How Do You Install pip on a RHEL Server in AWS?

Problem scenario
You want to install pip on a RedHat Enterprise Linux server in AWS.  What do you do?

Solution
Prerequisites
This assumes that Python has been installed. If it has not, run this command:
sudo yum -y install python3


Procedures

You may want to try these two commands first:

sudo find / -name pip
sudo find / -name pip3

If the above did not help you,

How Do You Troubleshoot the boto Message “NoRegionError”?

Problem scenarios (one or both of the following are happening)
#1 You are getting “botocore.exceptions.NoRegionError: You must specify a region” when you run a Python program (that involves boto and AWS).

#2 You are trying to create a session with a Python/boto program. You are printing out the Session information in your Python program using boto but you see this:

Session(region_name=None)

What should you do?

How Do You Install and Configure the rdf4j Server and Workbench GUI?

Problem scenario
You want to use the rdf4j (Resource Description Framework for Java). You want to install the rdf4j server and workbench. You are using Debian 9 Linux. What should you do?

Solution
Prerequisites
i. We recommend having a 30 GB of hard disk free.

ii. We recommend having 5.75 GB of RAM (it can be a combination of RAM and swap space).

Why Does Your Python Program Return “function at” with a Hexadecimal?

Problem scenario
You run a Python program. A value of a variable is printing “function at” with a hexadecimal. How can the variable be the intended value of the function and not this meta data of the Python interpreter or just-in-time compiler?

Solution
Use “()” at the end of the function invocation. This syntax is necessary. Here is an example that will cause the problem:

def cool():
a = “foobar”
return a

q = cool
print(q)

Here is an example that will not cause the problem:

def cool():
a = “foobar”
return a

q = cool()
print(q) …

When Performing Equivalence Operations on Each Item in a List or in a Tuple, which Process Takes Less Time in Python?

Problem scenario
You are trying to refactor Python code. There is an equivalence operation that happens ten million times. You are concerned that a tuple may be a better data structure than a list. Which would operate more quickly and how do you find out for sure?

Solution
The tuple will be faster.

Operations in a tuple are slightly faster.

How Do You Find the Version of Java that is Installed on Your Windows Server?

Problem scenario
You want determine what version of Java is installed (if any). What do you do?

Solution
Open PowerShell and run this command:
(Get-WmiObject Win32_Product | Where {$_.Name -match “Java”}).Version

Alternative way without PowerShell:
1. Go to Control Panel -Uninstall a Program
2. See if Java is installed

How Should You Automate Linux Tasks with Python 2 vs Python 3?

Problem scenario
You have been given a task to automate tasks in Python. You were advised to never use “import os” in a previous position. You were told that this time speed is very important. What should you do?

Possible Solution #1
If you are doing basic file manipulations such as copying or moving files, or changing files’ permissions, you may want to looking into “import shutil”.

How Do You Install Molecule on RHEL v. 8.x with Python 3?

Problem scenario
You want to make and test Ansible roles, and therefore you want to use Molecule. You are using RHEL version 8.x. You want to use Python 3 and Molecule. What should you do?

Solution
Prerequisites
i. You should install Docker. If you need assistance, see this posting.
ii. You should install these packages before hand:

sudo yum -y install gcc python3-devel
sudo dnf install -y redhat-rpm-config

Procedures
1.