Jeff
  • Member for 4 years, 8 months
  • Last seen more than a month ago
  • Waterloo, ON, Canada
Coding Challenge : Build Tower refactoring code is it necessary
20 votes

How did you determine the output ' # ' for the case n==1? I'd have expected it to just be '*'. If you're unclear about the specification for code you're writing in an interview, it's best to either ...

View answer
Shortening list of arguments to some kind of a variadic function
Accepted answer
8 votes

This will depend on whether or not all of the indicators you're interested in passing have the same generic type arguments. If they do then iSR5's solution is the simplest. If not then you'll need a ...

View answer
NewSequentialId - pure net core 2.2 implementation of sql server function
7 votes

You want to reduce both computation time and memory allocation. Memory allocation itself takes time, so that's a good place to start -- try to find all the places where you're allocating memory and ...

View answer
Deconstruct tuple and store each element into a List of their respective element type
Accepted answer
7 votes

ref parameters Make sure you fully understand what ref does and when it's appropriate to use it. ref gives you an alias to the variable passed into the method, so only use ref when you need to ...

View answer
Generate Unique ID in C#
Accepted answer
6 votes

/// <summary> /// Identifiers the generation. /// </summary> /// <returns>A Unique ID</returns> private string generateUniqueID(int _characterLength = 11) A ...

View answer
Sweep & prune broadphase algorithm
Accepted answer
4 votes

An IEnumerable (and IOrderedEnumerable) represents a question, not an answer. axisList is not really a list -- it is a question asking "What is the sequence of elements from _gameObjects ordered ...

View answer
Validate if either or both of two fields has been provided, as a ValidationAttribute
4 votes

Fields and properties are different things. You are mixing them up: the naming in the attribute code suggests that you want to operate on fields, but the use site is supplying property names. The ...

View answer
Get Date Taken from Image
Accepted answer
3 votes

//retrieves the datetime WITHOUT loading the whole image string[] GetDateTakenFromImage(string path) Function name and parameter are named well. You should use an XML-doc header to document the quirk ...

View answer
C# Reflection-based CSV Parser
2 votes

The idiomatic TryParse signature is public bool TryParse(string input, out T result). It should never throw; that's what regular Parse is for. Return true if it succeeds and false otherwise, with ...

View answer
Collecting 3 years of data and building a string
Accepted answer
2 votes

I'll focus on the C# part of the code, but please run the output HTML through a validator because at first glance I count no fewer than five HTML tags that are mismatched, misplaced, or simply broken. ...

View answer
c# Converting from one object to another without using foreach
1 votes

The loop is a red herring; the important bit is how you're doing the conversion from one student-ish type to another. I'd start there by writing a converter method: private static ...

View answer
Console Commands with dependency injection (C#)
1 votes

If you're not using C# 8's nullable references, you should be checking for null whenever you're supplied with input. In the ConsoleCommandHandler constructor, throw ArgumentNullException if logger or ...

View answer