In real world, you are always going to have to solve complex problems as a developer.
You will be given a few challenges below, from beginner to medium difficulties.
It’s meant to assess your programming skills and give us an idea of how you tackle real-world application challenges (Research & Analysis, Develop, Testing, Debug, Deployment, Documentation).
You will be given 1 week to complete the assessment.
Complete all the tasks with C# only.Given a text file file.txt that contains a list of phone numbers (one per line), write a one-liner bash script to print all valid phone numbers.
You may assume that a valid phone number must appear in one of the following two formats: (xxx) xxx-xxxx or xxx-xxx-xxxx. (x means a digit)
You may also assume each line in the text file must not contain leading or trailing white spaces.
Example:Assume that file.txt has the following content:
987-123-4567 123 456 7890 (123) 456-7890
Your script should output the following valid phone numbers:
987-123-4567 (123) 456-7890
Boilerplate (start with this code)// Warm up question only #YOLO.
Create a function to check if a candidate is qualified in an imaginary coding interview of an imaginary tech startup.
The criteria for a candidate to be qualified in the coding interview is:
complete the interview.
Given an array, in a true condition will always be in the format very easy, very easy, easy, easy, medium, medium, hard, hard.
The maximum time to complete the interview includes a buffer time of 20 minutes.
Examples:Interview(new int [] { 5, 5, 10, 10, 15, 15, 20, 20 }, 120) ➞ "qualified" Interview(new int [] { 2, 3, 8, 6, 5, 12, 10, 18 }, 64) ➞ "qualified" Interview(new int [] { 5, 5, 10, 10, 25, 15, 20, 20 }, 120) ➞ "disqualified" // Exceeded the time limit for a medium question. Interview(new int [] { 5, 5, 10, 10, 15, 15, 20 }, 120) ➞ "disqualified" // Did not complete all the questions. Interview(new int [] { 5, 5, 10, 10, 15, 15, 20, 20 }, 130) ➞ "disqualified" // Solved all the questions in their respected time limits but exceeded the total time limit of the interview.
Boilerplate (start with this code):using System; public class Program { public static string Interview(int[] arr, int tot) { } }
Write a function that returns all sets of three elements that sum to 0.
ExamplesThreeSum(new int[] { 0, 1, -1, -1, 2 }) ➞ { { 0, 1, -1 }, { -1, -1, 2 } } ThreeSum(new int[] { 0, 0, 0, 5, -5 }) ➞ { { 0, 0, 0 }, { 0, 5, -5 } } ThreeSum(new int[] { 1, 2, 3 }) ➞ { } ThreeSum(new int[1]) ➞ { }
Notes// The following libraries may be useful using System; using System.Linq; using System.Collections.Generic; public class Program { public static List<int[]> ThreeSum(int[] arr) { return new List<int[]>( ); } }
Write a sorting function that takes in an array of names and sorts them by last name either alphabetically (ASC) or reverse-alphabetically (DESC).
ExamplesSortContacts(new string[] { "John Locke", "Thomas Aquinas", "David Hume", "Rene Descartes" }, "ASC") ➞ { "Thomas Aquinas", "Rene Descartes", "David Hume", "John Locke" } // Aquinas (A) < Descartes (D) < Hume (H) < Locke (L) SortContacts(new string[] { "Paul Erdos", "Leonhard Euler", "Carl Gauss" }, "DESC") ➞ { "Carl Gauss", "Leonhard Euler", "Paul Erdos" } // Gauss (G) > Erdos (ER) > Euler (EU) SortContacts([], "DESC") ➞ {} SortContacts(null, "DESC") ➞ {}
Notesusing System; public class Program { public static string[] SortContacts(string[] names, string sort) { return new string[0]; } }
Throwing
You're given a dartboard divided into sections, each section has a unique score. That means there won't be two sections with the same score.

Throwing a certain amount of valid darts, find how many solutions there are to reach the target score. Your function will be passed three parameters...
If there are duplicate values, keep only the one sorted from smallest to biggest.
"8-19-8" "8-8-19" <-- This is the one you would keep. "19-8-8"
Multiple solutions should be sorted before returning them.
{ "3-11-18", "7-7-18", "7-11-14" } is ok. { "7-11-14", "7-7-18", "3-11-18" } is not ok.
Notes// Its possible to solve using some or all of these librarys. using System; using System.Text; using System.Text.RegularExpressions; using System.Collections; using System.Collections.Generic; using System.Linq; public class Program { public static string[] DartsSolver(int[] sections, int darts, int target) { return new string[0]; } }
In this challenge, you have to establish which kind of Poker combination is present in a deck of five cards. Every card is a string containing the card value (with the upper-case initial for face-cards) and the lower-case initial for suits, as in the examples below:
"Ah" ➞ Ace of hearts "Ks" ➞ King of spades "3d" ➞ Three of diamonds "Qc" ➞ Queen of clubs "10c" ➞ Ten of clubs
| Name | Description |
|---|---|
| Royal Flush | A, K, Q, J, 10, all with the same suit. |
| Straight Flush | Five cards in sequence, all with the same suit. |
| Four of a Kind | Four cards of the same rank. |
| Full House | Three of a Kind with a Pair. |
| Flush | Any five cards of the same suit, not in sequence. |
| Straight | Five cards in a sequence, but not of the same suit. |
| Three of a Kind | Three cards of the same rank. |
| Two Pair | Two different Pair. |
| Pair | Two cards of the same rank. |
| High Card | No other valid combination. |
Given an array hand containing five strings being the cards, implement a function that returns a string with the name of the highest combination obtained, accordingly to the table above.
ExamplesIf there are duplicate values, keep only the one sorted from smallest to biggest.
PokerHandRanking({ "10h", "Jh", "Qh", "Ah", "Kh" }) ➞ "Royal Flush" PokerHandRanking({ "3h", "5h", "Qs", "9h", "Ad" }) ➞ "High Card" PokerHandRanking({ "10s", "10c", "8d", "10d", "10h" }) ➞ "Four of a Kind"
Multiple solutions should be sorted before returning them.
NotesN/A
Boilerplate (start with this code)using System; using System.Linq; public class Program { public static string PokerHandRanking(string[] hand) { return string.Empty; } }