My family, books, photos, technology, language and some math משפחתי, ספרים, תמונות, טכנולוגיה, שפה, וקצת מתמטיקה
Thursday, April 26, 2007
Independence Day BBQ
Wednesday, April 25, 2007
Becoming Your Own Boss
I especially liked the advice to start with managing your boss :-)
Monday, April 23, 2007
Birds I saw in the park next door today
Today: Israel remembers its fallen fighters
This evening, the memorial day will end and the celebrations for the 59th year of independence for the State of Israel will begin.
This move from deep sorrow and memorial day ceremonies to the celebrations of the independence day is one of the symbols of this day.
Thursday, April 19, 2007
new interview questions
This week's interview questions were prepared for candidates with a background in algorithms in bioinformatics and a few years of C++ experience, with an academic background in statistics. The last two questions in probability are due to Shmuel Fomberg.
.A.
Let S1 and S2 be strings over the same alphabet. The edit distance between S1 and S2 is the smallest number of changes sufficient to transform a substring of S1 into S2, where the changes may be:
1. Substitution --two corresponding characters may differ: KAT -> CAT
2. Insertion -- we may add a character to S1 that is in S2: CT -> CAT
3. Deletion – we may delete from S1 a character that is not in S2: CAAT -> CAT
The cost for every operation is 1, regardless of the operation. Suggest an efficient algorithm for calculating the edit distance between two strings. Suggest a design for an efficient implementation (data structures)
.B.
You have a very large and static text T that you have available a-priory, and a set of strings S that you receive in run-time. Describe a data structure and an algorithm that facilitate efficient multiple queries on the same text. What is the required time complexity for executing a query and getting the result?
.C.
Describe an algorithm for searching the existence of a string S in a text T. Write an implementation in a programming language of your choice. What is the time and space complexity of your solution?
.D.
Describe an algorithm for searching the existence of any string from a set of strings {S1 S2, …, Sn} in a text T What is the time and space complexity of your solution? How will your solution change if you want to know which settings exactly from your set of strings was matched in the text?
.E.
Write an implementation of a function that receives a string containing an arithmetic expression (that has numbers, the +-*/ operators and the parentheses () for precedence ordering) and returns the result of the expression.
.F.
How would you copy a class instance in C++? How would you implement a function that receives the source instance and cloned instance and determines that the two are copies?
.G.
Please suggest an object oriented design for a database layer. So that a developer can write code using an object oriented interface and does not need to know anything about database tables, SQL, etc.
.H.
You have three roads that form a triangle. In every node of the triangle (in every intersection of two roads) there’s one car. At a certain point in time every cars chooses a direction and starts moving. They all start moving at the same time and drive. What’s the probability for a collision? A collision is defined as a meeting where at least one car is headed in one direction and at least one other car is heading in the opposite direction.
.I.
There’s a 95% chance that a car drives by your house within 30 minutes. What is the probability that a car drives by your house within 10 minutes.
Wednesday, April 18, 2007
Monday, April 16, 2007
Jewish Holocaust Memorial Day
egg shortage
Yesterday in Petah-Tikva I could not find any eggs other than very expensive ones in מחסני מזון. It looks like the eggs suppliers that normally supply eggs to the stores are not doing do.
I don't have any idea why and I didn't see any information about this in the media.
Sunday, April 15, 2007
Interview questions for developers
1. "Please describe your part in a recent project." I then try to eliminate as much hype and buzz talk and get the candidate the draw a diagram that describes a system and its components. I then query about the exact locations where that person was developing and drill down from there. -- Here I try to understand how well the candidate can describe what s/he did, how well s/he communicates technical information, and of course, how well s/he knows what s/he was working on.
2. "Tell me about a bug or customer problem that you were responsible to solve. What was the problem? How did you realize what was the real cause? How did you solve the problem?" -- Here I try to see what counts as a "problem worth talking about", the organization and manner used by the candidate to solve the problem. I try to understand the methods and the tools used to solve problems of that kind.
3. When I see that a candidate lists a programming language other than the expected Java/C/C++, such as Lisp, Haskell, Perl, Prolog, etc. I tend to cook up a simple question suitable for that language (that is: something that is pretty easy to write down using that language) and ask the candidate. Unfortunately, I usually get disappointed when I either hear the candidate giving excuses why s/he cannot write down a solution, although s/he was bragging in the CV that this is one of the strong programming languages s/he uses. I do, nonetheless, sometimes get to see people who actually can write down some code in the programming language they say they know.
4. Depending on the area of expertise of the candidate, I then ask a few questions in that area.
Here are some questions that I sometimes ask (it's pretty easy to make up new questions):
- Please implement a function that receives an array of integers and the size of the array and returns the same array sorted. For example, for a given array {1,3,5,11,2,2,7,41,17,3,3} the resulting ordering of the array is {1,2,2,3,3,3,5,7,11,17,41}. Please make sure you take into consideration the following requirements:
- For every number i in the array, i is equal or greater than 0 and equal or less than 100.
- Your implementation should be as efficient as possible.
- Note that the returned sorted array must use the same memory as the received array.
- Please write down the definition of a C structure that describes a node in a tree data structure. Note that a node in a tree can have zero or more children. The number of possible children is not known.
- Please write down an implementation of a function that receives a pointer to a node in a tree (the same node description you implemented in the previous question) and returns the number of nodes in the sub-tree, including the node itself.
- Please implement a function that receives an array of pointers to some structure and the size of the array and returns the same array sorted according to the color field of the struct. The structure is defined elsewhere and is of no relevance to us. All you know is that the structure has a field color and that the possible values of that field are RED=0, GREEN=1, BLUE=2. (RED, GREEN and BLUE are constants representing the numbers 0, 1 and 2, respectively.). Please take into consideration the following requirements:
- The array should be ordered in place, i.e., using the same memory.
- You are allowed to use only a constant number of additional memory units that is not dependent on the size of the input. You may use a hint that the amount of necessary additional memory is proportional to the number of colors used.
- Once a color field of an array element has been read, it is not possible to read it again. This means that you’re allowed to view the contents of the color field only once per array element.
- Solve question 4 for the general case of K colors using O(1) of memory.
- Please describe a hashtable data structure, specify a hash function for it and explain the probability for a collision using your hash function.
- Please describe an algorithm that accepts a pointer to a tree node of the same kind of the one in question 2, that can locate tree nodes that have child links to some ancestor node, i.e., can locate all loops. Reason about the complexity of your algorithm.
Mozex -- vim in your browser for editing textarea
As its development page states:
"Mozex is an extension which allows the user to use external programs for these actions:
- edit content of textareas (possibly utilizing a spell-checker in the text editor)
- view page source
- handle mailto, news, telnet and FTP links
- download files
- ... and many more :)"
Thursday, April 12, 2007
israel.pm meeting for April 2007
Yuval Yaari will introduce how the Perl Regular Expressions work.
See: http://perl.org.il/pipermail/perl/2007-April/008605.html
Wednesday, April 11, 2007
Haskel and Functional Programming learning group
Stephanie Forrest's papers
See: http://www.cs.unm.edu/~forrest/isa_papers.htm
Generate GUI from a grammar that describes a CLI
I guess it may be useful for really complex command lines.
From the description on the tool's site itself:
"Kaptain is a universal graphical front-end for command line programs. Someone writes a simple script (so called grammar) which describes the possible arguments for a command line program and Kaptain brings up a friendly dialog to the user to set up the command line."
Tuesday, April 10, 2007
Saturday, April 7, 2007
Noa and Yuval (and parents) visiting
Friday, April 6, 2007
We spent the morning in Alexander stream (נחל אלכסנדר)
New Meltzer Catalog
Tuesday, April 3, 2007
A day at פארק לכיש in Ashdod
We though of visiting a buffalo diary but the place was closed. Wishing for a good time with the kids we drove to the nearby Ashdod and spent the day in Lachish Park (Park Laki$ -- פארק לכיש).
The place was indeed fun for the kids. Here are a few photos from our day there: