Interviewing
FizzBuzz, a Perfect Initial Interview Question
What is FizzBuzz? The FizzBuzz problem asks the person to create a small program in a language of their choice. This program must enumerates from 0 to 100. If the number is evenly divisible by 3 print the word “Fizz” if divisible by 5 print the word “Buzz”… if divisible by both 3 and 5, print ‘Snap Pop’ [...]
Interview Question: How Would you Test a Software Component
You are given a software component that takes input from the user, performs some computation on it, and then outputs a response. What test cases would you create to verify this component is functional? When approaching a question such as this, I always start by going to the white board and writing down the categories [...]
Interview Question: Find the Missing Numbers Between 0 and Infinity
You are given a grab bag full of numbers. These numbers will be integers between zero and Max Integer. The numbers are not sorted in any way. Write a method that will return all every value not in this range. Answer: Given that it will not be possible to actually give this as a List of [...]
Interview Question: Validate Parantheses Align
This is should be an easy one; given an input string determine if there is a matching close parentheses for every open parentheses. For example; the string “abc(def)(j((k)))lm()” should return true. However; the string “def(()xyz” would return false. Did you remember the case “sdf())abc)” should also return false? public static bool IsValidParantheseExpression(string input) { var [...]
Interview Question: Find the Longest Repeating Pattern
Given a string of any size length, find the longest repeating pattern that may be truncated at the end. To provide examples of expected output: “abcabc” would be equal to “abc” “abcdabcdabc” would be “abcd” because the truncation still starts with “abc” public static string FindLongestRepeatingPattern(string input = “abcdefghiabcdefghiabcdefghiabcdefghid”+ “abcdefghiabcdefghiabcdefghiabcdefghi”, StringComparison comparison= StringComparison.CurrentCulture) { if (string.IsNullOrEmpty(input)) [...]
Interview Question: Process a Binary Tree
For this one the question was to walk a Binary Tree and call a method on the left then then right node. If there is any nodes to the left of the left that needs to be called first, and so on recursively. To give a diagram assuming you started at at the top (node [...]
Interview Question: Create a Calculator
For a recent interview question I was asked to write a method that would evaluate a string such as “-2+5*4/2+1″ into the value 9. My solution was done in 3 parts; first tokenize the string so each block of digits or operator can be addressed at the same time. public static float Evaluate(string expression) { if (string.IsNullOrEmpty(expression)) throw new ArgumentNullException(“expression”); // // First tokenize the string [...]
The Courious Case of the Bungie Interview
I recently decided it would be interesting to apply to work for Bungie. And I have to say; they are an odd place to apply. The process started out fairly standard; I sent them a simple 2 pager resume and said that I could send a longer form CVE if they preferred. After a few days [...]