This interview question is the first question when a friend interviews Microsoft Asp.net team in the United States. Generally, the first question will be relatively simple .....
1. The recipient sends you a question via email and livemeeting.
2. This question requires final answersCode(C #)
3. Time Limit30 minutes, Including the time for reading the document and submitting the code .. (It's actually two questions in an hour .. however, this document is quite long... clearly stated)
4. The final code must be compiled, run, and implement the following business functions
Business functions:
Design a regular expression parser to support:
Constant search. For example, if the expression is ABC, it matches ABC, and a matches a. The length is unlimited.
\ D matches a number
\ D +
Escape \ D and so on
The input regular expression may be similar to dafdfa \ DFA \ dd \ D ++ ddfga434
It's easy to remember... but it's only half an hour... it's a tragedy.
I tried it myself. It took about 40-50 minutes to complete a version with bugs without preparation...ProgramI found that there are so many things to consider.
The method signature provided by the other party is as follows:
Bool test (char [] input, char [] RegEx)
{
// Here is your code
}
True indicates a match.
If the return value is false, the request does not match.
PS: I am very insensitive to some basic things now... for example, how to convert char [] to string, and the pointer and index may be too long to move these things ....
1. The recipient sends you a question via email and livemeeting.
2. This question requires the final code (C #)
3. Time Limit30 minutes, Including the time for reading the document and submitting the code .. (It's actually two questions in an hour .. however, this document is quite long... clearly stated)
4. The final code must be compiled, run, and implement the following business functions
Business functions:
Design a regular expression parser to support:
Constant search. For example, if the expression is ABC, it matches ABC, and a matches a. The length is unlimited.
\ D matches a number
\ D +
Escape \ D and so on
The input regular expression may be similar to dafdfa \ DFA \ dd \ D ++ ddfga434
It's easy to remember... but it's only half an hour... it's a tragedy.
I tried it myself. It took about 40-50 minutes to complete a version with a bug without preparation ...... when implementing the program, I found that there are so many things to consider.
The method signature provided by the other party is as follows:
Bool test (char [] input, char [] RegEx)
{
// Here is your code
}
True indicates a match.
If the return value is false, the request does not match.
PS: I am very insensitive to some basic things now... for example, how to convert char [] to string, and the pointer and index may be too long to move these things ....