0 day streak

UBS coding interview questions

BankingFintech Global

Ranked by how often candidates report them. Each opens in the editor with hidden tests, an animated walkthrough and solutions in four languages; a question you solve once counts for every company that asks it.

0%ready
Your level: practise every reported question.
ProgressTitleDifficultyTopicHow often hereAlso asked atNext step
Search Suggestions SystemBasics Medium Tries DoorDash, Twilio, Anduril +5 Solve
Group AnagramsHashing Medium Arrays & Hashing Amazon, Microsoft, Meta +82 Solve
Valid ParenthesesStack Basics Easy Stack Google, Amazon, Microsoft +119 Solve
Validate IP AddressSimulation Medium Arrays & Hashing Meta, Nvidia, X (Twitter) +14 Solve
Remove Duplicate LettersMonotonic Stack Medium Monotonic Stack Amazon, Expedia Group, TikTok (ByteDance) +3 Solve
Remove Nth Node From End of ListFront Back Pointer Medium Linked List Meta, Apple, eBay +22 Solve
Minimum Number of Taps to Open to Water a GardenGreedy Hard Arrays & Hashing Uber, Rippling, Goldman Sachs +6 Solve
Convert Binary Number in a Linked List to IntegerBasics Easy Bit Manipulation Nutanix, Arista Networks, Juniper Networks +3 Solve
Integer to English WordsSimulation Hard Arrays & Hashing Meta, Snowflake, Palantir +17 Solve
Minimum Falling Path Sum2D DP - max/min of last row Medium Dynamic Programming Dream11, Cars24, BigBasket +1 Solve
Find Peak ElementUnique 1-D Binary Search Medium Binary Search Meta, Netflix, Uber +26 Solve
Diameter of Binary TreePostorder + Multiple Return Values Easy Trees & BST Google, Meta, DoorDash +22 Solve
Min StackStack Medium Design Data Structures Microsoft, Apple, Snowflake +33 Solve
Merge IntervalsBasics Medium Intervals Google, Amazon, Microsoft +107 Solve
Reverse Linked ListFront Middle Back Pointer Easy Linked List Microsoft, Apple, Bloomberg +81 Solve
Two SumTwo Sum Easy Arrays & Hashing Google, Amazon, Microsoft +135 Solve
Minimum Path Sum2D DP Medium Dynamic Programming Dropbox, Palo Alto Networks, Waymo +20 Solve
Intersection of Two Linked ListsMiscellaneous Easy Linked List LinkedIn, Airbnb, Akamai +26 Solve
Swapping Nodes in a Linked ListDummy Node Pattern Medium Linked List Airtel, Dailyhunt (VerSe Innovation) Solve
Max Area of IslandMatrix Graphs Medium Graphs Snowflake, DoorDash, Palantir +10 Solve
Reverse Nodes in k-GroupFront Middle Back Pointer Hard Linked List Amazon, Microsoft, Meta +33 Solve
Recover Binary Search TreeBST Basics Medium Trees & BST Microsoft, Nutanix, FactSet +2 Solve
Trim a Binary Search TreeBST Basics Medium Trees & BST Yahoo, OYO, Persistent Systems +1 Solve
Split Array Largest SumBinary Search on Answer Space Hard Binary Search Amazon, Uber, Pinterest +16 Solve
Surrounded RegionsDFS - Complement Trick Medium Graphs Apple, Uber, Nutanix +4 Solve
Find the Index of the First Occurrence in a StringString Matching (KMP) Easy Arrays & Hashing Dropbox, Zscaler, Discord +12 Solve
Maximum Depth of Binary TreeRecursion Easy Trees & BST LinkedIn, Spotify, Tesla +19 Solve
Serialize and Deserialize Binary TreeTree Serialization / Deserialization Hard Trees & BST Google, Amazon, Meta +22 Solve
Decode Ways1D DP Medium Dynamic Programming Google, Meta, Tesla +21 Solve
Gas StationKadane's Algorithm Medium Arrays & Hashing Amazon, Microsoft, Bloomberg +23 Solve
Minimum Cost to Connect SticksTop K / Kth Largest / Smallest Medium Heaps Google, X (Twitter), JPMorgan Chase +8 Solve
Meeting Rooms IILine Sweep Medium Intervals Google, Amazon, Meta +50 Solve
Multiply StringsRight to Left Traversal Medium Arrays & Hashing Pinterest, X (Twitter), Zillow +9 Solve
Longest Happy PrefixString Matching (KMP) Hard Arrays & Hashing Amazon Solve
Boundary of Binary TreeViews Medium Trees & BST Uber, Snowflake, Nutanix +10 Solve
Subtree of Another TreeTraversals Easy Trees & BST eBay, Electronic Arts, American Express +1 Solve
Trapping Rain WaterTwo Pointer Hard Arrays & Hashing Google, Amazon, Microsoft +88 Solve
Number of IslandsConnected Components Medium Graphs Google, Amazon, Microsoft +114 Solve
Minimum Knight MovesBFS for shortest path Medium Graphs Microsoft, Uber, Databricks +9 Solve
Also reported, being added to AlgoRung (6)

Count Pairs of Connectable Servers in a Weighted Tree Network · Wiggle Subsequence · Get the Maximum Score · Single Number II · Convert BST to Greater Tree · 4 Keys Keyboard

Questions people ask

What coding questions does UBS ask most?

Search Suggestions System, Group Anagrams, Valid Parentheses, Validate IP Address, Remove Duplicate Letters, Remove Nth Node From End of List, Minimum Number of Taps to Open to Water a Garden, Convert Binary Number in a Linked List to Integer.

Which topics come up in UBS coding rounds?

linked list, strings, trees, arrays, stack, graphs.

How hard are UBS coding questions?

Of the reported questions, 9 are easy, 23 medium and 7 hard. A 45 to 60 minute live interview where you solve one or two data-structures-and-algorithms problems while explaining your thinking. Interviewers score problem solving, code quality, testing and communication.