Array & Sorting

Asked atCiena
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
  1. 01Clarify whether input mutation and output order are allowed.
  2. 02Decide whether sorting exposes a local adjacency property.
  3. 03Choose a comparator and preserve original indices if necessary.
  4. 04Scan sorted neighbors or use two pointers.
  5. 05State sorting and post-processing costs.

Reference answer

Then expect these follow-ups

  • When does counting sort beat comparison sorting?

    Tests: follow-up reasoning

  • How do you make an interval merge stable?

    Tests: follow-up reasoning

Hiring now

Ciena has 130 open roles right now

landed applies to roles like these for you, on each company’s own site, with answers written for the role.

Get 5x interviews10 free auto-applies. No card.
  • Analyst, Treasury Operations

    Gurugram

  • Executive Assistant – Thailand

    Pathum Tani

  • Commercial Management, Japan

    Tokyo

Or practice this question first

Next question