PracHub
QuestionsPremiumLearningGuidesInterview PrepCoaches
|Home/Coding & Algorithms/Citadel

Implement two-pointer unique-pair sum search

Last updated: Mar 29, 2026

Quick Overview

This question evaluates proficiency with the two-pointer technique, sorted-array duplicate handling, in-place space constraints, and stream-processing considerations within the Coding & Algorithms domain for data scientist roles.

  • Medium
  • Citadel
  • Coding & Algorithms
  • Data Scientist

Implement two-pointer unique-pair sum search

Company: Citadel

Role: Data Scientist

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Technical Screen

Given a nondecreasing integer array nums and an integer target, return all unique value pairs [a, b] with a <= b such that a + b == target. Use the two-pointer technique to achieve O(n) time and O( 1) extra space beyond the output, and ensure duplicates in nums do not produce duplicate pairs. Additionally: a) Describe how you would return indices instead of values and any implications for stability. b) Explain how you would adapt the method if nums arrives as a stream that cannot be fully stored in memory. c) Analyze time and space complexity.

Quick Answer: This question evaluates proficiency with the two-pointer technique, sorted-array duplicate handling, in-place space constraints, and stream-processing considerations within the Coding & Algorithms domain for data scientist roles.

Related Interview Questions

  • Implement a single-producer multi-consumer ring buffer - Citadel (medium)
  • Sort a Nearly Sorted Array - Citadel (hard)
  • Compute BBO and NBBO from order data - Citadel (medium)
  • Design dynamic weighted random sampling with updates - Citadel (medium)
  • Compute maximum later-earlier difference - Citadel (medium)
Citadel logo
Citadel
Jul 27, 2025, 12:00 AM
Data Scientist
Technical Screen
Coding & Algorithms
4
0

Given a nondecreasing integer array nums and an integer target, return all unique value pairs [a, b] with a <= b such that a + b == target. Use the two-pointer technique to achieve O(n) time and O(

  1. extra space beyond the output, and ensure duplicates in nums do not produce duplicate pairs. Additionally: a) Describe how you would return indices instead of values and any implications for stability. b) Explain how you would adapt the method if nums arrives as a stream that cannot be fully stored in memory. c) Analyze time and space complexity.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More Citadel•More Data Scientist•Citadel Data Scientist•Citadel Coding & Algorithms•Data Scientist Coding & Algorithms
PracHub

Master your tech interviews with 7,500+ real questions from top companies.

Product

  • Questions
  • Learning Tracks
  • Interview Guides
  • Resources
  • Premium
  • For Universities
  • Student Access

Browse

  • By Company
  • By Role
  • By Category
  • Topic Hubs
  • SQL Questions
  • Compare Platforms
  • Discord Community

Support

  • support@prachub.com
  • (916) 541-4762

Legal

  • Privacy Policy
  • Terms of Service
  • About Us

© 2026 PracHub. All rights reserved.