Find the Median as a Job Interview Question
I stumbled across a blog post about finding the median of a list of numbers as a job interview question.
I stumbled across a blog post about finding the median of a list of numbers as a job interview question.
John D. Cook Consulting seems to do the manner of work that regular programmers like me only dream of doing, and their blog entries are uniformly interesting, educational and somehow esoteric. I’m amazed by them.
John D. Cook Consulting’s blog
published a post Fitting a regular expression to a list of words
where (apparently!) John Cook himself shows how
to use a Python library to combine several strings into
a regular expression that,
when interpreted by a program like grep,
will match all those strings.
The Go Blog has a post titled Allocating on the Stack. The post makes the claim that programs compiled with Go v1.26 compiler, and using the v1.26 runtime can allocate backing store of slices on the stack under some circumstances.
A long time ago, I worked at a company that has since merged with another large company. Back in the day, my employers kept a technical reference library that included back issues of a magazine, Software: Experience and Practice. A few of the earliest issues of that magazine had a “Computer Recreations” column. Volume 2, pages 397-400 had a column on self reproducing programs.
I came across an article by Brian Kernighan. The article is about a piece of C code written by Rob Pike, apparently for a book Pike and Kernighan wrote together, The Practice of Programming.
The old Daily Coding Problem email list gave us this problem around 2020:
Daily Coding Problem: Problem #237 [Easy]
A tree is symmetric if its data and shape remain unchanged when it is reflected about the root node. The following tree is an example:
4
/ | \
3 5 3
/ \
9 9
Given a k-ary tree, determine whether it is symmetric.
This problem is less well described than I thought when I worked on it in 2020.
There’s an older programming job interview question:
Given a string of round, curly, and square open and closing brackets, return whether the brackets are balanced (well-formed).
For example, given the string “([])”, you should return true.
Given the string “([)]” or “((()”, you should return false.
I found a set of linked list coding problems I’d never seen before.
The document is titled Linked List Problems, written and copyright by Nick Parlante, dated 2002. Apparently Linked List Problems is part of the Stanford CS Education Library, which looks to date to around the end of the 20th Century.
.Data values, or arbitrarily changing .Next pointers
does not cause the performance drops.
I looked for other anomalies, too.
What happens if you compare the number of comparisons made by recursive and wikipedia bottom up algorithms if the initial list is pre-sorted (low data value to high data value) or reverse sorted (high data value to low).