PracHub
QuestionsPremiumLearningGuidesCheatsheetNEWCoaches
|Home/Coding & Algorithms/DRW

Solve three algorithmic OA tasks

Last updated: Mar 29, 2026

Quick Overview

This set of three algorithmic tasks evaluates proficiency in algorithm design and problem-solving across string construction with parity constraints, digit-string numerical manipulation under swap operations, and two-choice assignment reflecting matching/graph constraints.

  • Medium
  • DRW
  • Coding & Algorithms
  • Software Engineer

Solve three algorithmic OA tasks

Company: DRW

Role: Software Engineer

Category: Coding & Algorithms

Difficulty: Medium

Interview Round: Take-home Project

Task 1 (Odd-frequency string): Given an integer N in [1..200000], write an algorithm that returns any length-N string of lowercase letters (a–z) such that every letter that appears occurs an odd number of times. Task 2 (Min-difference with minimal swaps): Given two equal-length digit strings S and T (length N up to 100000, digits only, no leading zeros), you may choose a subset of indices and swap S[i] with T[i] at each chosen index. Among all swap choices that minimize |int(S) − int(T)|, return the minimum number of swaps required. For example, S = "29162" and T = "10524" should return 2. Task 3 (Two-choice slot assignment): Given arrays A and B of length N (1 ≤ A[k], B[k] ≤ S, A[k] ≠ B[k]) and an integer S (2.. 100000), determine whether it is possible to assign every patient k to either A[k] or B[k] so that at most one patient is assigned to each slot. Return true if such an assignment exists, otherwise false.

Quick Answer: This set of three algorithmic tasks evaluates proficiency in algorithm design and problem-solving across string construction with parity constraints, digit-string numerical manipulation under swap operations, and two-choice assignment reflecting matching/graph constraints.

Related Interview Questions

  • Solve three algorithmic OA problems - DRW (medium)
  • Compute rolling standard deviation in O(n) - DRW (Medium)
  • Solve odd-string, digit swap, patient slot assignment - DRW (Medium)
  • Solve movie ratings, array, release scheduler - DRW (Medium)
  • Implement portfolio optimization simulation - DRW (Medium)
DRW logo
DRW
Jul 31, 2025, 12:00 AM
Software Engineer
Take-home Project
Coding & Algorithms
4
0

Task 1 (Odd-frequency string): Given an integer N in [1..200000], write an algorithm that returns any length-N string of lowercase letters (a–z) such that every letter that appears occurs an odd number of times.

Task 2 (Min-difference with minimal swaps): Given two equal-length digit strings S and T (length N up to 100000, digits only, no leading zeros), you may choose a subset of indices and swap S[i] with T[i] at each chosen index. Among all swap choices that minimize |int(S) − int(T)|, return the minimum number of swaps required. For example, S = "29162" and T = "10524" should return 2.

Task 3 (Two-choice slot assignment): Given arrays A and B of length N (1 ≤ A[k], B[k] ≤ S, A[k] ≠ B[k]) and an integer S (2.. 100000), determine whether it is possible to assign every patient k to either A[k] or B[k] so that at most one patient is assigned to each slot. Return true if such an assignment exists, otherwise false.

Comments (0)

Sign in to leave a comment

Loading comments...

Browse More Questions

More Coding & Algorithms•More DRW•More Software Engineer•DRW Software Engineer•DRW Coding & Algorithms•Software Engineer 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.