Hello world! I’m Arden. I work at Pinterest as a software engineer since October 2014. My team is Ads Ranking, where we focus on improving the relevance and revenue of advertisements shown at Pinterest. Before that I was at Microsoft Bing for 2 years. I was an intern at Bing on Summer 2011, where I worked with the Index Generation team. Previously, I interned at Vodafone and Alcatel-Lucent.

VN:F [1.9.22_1171]

## Programming Interview Questions 28: Longest Compound Word

This is my last post of the long programming interview questions series. I’m starting my first full-time job next week at Microsoft Bing Relevance team. Wish me luck..

Given a sorted list of words, find the longest compound word in the list that is constructed by concatenating the words in the list. For example, if the input list is: [‘cat’, ‘cats’, ‘catsdogcats’, ‘catxdogcatsrat’, ‘dog’, ‘dogcatsdog’, ‘hippopotamuses’, ‘rat’, ‘ratcat’, ‘ratcatdog’, ‘ratcatdogcat’]. Then the longest compound word is ‘ratcatdogcat’ with 12 letters. Note that the longest individual words are ‘catxdogcatsrat’ and ‘hippopotamuses’ with 14 letters, but they’re not fully constructed by other words. Former one has an extra ‘x’ letter, and latter is an individual word by itself not a compound word.

VN:F [1.9.22_1171]

Posted in Programming Interview | 18 Comments

## Programming Interview Questions 27: Squareroot of a Number

Find the squareroot of a given number rounded down to the nearest integer, without using the sqrt function. For example, squareroot of a number between [9, 15] should return 3, and [16, 24] should be 4.

VN:F [1.9.22_1171]

Posted in Programming Interview | 18 Comments

## Programming Interview Questions 26: Trim Binary Search Tree

Given the root of a binary search tree and 2 numbers min and max, trim the tree such that all the numbers in the new tree are between min and max (inclusive). The resulting tree should still be a valid binary search tree. So, if we get this tree as input:

and we’re given min value as 5 and max value as 13, then the resulting binary search tree should be:

VN:F [1.9.22_1171]

Posted in Programming Interview | 11 Comments

## Implementing Search Engines

Welcome to my ‘how to implement a search engine’ series. I describe how to implement an actual search engine with working code in python. Here you can find pointers to original detailed articles. I will continue to share in this area.

VN:F [1.9.22_1171]

Posted in Search Engines | 4 Comments

## Programming Interview Questions

The complete list of all my programming interview question articles with pointers to original posts. There are 28 questions in total, and since 28 is a perfect number (as Donald Knuth also mentioned) I decided that’s a good place to stop.

VN:F [1.9.22_1171]

Posted in Programming Interview | 28 Comments

## Programming Interview Questions 25: Remove Duplicate Characters in String

Remove duplicate characters in a given string keeping only the first occurrences. For example, if the input is ‘tree traversal’ the output will be ‘tre avsl’.

VN:F [1.9.22_1171]

Posted in Programming Interview | 11 Comments

## Programming Interview Questions 24: Find Next Higher Number With Same Digits

Given a number, find the next higher number using only the digits in the given number. For example if the given number is 1234, next higher number with same digits is 1243.

VN:F [1.9.22_1171]

Posted in Programming Interview | 26 Comments

## Programming Interview Questions 23: Find Word Positions in Text

Given a text file and a word, find the positions that the word occurs in the file. We’ll be asked to find the positions of many words in the same file.

VN:F [1.9.22_1171]