Solving a Tricky Interview Question: My Process (Part 2)

(Continued from Part 1)

In Part 1, we wrote a dead-simple brute-force algorithm to solve the “string-product problem”.  By comparing pretty much every word to every other word, we felt the brunt of the O(n²) complexity of our algorithm (read more about Big-O notation here).

But even before seeking out an algorithm with a better worst-case bound, which will require more critical thinking, we can apply some simple logic to the order of our if-statements to avoid unnecessary work.

Continue reading

Advertisements

Solving a Tricky Interview Question: My Process (Part 1)

A while back, I was approached by a peer of mine about an interesting problem they had recently attempted for an interview question.  As their solution had already been submitted, and as they wanted to understand if they had missed a better or faster way to complete the challenge (restricted to Python 3), they asked me a to take a look at it.

It turned out to be a more nuanced and interesting problem than I expected.

The problem stated:

Given a file containing a list of English words, find a pair of words with no letters in common, such that the product of their lengths is maximized.

Continue reading

Cryptography and Law in the 21st Century (Paper)

This is a paper I wrote for a final project as part of my CS/Cyber program.  It discusses the modern pros and cons of encryption and how they affect the interests of individuals, companies and law enforcement.  Enjoy!  Cryptography in the 21st Century