Microsoft interview questions, first in Asp.net team, Regular Expression

Source: Internet
Author: User
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 ....

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.