Skip to content

Instantly share code, notes, and snippets.

@jacob-acusensus
Last active September 10, 2025 00:14
Show Gist options
  • Select an option

  • Save jacob-acusensus/ad780228a561dc44bc9b96e8d4b1ad9d to your computer and use it in GitHub Desktop.

Select an option

Save jacob-acusensus/ad780228a561dc44bc9b96e8d4b1ad9d to your computer and use it in GitHub Desktop.
Acusensus Graduate Application Question
std::string TestFunction()
{
std::string result;
char c1 = 'a' + 125 % 50 - 1;
char c2 = 'a' + 0b0101 - 1; // 0b == binary literal
char c3 = 't' - 1;
result.push_back(c1);
result.push_back(c2);
result.push_back(c3);
result.insert(0, 1, toupper(c2));
return result;
}
private static string TestFunction()
{
string result = string.Empty;
char c1 = (char)('a' + 125 % 50 - 1);
char c2 = (char)('a' + 0b0101 - 1); // 0b == binary literal
char c3 = (char)('t' - 1);
result += c1;
result += c2;
result += c3;
return result.Insert(0, c2.ToString().ToUpperInvariant());
}
private static String TestFunction()
{
String result = "";
char c1 = 'a' + 125 % 50 - 1;
char c2 = 'a' + 0b0101 - 1; // 0b == binary literal
char c3 = 't' - 1;
result += c1;
result += c2;
result += c3;
return Character.toUpperCase(c2) + result;
}

Comments are disabled for this gist.