Mark As Completed Discussion

Good morning! Here's our prompt for today.

Hey there, welcome to the challenges portion of the AlgoDaily technical interview course! Over the next few days, you'll get some hands-on experience with the essential data structures and algorithms that will help you nail your interview, and land your dream software engineering job.

The only way to get better at solving these problems is to power through a few.

We covered the best ways to prepare in this lesson, in this one, and here. Be sure to visit those if you need some more guidance. Otherwise, let's jump into it.

Reverse a String

Let's reverse a string!

Description

We'll usually start with a simple prompt, as you would in a regular technical interview. Like most, this one will be intentionally open-ended.

Prompt

Can you write a function that reverses an inputted string without using the built-in Array#reverse method?

Let's look at some examples. So, calling:

reverseString("jake") should return "ekaj".

reverseString("reverseastring") should return "gnirtsaesrever".

Description

Constraints

  • Do not use the built-in #reverse() method or [::-1] if Python
  • Ideal solution would run in O(n) time complexity and O(1) space complexity

Try to solve this here or in Interactive Mode.

How do I practice this challenge?

JAVASCRIPT
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment

Tired of reading? Watch this video explanation!

To change the speed of the video or see it in full screen, click the icons to the right of the progress bar.

Here's how we would solve this problem...

How do I use this guide?