IHateSpaghetti {code}

VSX, DSL and Beyond by Eyal Lantzman

Syndication

Coding / Architecture

Extensibility /DSL

Projects

Articles

Browse by Tags

All Tags » interview (RSS)
Interview questions - the difference between IT and large software companies
Shachar left me a comment in my post Interview Question #5 - Binary permutations and I at first to answer as a comment but then thought that I will be a great post by it self (you will be the judge of that). Let me tell you a personal story. I was one of the first people that interviewed for a developer positing at Microsoft Herzeliya, long before any large recruitments. So I went there, confident that I be able to pass the interview and start my career at Microsoft. The confidence was based on my...

Posted by Eyal | 2 comment(s)

Interview Question #6 - Three way partition - generic solution
This post is a part of the Interview Question Series posts. Three way partition?! Is there a two way partition or a four way partition ?! Well X way partition problems are simply dividing the array/collection into X compartments each with it's own distinct feature/property. One way compartment sort is too simple (just return the array without doing anything) :-) Two compartments are not difficult as well - you just need to pointers one to the left side one to the right side and you advance the...

Posted by Eyal | with no comments

Interview Question #5 - Binary permutations
This post is a part of the Interview Question Series posts. Question for a given positive integer n print all the permutation of a binary number of size n. Example : n=3 => 000, 001, 010, 011, 100, 101, 110, 111 In general there are 2^n permutations for a given n. Try to solve it by yourself first... The code below shows two approaches to these kind of questions a mathematical one - just loop 2^n times and switch the left most bit if the resulting bit is zero then shift then switch the next one...

Posted by Eyal | 2 comment(s)

Interview Question #3 - fastest search for minimum and maximum
This post is a part of the Interview Question Series posts. Question: What is the fastest way to find minimum and maximum in (unsorted) array? How many comparisons will be in array of length N? The runtime complexity is obvious - in order to find the minimum or maximum we have to go through all the items in an array - O(n), the question is how can we minimize the number of comparisons. Well let's see , the naive approaches are find loop through array and find minimum then loop again and find...

Posted by Eyal | with no comments

Interview Question #2 - Recursive IsSubstring(s1,s2)
This post is a part of the Interview Question Series posts. Check if the string s2 is a sub string of string s1 (when s2 is null or empty then return true) You can use only string's indexer, string's Equals function, string's length function and string's substring function. Use the following signature: bool IsSubstring(string s1, string s2) and solve in recursion. Try to solve this by yourself first.... But anyway here's the solution for the problem: There are two versions one...

Posted by Eyal | 3 comment(s)

Interview Question #1 - Recursive IsCover(int[] values, int amount)
This post is a part of the Interview Question Series posts. For a list of integers (positive and negative) check if there's a combination within them that when you will sum them the result will be a specific amount. Use the following signature: bool IsCover(int[] values, int amount) and solve in recursion. Example: for the following list { 5, 22, 13, 5, 7, -4 } and amount 23 the answer will be true (5 + (-4) + 22 = 23) Try to solve this by yourself first.... But anyway here's the solution...

Posted by Eyal | 10 comment(s)