Nubank Coding Interview Questions
25 Nubank coding interview problems with full optimal solutions — 13 easy, 9 medium, 3 hard. Every problem ships with multiple approaches (brute-force first, then the optimal), complexity tables for each, company-specific tips on what an Nubank interviewer values, and a FAQ section.
Showing 25 problems of 25
- #1easyfoundational
1. Two Sum
Given a transaction amounts array, find two debits that sum to a target reconciliation value.
- #2easyfoundational
2. Valid Parentheses
Validate that nested bracket structures in a KYC document parser are balanced.
- #3easyfoundational
3. Merge Two Sorted Lists
Merge two sorted ledger entry streams into a single chronological feed.
- #4easyfoundational
4. Remove Duplicates from Sorted Array
Deduplicate a sorted list of transaction IDs in-place to prepare a reconciliation batch.
- #5easyfoundational
5. Remove Element
Filter out cancelled-transaction codes in place to simplify a reconciliation feed.
- #6easyfoundational
6. Search Insert Position
Find the correct insertion index for a new credit-score tier into a sorted threshold table.
- #7easyfoundational
7. Maximum Subarray
Find the largest profitable contiguous period from a daily P&L series on a credit portfolio.
- #8easyfoundational
8. Plus One
Increment a digit-array representation of an account number while handling carry across all positions.
- #9easyfoundational
9. Same Tree
Determine whether two binary trees are structurally identical with equal node values, a classic recursion warm-up Nubank uses to check candidates can write clean base cases before any LatAm payments-domain follow-up.
- #10easyfoundational
10. Best Time to Buy and Sell Stock
Find the max profit from a single buy/sell over a price series — a one-pass sliding minimum that Nubank uses as an analog for FX/credit risk windowing.
- #11easyfoundational
11. Single Number
Find the element that appears once when every other element appears twice; Nubank uses it to probe bit-tricks intuition before deeper credit-ledger reconciliation problems.
- #12easyfoundational
12. Majority Element
Find the element that appears more than n/2 times in an array — Nubank uses Boyer-Moore voting as a proxy for streaming-fraud aggregation patterns.
- #13easyfoundational
13. Reverse Linked List
Reverse a singly linked list in-place; Nubank treats this as a pointer-discipline screen before harder ledger-traversal questions.
- #14mediumfoundational
14. Number of Islands
Count connected components of '1's in a 2D grid; Nubank uses it as an analog for clustering related KYC/fraud accounts on a relationship grid.
- #15mediumfoundational
15. LRU Cache
Design a Least-Recently-Used cache with O(1) get and put; a staple Nubank uses to probe whether candidates can pair a hash map with a doubly-linked list for hot-account caching.
- #16mediumfoundational
16. Merge Intervals
Merge a list of overlapping intervals into the minimum disjoint set; Nubank uses it as an analog for collapsing overlapping hold-amounts on a credit-card ledger.
- #17mediumfoundational
17. Binary Tree Level Order Traversal
Return a binary tree's node values level by level; Nubank uses BFS-with-level-snapshots to test queue discipline before deeper org-hierarchy / category-tree questions.
- #18mediumfoundational
18. Longest Palindromic Substring
Find the longest substring of s that reads the same forward and backward — Nubank uses expand-around-center to gauge whether you can avoid O(n^3) brute force under stress.
- #19mediumfoundational
19. Longest Increasing Subsequence
Find the length of the longest strictly increasing subsequence in an array; Nubank uses LIS to test DP fluency, often framed as longest rising balance trend in a checking account.
- #20mediumfoundational
20. Coin Change
Compute the fewest coins that sum to a target amount; Nubank loves this one as a stand-in for cash-out denominations problems on PIX/withdrawal flows.
- #21mediumfoundational
21. Number of Provinces
Count connected components in an adjacency-matrix graph; Nubank uses this as a clean Union-Find prompt that maps to clustering linked accounts during fraud-ring detection.
- #22mediumfoundational
22. Course Schedule II
Topologically order n courses given prerequisite edges; Nubank uses Kahn's algorithm as a stand-in for ordering dependent steps in a settlement DAG.
- #23hardfoundational
23. Sliding Window Maximum
Return the maximum in each sliding window of size k as it slides across nums; Nubank uses the monotonic deque to test whether candidates can replace a naive heap with an O(n) trick under real-time risk scoring constraints.
- #24hardfoundational
24. Find Median from Data Stream
Design a data structure supporting addNum and findMedian over a numeric stream; Nubank uses the two-heap split as an analog for running-quantile risk scoring over a card-auth firehose.
- #25hardfoundational
25. LFU Cache
Design a Least-Frequently-Used cache with O(1) get and put, breaking ties by recency; Nubank uses it to gauge whether senior candidates can layer two hash maps with frequency buckets for hot-credit-line caching.