Solving “Reverse String” from Daily Bite

Kapil Patel
Sep 14, 2021

This is a copy paste question from Daily Bite email.

This question is asked by Google. Given a string, reverse all of its characters and return the resulting string.

Ex: Given the following strings…

“Cat”, return “taC”
“The Daily Byte”, return "etyB yliaD ehT”
“civic”, return “civic”

Solution using C#

using System;public class Test
{
public static void Main()
{
// your code goes here
string name = "Kapil";

System.Console.WriteLine(name);
int length = name.Length;
for(int i=length-1; i>=0; i--)
{
System.Console.Write(name[i]);
}
}
}

Disclaimer: Copied without permission from The Daily Bite email.

thedailybyte.dev

My self Kapil Patel a software engineer with 8 years of experience. I am trying to solve this with whatever knowledge I have, also I will be improving my solution as I find better solutions from fellow engineers!

--

--

Kapil Patel

Software engineer | loves working in a startup like environment