Coupang Interview Experience | Staff | AUG 2026

coupang logo
coupang
· Staff
August 7, 2026 · 2 reads

Summary

I interviewed for a Staff role at Coupang in August 2026, where I was asked to convert an undirected graph into a directed one to minimize the number of connected nodes.

Full Experience

Don't remember the exact Question, but the question is goes as follows

Graph Problem

There are n warehouses, and two list is provided from and to Edges which are birectional Edge, the goal is to convert the bidirectional into directed graph, so that the number of connected nodes is as less as possible you need to do it optimally.

1 - 2 - 3

you need to connect 1 -> 2 - > 3 here the number of unconnected node is 1 but if you connect 1 -> 2 <- 3 then you get 2, which is wrong.

so the goal is to convert the un-directed graph to a directed edge optimally.

solution explored in interview :

  1. first approch tried connecting the edge direction where the indegree is 0 first lets say we get node from and to as 5,4 then if the indegree of 5 is 0 then make an edge from 4 - > 5

  2. compute number of connected components using DUS, then check if there is cycle then all nodes are connected else, only one node is left and add +1 to the result.

if someone knows the exact leetcode question please tag.

Interview Questions (1)

1.

Minimize Connected Nodes by Directing Edges

Data Structures & Algorithms

Given n warehouses and two lists from and to representing bidirectional edges between them, convert the undirected graph into a directed graph such that the number of connected (reachable) nodes is as small as possible. The conversion must be done optimally. Example: for a chain 1 - 2 - 3, directing the edges as 1 -> 2 -> 3 leaves only node 1 unconnected (count = 1), whereas directing as 1 -> 2 <- 3 leaves two unconnected nodes (count = 2), which is not optimal. The task is to assign a direction to each edge to minimize the number of nodes that are not reachable from any source.

📣 Found this helpful? Please share it with friends who are preparing for interviews!

Discussion (0)

Share your thoughts and ask questions

Join the Discussion

Sign in with Google to share your thoughts and ask questions

No comments yet

Be the first to share your thoughts and start the discussion!