Wissen Technology interview questions & answers

11 real Wissen Technology interview questions with full model answers — Coding. Drawn from the same verified bank ChannelPulse drills from (11 Wissen Technology questions in total).

CodingEasyWissen TechnologySoftware Engineer

1. Remove Duplicates from Sorted Array (LeetCode)

Model answer

The task

Given a sorted list of integers, modify it in place so each distinct value appears once in the front. Return the length of that unique prefix.

Key idea

Because the values are sorted, duplicates are adjacent. Keep a read pointer to scan the list and a write pointer for the next position where a new value belongs.

Approach

  1. If the list is empty, return 0.
  2. Start the write pointer at 1, since the first value is already unique.
  3. Scan from left to right.
  4. When the current value differs from the last value written, copy it to the write position and advance the pointer.
  5. Return the write pointer as the unique-prefix length.
from typing import List

class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        if not nums:
            return 0

        write = 1

        # Copy each newly encountered value into the unique prefix.
        for read in range(1, len(nums)):
            if nums[read] != nums[write - 1]:
                nums[write] = nums[read]
                write += 1

        return write

Complexity:

  • Time: O(n), where n is the length of the list.
  • Space: O(1), since the list is modified in place using only a fixed number of variables.

Common follow-ups

  • What if the list is not sorted? Use a set to track seen values while compacting unique values in their original order.
  • What if each value may appear at most twice? Write a value when fewer than two values have been written, or when it differs from the value two positions back.
  • What if the list is very large and cannot fit in memory? Process sorted chunks while carrying the last value across chunk boundaries.
CodingMediumWissen TechnologySoftware Engineer

2. Spiral Matrix (LeetCode)

Model answer

The task

Return the matrix values in clockwise spiral order, starting from the top-left corner and moving inward.

Key idea

Track the unvisited rectangle with four boundaries. Visit its top, right, bottom, and left edges in turn, then shrink the rectangle and repeat.

Approach

  1. Return an empty list if the matrix has no rows or columns.
  2. Initialize boundaries for the top, bottom, left, and right edges.
  3. Traverse the top edge, then move the top boundary inward.
  4. Traverse the right edge, then move the right boundary inward.
  5. If rows remain, traverse the bottom edge in reverse; if columns remain, traverse the left edge upward.
  6. Repeat until the boundaries cross.
from typing import List

class Solution:
    def spiralOrder(self, matrix: List[List[int]]) -> List[int]:
        if not matrix or not matrix[0]:
            return []

        result = []
        top, bottom = 0, len(matrix) - 1
        left, right = 0, len(matrix[0]) - 1

        while top <= bottom and left <= right:
            # Traverse the top edge from left to right.
            for col in range(left, right + 1):
                result.append(matrix[top][col])
            top += 1

            # Traverse the right edge from top to bottom.
            for row in range(top, bottom + 1):
                result.append(matrix[row][right])
            right -= 1

            # Traverse the bottom edge only if it has not been visited.
            if top <= bottom:
                for col in range(right, left - 1, -1):
                    result.append(matrix[bottom][col])
                bottom -= 1

            # Traverse the left edge only if it has not been visited.
            if left <= right:
                for row in range(bottom, top - 1, -1):
                    result.append(matrix[row][left])
                left += 1

        return result

Complexity: Time: O(m × n), where each cell is visited once.

Complexity: Space: O(1) auxiliary space, excluding the output list.

Common follow-ups

  • How would you return the values counterclockwise? Change the traversal order and edge directions while maintaining the same boundary updates.
  • How does this handle a single row or column? The boundary checks prevent an edge from being visited twice.
  • Can the traversal be done without boundary variables? Yes, by marking visited cells and turning when blocked, but that requires O(m × n) extra space.
CodingMediumWissen TechnologySoftware Engineer

3. 3Sum (LeetCode)

Model answer

The task

Given an integer array, return every distinct triplet of values whose sum is zero. Triplets are considered the same if they contain the same values, regardless of order.

Key idea

Sort the array, then fix each value in turn and use two pointers to find pairs that complete its sum to zero. Skipping repeated values prevents duplicate triplets.

Approach

  1. Sort the input array.
  2. For each index, treat its value as the first element of a triplet.
  3. Skip the index if its value is the same as the previous value.
  4. Set two pointers immediately after the fixed index and at the end of the array.
  5. Move a pointer according to whether the current sum is too small or too large.
  6. When a triplet is found, record it and advance past duplicate pointer values.
from typing import List

