Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7864813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T23:53:52+00:00 2026-06-02T23:53:52+00:00

I was given 30 minutes to complete the following task in an interview for

  • 0

I was given 30 minutes to complete the following task in an interview for an entry level C# developer role, the closest I could get to was to find out if the characters in both sides of the current index matched each other.

Construct an array which takes in an string and determines if at index
(i) the substring to

the left of (i) when reversed, equals to the substring to the right of
(i).

example: “racecar”

at index(3) the left substring is “rac” and when reversed equals to
the right substring “car”.

return (i) if met with such condition, eslse return -1.
if string length is under 3, return 0;

  if (str.Length < 3)
            return -1;

        for (int i = 0; i < str.Length - 1; i++)
        {
            if(str[i-1] == str [i+1])
               return i;
        }
                return -1;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T23:53:53+00:00Added an answer on June 2, 2026 at 11:53 pm
     public static int check(string str)
        {
            if(str.Length < 3)
                return 0;
    
            int n = str.Length;
            int right = str.Length-1;
            int left = 0;
    
            while (left < right)
            {
                if (str[left] != str[right])
                    return -1;
    
                left++;
                right--;
            }
            return n / 2;
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say it took someone 3 minutes and 45 seconds to complete a task. I'd
Find the time after 15 minutes of given time in javascript Example : given
Given the following example: seconds = totalTime % 60 minutes = (totalTime - seconds)
First off, I've been given a very tight deadline (read: measured in minutes) to
Given a package, how can I automatically find all its sub-packages?
Edit: See Calculate how many minutes used in a given hour for how I
I have a PHP script that takes about 10 minutes to complete. I want
I have a script that requires ~5 minutes to execute and complete. Everything takes
Given the following timestring: $str = '2000-11-29'; $php_date = getdate( $str ); echo '<pre>';
Given this markup: // Calendar.html?date=1/2/2003 <script> $(function() { $('.inlinedatepicker').datepicker(); }); </script> ... <div class=inlinedatepicker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.