Test 2 – Extract and Format User Name
To perform effectively as a C# software application developer, one must be acquainted with various facets of the C# programming language. To test the skills of application developers, Superior Consulting Services (SCS) offers a series of technical coding challenges designed to challenge and educate C# application developers. This blog addresses C# basics and presents SCS’ second challenge: extract and format user name. Check out SCS coding challenge #1 and learn the winning solution!
Let’s get ready to rumble… C# style
Below is the second challenge. Each SCS challenge will require the user to solve a problem and present their approach through a coded solution. All questions are designed to be solvable by mid-level C# application developers in one hour or less. The second challenge is below.
Scenario: An application needs to show the name of the person currently logged in. The login process fetches a username from the Users Table; however the data may not be complete.
Following standard design principles, coding standards and naming conventions, create a method accessible by outside classes that will take a single string containing the person’s real name and transform it to a first name and last initial in upper case.
Possible input values of user name:
• FirstName LastName (e.g. “Bob Jones”)
• FirstName (e.g. “Bob”)
• LastName (e.g. “Jones”)
• Empty String (e.g. “”)
• Null (e.g. null)
Desired output value:
FIRSTNAME L (e.g. “Bob<space>J”)
In cases where there is no complete firstname and lastname, pair in the input data, come up with a creative solution.
1. The Method should contain all appropriate attribution, decoration, typing and punctuation.
2. When embedded into a C# application or class library, the method must compile, build and run without errors or warnings.
3. Contestant challenge submittals should be sent via email to email@example.com with the subject line: SCS Coding Challenge #2
4. Reponses to Challenge #2 need to be received by 5:00 pm CDT on April 20, 2015
5. In the event of a tie between two or more winning solutions, the first solution received will receive the prize; however, all submitters with correct solutions will be recognized.
6. Employees of SCS are not eligible to participate in the coding challenge.
The best solution submitted will receive an Amazon gift certificate worth $25.00 and have the winning solution, along with the winner’s name, on the SCS website: www.teamscs.com.