← Samsung Interview Insights

Samsung·QA / Test Engineer·Onsite - Coding / Algorithms·Intermediate

IntermediateRejected
Aug 2026

Summary

Samsung SDET interview, three coding problems, couldn't crack any of them. Rejected.

Questions Asked (3)

Q1

Given an array of non-negative integers and an integer k, split the array into k non-empty subarrays such that the largest subarray sum is minimized. Return that minimized largest sum.

Algorithms & Data Structures
Author's notes

Binary search on the answer is the move here but my brain just went blank.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Recognize this as a classic 'minimize the maximum' problem that can be solved efficiently using binary search on the answer combined with a greedy feasibility check. Explain that the search space is between the maximum element (lower bound) and the total sum (upper bound), and for each candidate maximum sum, check if the array can be split into at most k subarrays without exceeding that sum.

Pro tip: Emphasize that the greedy check is optimal for a fixed maximum sum because taking the longest possible subarray without exceeding the limit minimizes the number of subarrays needed. Also, mention that if the number of subarrays is less than k, you can always split further without increasing the maximum sum, so the condition is 'at most k'.

1. Clarify the problem and constraints

Restate the problem to ensure understanding: split array into exactly k non-empty contiguous subarrays, minimize the largest sum. Ask about edge cases like k=1, k=n, or when elements are zero.

2. Identify the algorithmic pattern

Recognize this as a binary search on the answer problem. The monotonic property: if a maximum sum S is feasible, any larger sum is also feasible.

3. Define the feasibility check

Write a greedy function that, given a candidate maximum sum, iterates through the array and counts how many subarrays are needed. If the count exceeds k, the candidate is infeasible.

4. Implement binary search

Set low = max(array) and high = sum(array). While low < high, compute mid, check feasibility, and adjust bounds accordingly. Return low as the minimized largest sum.

5. Analyze complexity and test

State time complexity O(n log(sum - max)) and space O(1). Walk through a small example to verify correctness and discuss potential off-by-one errors.

Key Points to Mention

  • Binary search on the answer with a greedy feasibility check.
  • Lower bound is the maximum element, upper bound is the total sum.
  • Greedy check: accumulate sum until adding next element would exceed the candidate, then start a new subarray.
  • Feasibility condition: number of subarrays needed ≤ k (since extra splits don't increase the maximum).
  • Time complexity: O(n log(S)) where S is the sum range, space O(1).
  • Edge cases: k=1 (return total sum), k=n (return max element), zeros in array.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q2

Given a hand of cards where each card has exactly two letters, determine the winner of a two-letter card game based on the game's rules.

Algorithms & Data Structures
Author's notes

Didn't even get to think about this one clearly.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

First, clarify the game rules and win conditions, as the problem statement is ambiguous. Then, outline a systematic algorithm to determine the winner, focusing on edge cases and testability. Finally, discuss how you would test the solution to ensure correctness.

Pro tip: Demonstrate a QA mindset by proactively identifying ambiguities and proposing test cases before diving into the algorithm. This shows you think like a test engineer, not just a developer.

1. Clarify the Rules

Ask questions to understand the game: What are the winning conditions? How are hands compared? Are there ties? This ensures you solve the correct problem.

2. Define Data Structures

Represent each card as a pair of letters (e.g., a tuple or string). Represent a hand as a list of such cards.

3. Design the Algorithm

Outline steps to evaluate each hand according to the rules, compare hands, and determine the winner. Consider sorting, counting, or pattern matching as needed.

4. Identify Edge Cases

List potential edge cases: empty hands, duplicate cards, invalid inputs, ties, and maximum hand sizes. Explain how your algorithm handles them.

5. Plan Test Cases

Propose specific test cases to validate the solution, including normal cases, edge cases, and performance tests if applicable.

Key Points to Mention

  • Ambiguity in problem statement and importance of clarifying requirements
  • Choice of data structures for cards and hands
  • Algorithmic approach (e.g., sorting, hashing, or rule-based evaluation)
  • Edge cases and error handling
  • Test-driven development and comprehensive test coverage
  • Time and space complexity considerations

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.

Q3

Given a sorted list of words in an alien language, derive the order of the alphabet used in that language and return it as a string.

Algorithms & Data Structures
Author's notes

This is a classic topological sort problem and I actually knew that going in.

Create a free account to read the full note

AI HintsAI Generated

Suggested Approach

Model the problem as a directed graph where each letter is a node and edges represent the relative order derived from adjacent word pairs. Then perform a topological sort to produce a valid alphabet order, while handling edge cases like invalid input or cycles.

Pro tip: As a QA engineer, emphasize test cases for edge conditions such as cycles, conflicting orders, and prefix violations, and mention that you would validate the derived order against the original list.

1. Build the graph

Iterate through adjacent word pairs and compare characters to find the first differing character, adding a directed edge from the first to the second. If one word is a prefix of the other and the longer word comes first, the input is invalid.

2. Compute in-degrees

Initialize in-degree counts for all unique characters and increment the in-degree of the destination node for each edge.

3. Topological sort

Use Kahn's algorithm (BFS with a queue) or DFS to produce a linear ordering of characters. If the result does not include all unique characters, a cycle exists and no valid order is possible.

4. Validate and return

Check that the derived order is consistent with the original list by verifying that each adjacent pair is correctly ordered. Return the order as a string.

Key Points to Mention

  • Graph representation: nodes are unique characters, edges represent relative order from adjacent words.
  • Topological sorting algorithms: Kahn's algorithm (BFS) or DFS-based approach.
  • Cycle detection: if the topological sort doesn't include all nodes, the input is invalid.
  • Edge cases: empty list, single word, duplicate words, prefix conflicts (e.g., 'abc' before 'ab').
  • Time and space complexity: O(N * L) where N is number of words and L is max word length, plus O(V+E) for topological sort.
  • Validation: after deriving the order, verify it against the original list to ensure correctness.

AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.