class Solution:
    def threeSum(self, nums: List[int]) -> List[List[int]]:
        nums.sort()
        triplets = []
        n = len(nums)

        for i in range(n - 2):
            # Only use the first occurrence of each fixed value.
            if i > 0 and nums[i] == nums[i - 1]:
                continue

            left, right = i + 1, n - 1

            while left < right:
                total = nums[i] + nums[left] + nums[right]

                if total < 0:
                    left += 1
                elif total > 0:
                    right -= 1
                else:
                    triplets.append([nums[i], nums[left], nums[right]])
                    left += 1
                    right -= 1

                    # Avoid repeating the same pair for this fixed value.
                    while left < right and nums[left] == nums[left - 1]:
                        left += 1
                    while left < right and nums[right] == nums[right + 1]:
                        right -= 1

        return triplets

Complexity:

  • Time: O(n²), from fixing each value and scanning with two pointers.
  • Space: O(n) for Python's in-place sort; excludes the returned triplets.

Common follow-ups

  • How would you return unique index triplets instead of value triplets? Track original indices while sorting, then return the corresponding index triples.
  • What if the target sum is a variable? Replace the zero-sum check with a comparison against the target.
  • Can the approach be extended to four values? Fix two values and use two pointers for the remaining pair, giving O(n³) time.
CodingMediumWissen TechnologySoftware Engineer

4. Valid Sudoku (LeetCode)

Model answer

The task

Given a partially filled 9×9 Sudoku board, determine whether its filled cells obey the rules: no digit appears more than once in any row, column, or 3×3 box. Empty cells do not affect validity.

Key idea

Track the digits already seen in each row, column, and box. When a filled cell repeats a digit in any of its three groups, the board is invalid.

Approach

  1. Create a set for each row, column, and 3×3 box.
  2. Visit each cell in the board.
  3. Skip empty cells.
  4. Compute the box index from the cell’s row and column.
  5. Return False if the digit is already in any corresponding set; otherwise add it to all three.
  6. If every cell passes, return True.
from typing import List

