How Do You Troubleshoot the Kubernetes Error “cluster unreachable”?

Problem scenario
You get a message “kubernetes cluster unreachable” when running a helm, kubectl, az, or eks command. What should you do?

Possible solution #1
Has a router been reconfigured? Has a new firewall rule been imposed? Has a data center gone down that housed the cluster? Did you receive an email about a maintenance window or a configuration change?

Possible solution #2
What are the permissions of the relevant .yaml file?

Which Is a Higher Position, a Senior Engineer or a Staff Engineer?

Question
Which is a higher position, a Senior Engineer or a Staff Engineer?

Answer
Companies do not always conform to a job title convention or standard. However we find that the Staff Engineer title denotes a step above Senior. A Staff Engineer could be below a Principal Engineer however.

For further reading,

How Do You Troubleshoot String Manipulation with List Slicing Not Working as You Expect?

Problem scenario
You are taking a slice of a Python string. You know that syntax like var_x[-2:] signifies the penultimate character and the last character of a string (called var_x). But you are only seeing one character — not two. You expect to see two (or a different number of characters than what you are seeing). Why is the snippet printing out fewer characters than you expect?

Possible Solution #1
There could be an invisible “\n” attached to the string (e.g.,

How Do You Get a Multi-line Variable in Python to Be Treated as Lines and Not Characters?

Problem scenario
When a number of lines of text are read from a file, the Python program sees each line as such. When a number of lines of text are in the program itself, that is you use a multi-line variable assignment in a .py program, Python sees the characters individually and does not distinguish between the different lines. The len() function reflects these differences. You want the Python program to read the text in the program as if it were read from the “with open” and “readlines()” function line-by-line — not character-by-character.

What Is The Time Complexity when There Are Four Variables Used Arithmetically in a Program?

Question
You have a program with four variables that are used in arithmetic, but no other operations happen. (There are no while or for loops at all.) What is the time complexity of such an algorithm?

Answer
O(1). An algorithm, as long as the number of operations is fixed or constant, can be considered to have O(1) time complexity. The source is page 39 of Elements of Programming Interviews in Python.

How Do You Rotate Certificates?

Problem scenario
You have load balancers, web servers, and other HTTP technologies that rely on SSL or TLS certificates. Some certificates will be revoked for security reasons. How do you provision new certificates to update them (because they will expire or you want to harden your environment by refreshing the certs as aged certs are more likely to be compromised than young ones)?

Solution
You may want to plan for having lower capacity than normal and therefore schedule the time to do this in production during an off-peak time.

Should You Ask What the Salary Pay Range Is?

Problem scenario
You have applied for a job. You are curious what it can pay. Would the interviewer be upset if you asked what the expected pay range is for the position?

Solution
In some jurisdictions private employers must disclose the pay range. If you live in one of those places and you are asking for a remote position, it may be legally required for the employer to disclose it.

What is an Apache Web Server Container?

Problem scenario
You are reading about Apache Web Server containers. These are not related to Docker containers. You often see them near or tags. What are Apache Web Server containers?

Answer
They are portions of text that contain Apache web server configuration. (The source of this is https://httpd.apache.org/docs/2.4/sections.html.) The configuration includes directives often related to the VirtualHost in Apache web server.