Coding & Algorithms (DSA)

Arrays & Strings

6 practice questions. Free questions open a full answer guide; the rest unlock with Pro.

  • You need to build one long string by appending pieces inside a loop. Why can the naive approach get slow, and how do you fix it? Junior level
  • How would you check whether two strings are anagrams of each other, and what are the trade-offs between the approaches you'd consider?Go Pro Junior level
  • When you process an array in place versus allocating a new array for the result, what are you trading off, and how does string immutability change that calculus?Go Pro Mid level
  • A teammate's string-processing function passes all unit tests but slows down badly on large inputs. They build the result by repeatedly concatenating with `+=` in a loop. Walk me through what's wrong and how you'd guide the fix.Go Pro Senior level
  • When you're processing a large array and need to detect duplicates or pairs, when would you reach for an in-place / sorted approach over building a hash set, and what trade-off are you making?Go Pro Senior level
  • What is a prefix-sum array, and how does it let you answer many range-sum queries faster than recomputing each one?Go Pro Mid level
Want questions matched to your role? Paste a job title, job description, or CV for a personalized set, or go Pro to unlock the full bank.