class Solution:
    def isValidSudoku(self, board: List[List[str]]) -> bool:
        rows = [set() for _ in range(9)]
        cols = [set() for _ in range(9)]
        boxes = [set() for _ in range(9)]

        for r in range(9):
            for c in range(9):
                digit = board[r][c]
                if digit == ".":
                    continue

                # Each 3×3 box has an index from 0 through 8.
                box = (r // 3) * 3 + (c // 3)

                if (
                    digit in rows[r]
                    or digit in cols[c]
                    or digit in boxes[box]
                ):
                    return False

                rows[r].add(digit)
                cols[c].add(digit)
                boxes[box].add(digit)

        return True

Complexity:

  • Time: O(1) for a fixed 9×9 board; more generally, O(n²) for an n×n board.
  • Space: O(1) for a fixed board; more generally, O(n²) for the stored digits.

Common follow-ups

  • How would you handle boards of arbitrary valid Sudoku size? Derive the box dimensions and index formula from the board size.
  • Could you reduce set overhead? Use bit masks to track which digits have appeared in each group.
  • Does a valid board need to be solvable? No; this check only verifies that no current row, column, or box contains duplicates.
CodingMediumWissen TechnologySoftware Engineer

5. Search a 2D Matrix (LeetCode)

Model answer

The task

Determine whether a target value appears in a matrix whose rows are sorted, with each row’s values ordered after the preceding row’s values.

Key idea

The matrix can be treated as one sorted, row-major sequence. Binary search that virtual sequence, converting each midpoint back to its row and column.

Approach

  1. Return False if the matrix has no rows or columns.
  2. Set the binary-search range to indices from 0 through rows * cols - 1.
  3. Convert each midpoint to (row, col) using division and remainder by the column count.
  4. Compare the corresponding matrix value with the target and narrow the range.
  5. Return False if the search range becomes empty.
class Solution:
    def searchMatrix(self, matrix: list[list[int]], target: int) -> bool:
        if not matrix or not matrix[0]:
            return False

        rows = len(matrix)
        cols = len(matrix[0])
        left, right = 0, rows * cols - 1

        while left <= right:
            mid = (left + right) // 2

            # Map the virtual 1D index to its matrix coordinates.
            row, col = divmod(mid, cols)
            value = matrix[row][col]

            if value == target:
                return True
            if value < target:
                left = mid + 1
            else:
                right = mid - 1

        return False

Complexity:

  • Time: O(log(m × n)), where m × n is the number of matrix elements.
  • Space: O(1), using only a fixed number of variables.

Common follow-ups

  • What if each row is sorted, but rows are not ordered relative to one another? Binary-search each row, taking O(m log n) time.
  • What if rows and columns are each sorted, but the matrix is not globally ordered row by row? Start at a corner and eliminate a row or column at each step, taking O(m + n) time.
  • How do duplicates affect the search? They do not affect correctness; the search can return upon finding any matching occurrence.
CodingMediumWissen TechnologySoftware Engineer

6. Sort Characters By Frequency (LeetCode)

Model answer

The task

Rearrange a string’s characters so characters that occur more often appear earlier. Characters with equal frequencies may appear in either order.

Key idea

Count each character, then group characters by their frequency. Visit frequency groups from highest to lowest and append each character the number of times it occurs.

Approach

  1. Count the occurrences of every character.
  2. Create buckets indexed by frequency.
  3. Put each character into the bucket matching its count.
  4. Traverse buckets from largest frequency to smallest.
  5. Build and return the rearranged string.
from collections import Counter

class Solution:
    def frequencySort(self, s: str) -> str:
        counts = Counter(s)

        # Bucket i contains the characters that occur i times.
        buckets = [[] for _ in range(len(s) + 1)]
        for char, count in counts.items():
            buckets[count].append(char)

        # Append each character the number of times it occurs,
        # starting with the highest frequency.
        parts = []
        for count in range(len(s), 0, -1):
            for char in buckets[count]:
                parts.append(char * count)

        return "".join(parts)

Complexity:

  • Time: O(n), where n is the string length; counting, bucketing, and assembling process O(n) characters.
  • Space: O(n), for the buckets and the resulting string.

Common follow-ups

  • How would you handle ties deterministically? Sort characters within each frequency bucket, adding O(k log k) work in the worst case for k distinct characters.
  • Can you solve it with a heap? Push each distinct character with its frequency, then pop in descending frequency order; this takes O(n + k log k).
  • What if the input is a stream? Maintain counts as characters arrive, then bucket or heap-order the counts once processing is complete.
CodingMediumWissen TechnologySoftware Engineer

7. Longest Consecutive Sequence (LeetCode)

Model answer

The task

Given an integer array, return the length of its longest run of consecutive values, regardless of their order in the array.

Key idea

Put the values in a set for fast membership checks. Only start counting from a value whose predecessor is absent, so each consecutive run is scanned once.

Approach

  1. Convert the array to a set, removing duplicates.
  2. For each distinct value, check whether its predecessor is in the set.
  3. If not, count upward while consecutive values remain present.
  4. Track and return the longest count.
from typing import List

class Solution:
    def longestConsecutive(self, nums: List[int]) -> int:
        values = set(nums)
        longest = 0

        for value in values:
            # Only begin counting at the start of a consecutive run.
            if value - 1 not in values:
                current = value
                length = 1

                while current + 1 in values:
                    current += 1
                    length += 1

                longest = max(longest, length)

        return longest

Complexity:

  • Time: O(n) on average; each distinct value is checked a constant number of times.
  • Space: O(n) for the set of distinct values.

Common follow-ups

  • How should an empty array be handled? The implementation returns 0.
  • What if the input contains duplicates? The set removes them without affecting the run length.
  • Can this be solved with sorting? Yes; sort the values and scan adjacent differences, taking O(n log n) time.
  • How could Union-Find be used? Treat each value as a node, union neighboring values that exist, then find the largest component.
CodingMediumWissen TechnologySoftware Engineer

8. Remove Duplicates from Sorted Array II (LeetCode)

Model answer

The task

Given a sorted array, modify it in place so each value appears at most twice. Return the length of the retained prefix; values beyond that prefix do not matter.

Key idea

Because the array is sorted, duplicates are adjacent. Keep a value only if fewer than two values have already been written, or if it differs from the value two positions behind the write pointer.

Approach

  1. Use write to track the next position in the retained prefix.
  2. Scan each value from left to right.
  3. Accept it when write < 2 or it differs from nums[write - 2].
  4. Write accepted values at nums[write] and advance write.
  5. Return write.
from typing import List

class Solution:
    def removeDuplicates(self, nums: List[int]) -> int:
        # The first two values can always be kept.
        write = 0

        for value in nums:
            # Keep the value only if it would not make three equal
            # values consecutive in the retained, sorted prefix.
            if write < 2 or value != nums[write - 2]:
                nums[write] = value
                write += 1

        return write

Complexity:

  • Time: O(n), where n is the array length; each value is examined once.
  • Space: O(1), since the array is updated in place.

Common follow-ups

  • Allow each value at most m times: Compare with nums[write - m], accepting unconditionally while write < m.
  • What if the input is not sorted? This adjacent-value check no longer works; use a frequency map if extra space is allowed.
  • Can the same approach remove all duplicates? Yes. Keep a value only when it differs from the last retained value.
CodingMediumWissen TechnologySoftware Engineer

9. Group Anagrams (LeetCode)

Model answer

The task

Partition the input strings into groups so that strings in the same group contain the same characters with the same frequencies. The order of the groups does not matter.

Key idea

Sort the characters of each string to create a canonical key. Anagrams produce the same key, so a hash table can collect them together.

Approach

  1. Create a mapping from canonical keys to lists of original strings.
  2. For each string, sort its characters and use the result as its key.
  3. Append the string to the list for that key.
  4. Return all grouped lists.
from collections import defaultdict
from typing import List

class Solution:
    def groupAnagrams(self, strs: List[str]) -> List[List[str]]:
        groups = defaultdict(list)

        for word in strs:
            # Anagrams have identical sorted-character representations.
            key = "".join(sorted(word))
            groups[key].append(word)

        return list(groups.values())

Complexity:

  • Time: O(n · k log k), where n is the number of strings and k is the maximum string length.
  • Space: O(n · k) to store the grouped strings and their keys.

Common follow-ups

  • Can this be faster for a fixed alphabet? Use a character-frequency tuple as the key, computing it in O(k) per string.
  • Does this work with uppercase letters or Unicode? Yes; sorting characters works for any Python strings.
  • Can groups be returned in a deterministic order? Sort the groups, or their keys, before returning them.
  • What if memory is limited? Consider processing input in batches or grouping externally by canonical key.
CodingMediumWissen TechnologySoftware Engineer

10. Longest Substring Without Repeating Characters (LeetCode)

Model answer

The task

Find the length of the longest contiguous section of a string in which every character appears at most once.

Key idea

Maintain a sliding window with no repeated characters. When a character repeats within the window, move the left edge just past its previous occurrence.

Approach

  1. Track each character’s most recent index in a dictionary.
  2. Keep left as the window’s starting index and best as its longest length so far.
  3. For each character, move left forward if its previous occurrence is inside the current window.
  4. Record the character’s current index and update best using the window length.
class Solution:
    def lengthOfLongestSubstring(self, s: str) -> int:
        last_seen = {}
        left = 0
        best = 0

        for right, char in enumerate(s):
            # Skip past a repeated character if it is in the current window.
            if char in last_seen and last_seen[char] >= left:
                left = last_seen[char] + 1

            last_seen[char] = right
            best = max(best, right - left + 1)

        return best

Complexity:

  • Time: O(n), because each character is processed once.
  • Space: O(k), where k is the number of distinct characters encountered.

Common follow-ups

  • Return the substring itself: store the best window’s start and end indices when updating best.
  • Handle a stream of characters: keep the same window state and process each arriving character incrementally.
  • Use a fixed-size character set: replace the dictionary with an array of last-seen indices.
CodingHardWissen TechnologySoftware Engineer

11. Minimum Window Substring (LeetCode)

Model answer

The task

Given strings s and t, return the shortest contiguous substring of s that contains every character in t, including repeated characters. Return an empty string if no such substring exists.

Key idea

Use a sliding window and character counts. Expand the right edge until the window contains all required character frequencies, then move the left edge rightward as far as possible while keeping the window valid.

Approach

  1. Count the required characters in t.
  2. Move the right edge across s, updating counts for relevant characters.
  3. Track how many distinct required characters have reached their needed frequencies.
  4. Whenever all are satisfied, record the window if it is shorter than the best found.
  5. Shrink from the left until the window is no longer valid, then continue expanding.
from collections import Counter, defaultdict

class Solution:
    def minWindow(self, s: str, t: str) -> str:
        if not s or not t:
            return ""

        need = Counter(t)
        window = defaultdict(int)
        required = len(need)
        formed = 0

        best_start = 0
        best_length = float("inf")
        left = 0

        for right, char in enumerate(s):
            if char in need:
                window[char] += 1
                if window[char] == need[char]:
                    formed += 1

            # Shrink while all required character counts are satisfied.
            while formed == required:
                length = right - left + 1
                if length < best_length:
                    best_start = left
                    best_length = length

                left_char = s[left]
                if left_char in need:
                    if window[left_char] == need[left_char]:
                        formed -= 1
                    window[left_char] -= 1
                left += 1

        if best_length == float("inf"):
            return ""
        return s[best_start:best_start + best_length]

Complexity:

  • Time: O(|s| + |t|), since each pointer advances at most the length of s.
  • Space: O(d), where d is the number of distinct characters in t.

Common follow-ups

  • What if t is empty? Return an empty string immediately, as handled above.
  • Can you return all shortest windows? Keep each window matching the minimum length instead of only one.
  • How does this scale to a stream? Maintain counts and window positions, while accounting for the storage needed to retain candidate characters.

Practice these out loud, don't memorise them

Reading an answer is not the same as being able to give one under pressure. ChannelPulse plays the interviewer, asks the follow-ups, and scores each answer with feedback and a model answer so you can hear the gap between what you said and what lands.

Get ChannelPulse Browse all questions