Recent OA questions for SDE intern + PPO 32LPA CTC
Anonymous User
262
Apr 23, 2026
Apr 23, 2026

Q1: Distinct primes in ranges

You are given an array of ranges int[][] ranges where each range is [l, r] (inclusive).

Find how many distinct prime numbers appear in at least one of these ranges.

If a prime appears in multiple ranges, count it only once
Ranges can overlap

Return the total count.


Q2: Apples and Oranges

You have unlimited apples.
You can perform this operation:
Exchange 1 apple → B oranges

You want to end up with exactly A total fruits (apples + oranges).

Return the number of ways to do this.

No restriction on starting apples


Q3: Breaking cycles in directed graph

You are given a directed graph with N nodes and edges.

Some edges form cycles. If a car enters such a cycle, it gets stuck.

You can reverse the direction of any edge.

Find the number of ways to assign directions to edges such that no cycles remain.

Two ways are different if at least one edge direction differs
Return answer modulo 10^9+7


Q4:

There was one more question which I can’t recall completely, but it was based on permutations from 1 to |A|.

According to me, it wasn’t too hard, just a combination of 2–3 standard topics.

PS: I used GPT to rephrase the statements, but the questions are real.

Comments (3)