Axis Bank OA 2025 - Alternate Deletion Problem

axis bank logo
axis bank
Ongoing
November 27, 202520 reads

Summary

This post details a challenging string manipulation problem, known as the 'Alternate Deletion Problem,' encountered during an Axis Bank Online Assessment in 2025.

Full Experience

During my Online Assessment for Axis Bank in 2025, I was presented with a challenging string manipulation problem. The task involved repeatedly applying forward and backward alternate character deletions on a string formed by concatenating an initial string multiple times, with the ultimate goal of identifying the very last character removed.

Interview Questions (1)

Q1
Alternate Deletion Problem
Data Structures & AlgorithmsHard

You are given a string S, and an integer k ≥ 1.

First, form a new string T by concatenating the string S to itself k times.

You then repeatedly perform the following two operations alternatingly, until the string becomes empty:

  • Operation 1 — Forward Elimination: Starting from the first character, delete every alternate character.
  • Operation 2 — Backward Elimination: Starting from the last character, delete every alternate character

These two operations are applied repeatedly in the order: Op1,  Op2,  Op1,  Op2, .......until all characters of T have been deleted.

Goal

Return the last character that gets deleted from the string during this entire elimination process.

Input Format

  • A string S consisting of lowercase or uppercase letters.
  • An integer k (1 ≤ k ≤ 10⁹ in optimized versions, or ≤ 10⁵ for direct-simulation versions).

Output Format

A single character: the last deleted character.

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!