โ† Paytm questions

Sorting Algorithm Coding Problem

Filed under Paytm

Free read 1 of 3

Start with Bubble or Selection sort to demonstrate basic understanding.

The question

Given an unsorted array, implement an efficient sorting algorithm and optimize it for performance.

Constraints

  • Must handle large datasets.
  • Consider space complexity trade-offs.
  • Must be implemented from scratch.

Examples

Input
[5, 2, 9, 1]
Output
[1, 2, 5, 9]
Why
Standard ascending sort.

Approach

  1. Start with Bubble or Selection sort to demonstrate basic understanding.

Tips

  • What they are testing: Test with already sorted, reverse sorted, and arrays with many duplicates.
  • Common mistake: Choosing an O(n^2) algorithm like Bubble Sort when O(n log n) is expected.

Related Paytm questions

Collected from public candidate posts and coding forums. Updated Nov 2026.