First Completed Mingo Line
Reported by candidates from Epic's online assessment. Pattern, common pitfall, and the honest play if you blank under the timer.
Epic reportedly put this one in front of candidates in September 2026, and it's a bingo checker in disguise. Strip the story and you're mapping each board value to a cell, then counting marks per row, column, and the main diagonal. First line to hit n marks wins. The board is up to 500 x 500 and calls run to a million, so rescanning lines per call is the trap. If you blank during the live OA, StealthCoder is the safety net that reads the problem and hands you the counter approach. But you should be able to write this in ten minutes.
The problem
You are given an n x n board of distinct integers and a sequence called. Process calls from left to right. A Mingo is completed when every value in a row, a column, or the main top-left-to-bottom-right diagonal has been called. Return [1, k] when the first Mingo appears after exactly k calls. If the full sequence produces no Mingo, return [0, called.length]. Repeated values and values absent from the board still count as calls but do not mark another cell. Function firstMingo(board: int[][], called: int[]) → int[] Examples Example 1 board = [[1,2,3],[4,5,6],[7,8,9]] called = [1,5,2,9] return = [1,4] Calls 1, 5, and 9 complete the main diagonal on the fourth call. Example 2 board = [[1,2],[3,4]] called = [4] return = [0,1] One marked cell does not complete a row, column, or the main diagonal. Constraints 1 <= n <= 500 board contains distinct integers from 1 through 1000000. 1 <= called.length <= 1000000
Reported by candidates. Source: FastPrep
Pattern and pitfall
The trick is a hash map from value to (row, col), built once in O(n^2). Keep three things: a row count array, a column count array, and one diagonal counter. For each call at index i, look up the value. If it's missing, skip it. Since board values are distinct, a value can only mark a cell once, but a repeated call must not increment again, so track a seen set or mark the cell. After incrementing, check if rowCount[r], colCount[c], or the diagonal counter (only when r == c) equals n. If so, return [1, i+1]. Otherwise return [0, called.length]. The common pitfall is returning the zero-based index instead of the call count, or double-counting repeated calls. Another is forgetting the anti-diagonal doesn't count here, only the main one. Total time is O(n^2 + called.length). StealthCoder is your hedge if the details slip under the clock.
Drill it cold or hedge it with StealthCoder. Either way, don't walk into the OA hoping you remember the trick.
You can drill First Completed Mingo Line cold, or you can hedge it. StealthCoder runs invisibly during screen share and surfaces a working solution in under 2 seconds. The proctor sees the IDE. They don't see what's behind it. Made for the candidate who got the OA invite this morning and has 72 hours, not six months.
Get StealthCoderRelated leaked OAs
This OA pattern shows up on LeetCode as first completely painted row or column. If you have time before the OA, drill that.
You've seen the question.
Make sure you actually pass Epic's OA.
Epic reuses patterns across OAs. Made for the candidate who got the OA invite this morning and has 72 hours, not six months. Works on HackerRank, CodeSignal, CoderPad, and Karat.
First Completed Mingo Line FAQ
What's the trick in Epic's First Completed Mingo Line?+
Precompute a map from each board value to its row and column. Then keep running counts per row, per column, and for the main diagonal. Each call becomes an O(1) update and check, so you never rescan the board.
How do I handle repeated or missing calls?+
Missing values aren't in your map, so skip them. Repeats must not mark the cell twice, so keep a marked boolean per cell or a seen set. They still count toward k, which is the index plus one.
What should I return when no Mingo happens?+
Return [0, called.length], using the full length of the called array. Example 2 shows this: one call, no line, so the answer is [0,1]. Don't return the number of marked cells.
Do I need to check the anti-diagonal?+
No. Only the main top-left to bottom-right diagonal counts. A cell is on it when row equals column. Adding anti-diagonal logic is a common over-read of the problem and will give wrong answers.
How do I prepare for this in 48 hours?+
Write it once from scratch with a hash map and three counters, then test the two examples plus a repeated-call case and an n = 1 board. Know the complexity: O(n^2) setup and O(called.length) processing. That covers it.