So this was actually asked of me once in an “interview style” situation and it took me quite a while to twig that the use of a queue would be required. I can’t fully remember the wording of the question but it was basically something like this: “For every thousand session requests recieved by your server, if the…

# Tag: Coding tests

## Linked list stuff in a modern environment

So recently somebody asked about this and seemed surprised when I said that owing to the availability of lots of lists and collection classes in modern frameworks, I had not coded a linked list in a couple of decades, at least not since I completed my BSc (finished in 1996 while employed by IBM). So anyways, I decided to include…

## Checking for a prime number

Ok, looking back at the original post I’m nearly regretting it as I need to find the time to actually write these – but at least this one was quick and simple. In fact it may be too simple to use as a tech test, but anyways here it is. A prime number is any number…

## Checking if a string is a palindrome

Back in my original college days (over 20 years ago now) this used to be the subject of a running joke. It seemed that with every new language learned one of the first exercises was to check for palindromes, and the joke was that we couldn’t wait to get into gainful employment with some large corporation,…

## Quicksort

Along with Mergesort, Bubblesort and others, Quicksorting of arrays is a standard on any fully fledged undergraduate computer science course. It’s a simple theory, and like a lot of theories can be easily described verbally, on a whiteboard or even in pseudocode, but they all take a little work to actually implement. Quicksort is a “divide…

## Greatest Common Divisor (and Lowest Common Multiple)

It’s worth repeating the wikipedia definition for GCD here, as it’s explains it well: “The greatest common divisor (gcd), also known as the greatest common factor (gcf), or highest common factor (hcf), of two or more non-zero integers, is the largest positive integer that divides the numbers without a remainder. For example, the GCD of…

## Binary Search Tree

This is a simple data structure, but again one with which many of us may have not been familiar with in some time. But it seems to beloved of tech screeners (and very useful in networking software) so a refresher is always nice; I have here put together a simple sorted tree and some equally…

## Comparing strings with a ‘*’ wildcard character

This was a nice challenge, and while I have here a version that works, I have certainly not tested it extensively. After much pondering and barking up the wrong tree on a whiteboard I started playing with code and slowly it dawned on me that there are two fundamentals to this. Firstly I had to…

## Technical Interview/screen questions…

This topic has come up in my circles lately. Actually I’ve found myself more than once in discussions on the best way to interview technical people and it seems that many many people are of the opinion that the old ones are still the best – i.e. the same puzzles and algorithms that we use to test a…