DEV Community

net programhelp
net programhelp

Posted on

what is an oa interview -unequal elements snowflake oa

An OA interview stands for Online Assessment interview. It’s usually the first technical step in the hiring process for internships or entry-level roles at companies like Snowflake, TikTok, Google, etc.


🔍 What is an OA (Online Assessment) Interview?

An OA is a timed, remote coding test you take before interviews. It’s designed to screen candidates efficiently.

  • Delivered through platforms like Codility, HackerRank, Karat, or CodeSignal.
  • Timed (usually 60–90 minutes).
  • May include 1–3 coding problems, and sometimes MCQs on CS fundamentals.
  • Often automatically graded based on correctness and performance.

Snowflake OA — “Unequal Elements” Problem

While this isn’t an official published problem, “Unequal Elements” is a known Snowflake OA coding challenge that has appeared in past intern or new grad assessments.

Problem Summary (Reconstructed from memory by candidates)

Given an array of integers, determine the minimum number of elements to remove so that no two remaining elements are equal (i.e., all elements are unique).

Example:

Input: [1, 2, 2, 3, 3, 3]
Output: 3
Explanation: Remove one 2 and two 3s to make the array [1,2,3] — all elements are unique.
Enter fullscreen mode Exit fullscreen mode

Solution Approach

  1. Count the frequency of each element.
  2. For each element with a frequency > 1, you need to remove (freq - 1) duplicates.
  3. Sum up all the duplicates to be removed.

Python Code:

from collections import Counter

def min_removals_to_make_unique(arr):
    freq = Counter(arr)
    removals = 0
    for count in freq.values():
        if count > 1:
            removals += count - 1
    return removals

# Example
print(min_removals_to_make_unique([1, 2, 2, 3, 3, 3]))  # Output: 3
Enter fullscreen mode Exit fullscreen mode

🛠️ How to Prepare for OA Challenges

  1. Practice on LeetCode – Focus on:
  • Hashing problems
  • Arrays and frequency counts
  • Greedy strategies
    1. Do mock tests on Codility / HackerRank
    2. Understand problem patterns — like making arrays distinct, sorting with constraints, subarrays, etc.

Let me know if you'd like a mock Snowflake OA with similar problems or if you want to practice with time limits.

Top comments (0)