BNY Previous Year Coding Questions and Hiring Process

BNY, formerly known as BNY Mellon, is a global financial services company and one of the world's largest custodian banks, with a large engineering presence in Pune and Chennai. It hires freshers for Software Engineer, SDE, and Mainframe Developer roles, and its interviews are known for weighting live, fully working code over verbal approach discussions.

If you are preparing for BNY, understanding the HackerEarth or HackerRank based online assessment, the live coding technical rounds, and the heavy SQL and OOP focus will help you prepare efficiently. This guide covers the complete BNY hiring process along with previous year coding questions asked in its online assessments and interviews.

BNY Hiring Process

Here is the typical flow for BNY fresher hiring through campus and off campus drives. Selection funnels are steep, one recent drive narrowed roughly 3,800 applicants down to 34 shortlisted candidates and 14 hires.

StageWhat HappensWhat They Are Looking For
  1. Online Assessment
A test on HackerEarth or HackerRank, 90 minutes to 3 hours, typically 4 coding problems of increasing difficulty, roughly one easy, two medium, and one hard. The passing bar is commonly reported around 55 to 60 percent of total marks. Breadth across DSA fundamentals under time pressure.
  1. Technical Interviews (2 to 3 rounds)
Conducted over HackerRank CodePair or Webex with CodePair, with live coding expected to fully compile and run, not just a verbal approach. Covers DSA, SQL, and OOP, alongside a deep dive into your resume and projects. Working code delivered live, not just correct reasoning.
  1. Final Technical and Managerial Round
Often conducted with a senior interviewer such as a Director, combining a coding or design problem with managerial and company-knowledge questions. Depth under a senior interviewer and genuine interest in BNY.
  1. HR Round
A conversation about your background, career motivation, and sometimes a logic puzzle or two. Genuine interest and cultural fit.

Some drives run a separate women-only track called the Code Divas Diversity Challenge, with its own OA and interview rounds on HackerEarth. On-campus final rounds are sometimes held in person in Pune or Chennai.

Assessment Pattern

Format: A proctored online test on HackerEarth or HackerRank, 90 minutes to 3 hours depending on the drive.

Sections typically included:

  1. Coding Round: Four problems of increasing difficulty, mixing arrays, strings, greedy, sliding window, prefix sums, and number theory, with a couple of DP or graph problems on harder drives.
  2. Live Technical Interviews: Two to three rounds where you write fully working code live on a shared editor, not just describe your approach.
  3. SQL and OOP Depth: Nearly every technical round includes at least one SQL query question and one OOP or design pattern question.

BNY Coding Round: What to Expect

The coding round at BNY blends standard DSA problems with a few finance-flavoured logic puzzles. Frequently reported topics include:

  • Array and string problems, including sliding window and prefix sum techniques
  • Greedy problems, including removing digits to minimize a number and minimum-selection problems
  • Hashmap based problems, including generating unique names or identifiers
  • Number theory problems, including prime checks and digit sum properties
  • Dynamic programming and graph problems on harder drives, including topological sort style problems

For hands on practice, use:

Two independent candidates specifically called out that BNY interviewers expect fully compiling, working code within 5 to 10 minutes during live technical rounds, rather than accepting a verbal or pseudocode approach the way many other companies do. Practice typing out complete, bug-free solutions under time pressure rather than only solving problems on paper.

Beyond the thirteen detailed problems below, candidates have also reported OA problems by name only, without the full statement being publicly available, including Maximum Score, Sequential String, Server Investment, Minimum Processing Time, Maximum Binary Sum, Wallet Denominations, Maximal Permutation, Minimum Reversal, Counting Analogous Arrays, Glide Typing, String Modification, Meeting Assistant, Binary Autocomplete, Sum of Distances, Escape from the Maze, Demand and Supply, Cyber Beacon Detection, Security Grouping, Distributed Data Servers, Merge Sort Counts, Valid Keys, Array Compromise, Merge Elements, Process Scheduler, Purchase Optimization, Pythagorean Triples, Portfolio Balance, BIT Profit, Social Media Suggestions, Coin Collection, Women's Day Mathematics Challenge, Sum of All Values, Team Formation, Binary Storage, The Puzzle of Harmony, and Hiking Cost. Treat these as a signal of BNY's OA topic variety rather than problems to solve verbatim, since their exact statements were not recoverable from public sources.

SQL and Database Focus Areas

Real questions reported by candidates across technical rounds:

  • Sort the results of a SELECT query without using the ORDER BY clause.
  • Find the employee with the third highest salary using a join and ranking approach.
  • Print all employees under a given manager ID, then extend the query to handle a full reporting hierarchy using subqueries.
  • Write a SQL query using GROUP BY to aggregate results.
  • Explain SQL versus NoSQL, and be ready to justify why a project used MongoDB instead of a relational database.
  • Explain ACID properties, database keys, and normalization.
  • Explain denormalization, what it means, and when you would use it.
  • Explain the difference between JRE and JDK, and list common Java keywords you should recognize.
  • Explain operator overloading, and the difference between early binding and late binding.

Technical Interview: DSA and Systems

Real questions reported by candidates:

  • Find the shortest substring of a string that contains all of its distinct characters.
  • Convert a binary valued linked list to its decimal equivalent.
  • Detect and remove a cycle in a linked list, and validate a root to leaf path sum in a binary tree.
  • Find the maximum path sum in a binary search tree, and solve 3Sum using brute force, better, and optimal approaches.
  • Count palindromic subsequences in a string.
  • Arrange a list of strings so that no two strings with the same initial letter are adjacent.
  • Convert a number to its Roman numeral form using a binary search style approach.
  • Best Time to Buy and Sell Stock, along with follow-up variants allowing multiple transactions.
  • Find the smallest distance to reach any cell from the top row of a 2D grid using dynamic programming.
  • Print all elements along the perimeter of a matrix, implement a sliding window on an easy array, and walk through how merge sort works.
  • Print all permutations of an array without duplicates using backtracking.
  • Be ready to discuss Kadane's algorithm, grouping anagrams, topological sort for an alien dictionary style problem, Rotten Oranges using BFS, N-Queens, matrix chain multiplication, word break, counting unique BSTs, and finding the largest all-zero submatrix.
  • Sum of all possible expressions formed by inserting addition operators into a numeric string.
  • List all common subsequences of two strings in lexicographic order.
  • Given a sorted array, check in logarithmic time whether a pair summing to a target exists.
  • A lift or elevator scheduling optimization problem.
  • Given two query points, check whether each lies inside a given triangle.
  • Print the lexicographically largest subsequence of a string.
  • Given a range, print all numbers in that range whose digits are all distinct.
  • Form the smallest number divisible by a given value X using a fixed count of the digits 9 and 0.
  • Check whether the sums along different root to leaf paths of a binary tree equal a target value.
  • Find the minimum number of operations to convert a given permutation into the identity permutation.
  • Convert an array into zig-zag order, alternating between smaller and larger elements.
  • A circle of strings problem, checking whether strings can be chained end to end into a cycle.
  • Find the Nth node from the end of a linked list.
  • Implement Kruskal's algorithm to find a Minimum Spanning Tree.
  • Find the Kth smallest element across multiple given ranges.
  • Check whether a given number is a power of two.
  • Flatten a multilevel linked list into a single level list.
  • Level order traversal, depth first traversal, and the right view of a binary tree.
  • Find the largest all-zero rectangular submatrix by sum.
  • Sort a stack using recursion or an auxiliary stack, without extra data structures beyond that.
  • Replace surrounded regions of a character in a matrix, similar to the Surrounded Regions problem.
  • Jump Game, finding the minimum number of jumps needed to reach the end of an array.
  • Delete a node in a singly linked list given only a pointer to that node, without access to the head.
  • Given two trees, connect them with a single edge to minimize the resulting maximum node to node distance.
  • Sort an array based on the count of set bits in each element's binary representation.
  • A greedy problem building the largest possible number by picking the maximum available digit at each position across multiple strings.
  • Count the minimum number of fountains or sprinklers needed to cover an entire garden, an interval covering greedy problem.
  • Maximal Square, finding the largest square of 1s in a binary matrix.
  • A hard problem on 2D points solved using lower bound and upper bound binary search.
  • Count the number of words in a given string.
  • Find the minimum number of increment operations needed to make all elements of an array equal.
  • Count the number of distinct pairs in an array with a given sum.
  • Implement insertion sort, quicksort, and merge sort from scratch, and be ready to discuss the tradeoffs between merge sort and quicksort.
  • Implement a Priority Queue from scratch.

OOP, Design Patterns, and CS Fundamentals

Real questions reported by candidates:

  • Implement a Comparator class in C++ to demonstrate runtime polymorphism.
  • Explain the Singleton and Abstract Factory design patterns, with real use cases.
  • Explain the types of inheritance, the diamond problem, object slicing, and the difference between copy constructors and private constructors.
  • Explain malloc versus calloc, and the difference between stack and heap memory allocation.
  • Explain paging versus segmentation, and virtual memory.
  • Which data structure would you use to implement autocomplete, and why a Trie fits.
  • Low level design questions, including designing a vending machine and a checkout system with discount logic.
  • Explain the difference between a stack and a queue with real use cases.
  • Explain processes versus threads, caching strategies, firewalls, and IPv4 versus IPv6.
  • For candidates with Android experience, questions on Kotlin, the Android lifecycle, and common causes of memory leaks.
  • Explain the difference between a struct and an array in C.
  • Explain encapsulation in C++ with a real example.
  • Explain compile time versus runtime polymorphism in C++, with a follow-up on how each is implemented.
  • Define a thread as a single sequence stream within a process, and explain why multithreading is useful.
  • Low level design: design a movie ticket booking system similar to BookMyShow.
  • If you have React experience, explain React lifecycle methods and how props are passed between components.
  • Explain Docker and containerization, and how they fit into cloud based deployment.
  • Discuss real applications of generative AI tools like ChatGPT in software development.
  • Explain vertical scaling versus horizontal scaling.
  • An open ended system design question: how would you design a system like WhatsApp.
  • Explain the difference between a library and a module.
  • An open ended system design question: how would you approach designing an e-commerce website.
  • Explain how a binary heap works and its common operations.
  • Basic machine learning and computer vision fundamentals, occasionally asked even to SDE candidates without a data background.
  • General questions on API design principles.

Complete Interview Questions

Resources to Prepare for BNY


BNY Previous Year Coding Questions

Below is a list of BNY previous year coding questions commonly reported by candidates in the online assessment. Each question includes a problem statement, input and output format, and a sample explanation.

1. Weird Terminal

Problem Statement: A terminal displays at most two words per line. Given a string of space separated words, find the number of lines needed to display the entire string.

Input Format:

  • A string s of space separated words

Output Format:

  • The number of lines required

Example: Input: "hello world how are you" Output: 3

2. Maximum Toys

Problem Statement: Given the prices of several toys and a budget, find the maximum number of toys that can be bought without exceeding the budget.

Input Format:

  • An integer array prices
  • An integer budget

Output Format:

  • The maximum number of toys that can be bought

Example: Input: prices = [1, 12, 5, 111, 200, 1000, 10], budget = 50 Output: 4

3. Device Name System

Problem Statement: Given a list of requested folder names in order, if a name already exists, append (k) for the smallest positive integer k that makes the name unique, and use that as the assigned name going forward.

Input Format:

  • An array of strings names

Output Format:

  • An array of the assigned unique names, in order

Example: Input: ["pyq", "pyq", "pyq(1)", "pyq"] Output: ["pyq", "pyq(1)", "pyq(1)(1)", "pyq(2)"]

4. Amusement Park

Problem Statement: Given a numeric string representing a cost and an integer k, remove exactly k digits from the string to form the smallest possible resulting number.

Input Format:

  • A numeric string num
  • An integer k

Output Format:

  • The smallest possible number after removing k digits

Example: Input: num = "1432219", k = 3 Output: "1219"

5. Borrow Number

Problem Statement: Given two non-negative integers, count the number of borrow operations required when subtracting the smaller from the larger, digit by digit, the way subtraction is taught on paper.

Input Format:

  • Two integers A and B

Output Format:

  • The number of borrow operations

Example: Input: A = 628, B = 345 Output: 1

6. Vampire Battle

Problem Statement: Given an array of positive integers, find the minimum number of elements, chosen optimally, whose sum is strictly greater than the sum of the remaining elements.

Input Format:

  • An integer array arr

Output Format:

  • The minimum count of elements needed

Example: Input: arr = [3, 1, 4, 1, 5, 9, 2, 6] Output: 3

7. Array Subarray

Problem Statement: Given an array and an integer k, find the minimum element in every contiguous subarray of size k, then return the maximum among those minimums.

Input Format:

  • An integer array arr
  • An integer k

Output Format:

  • The maximum of the minimums across all windows of size k

Example: Input: arr = [2, 5, 1, 8, 3], k = 2 Output: 3

8. Coin Game

Problem Statement: Given an array representing the gain or loss in each round of a game, find the minimum non-negative starting balance needed so that the running balance never goes negative at any point.

Input Format:

  • An integer array rounds

Output Format:

  • The minimum starting balance required

Example: Input: rounds = [-3, 4, -2, 5, -1] Output: 3

9. Coloured Zenga

Problem Statement: Given a stack of colored blocks represented as a string, where each move removes one maximal contiguous group of same colored blocks and the blocks above collapse downward, find the minimum number of moves needed to remove all blocks.

Input Format:

  • A string blocks of characters representing colors

Output Format:

  • The minimum number of moves to clear all blocks

Example: Input: "aabba" Output: 2

10. Good Prime Number

Problem Statement: Given integers n and k, find the k-th number greater than n such that the number itself is prime and the sum of its digits is also prime.

Input Format:

  • An integer n
  • An integer k

Output Format:

  • The k-th qualifying number

Example: Input: n = 10, k = 2 Output: 23

11. Circuit Output

Problem Statement: Given integers A, B, and N, find a value X in the range [0, 2^N - 1] that maximizes the product (A XOR X) * (B XOR X), and return that maximum product.

Input Format:

  • Three integers A, B, and N

Output Format:

  • The maximum possible value of (A XOR X) * (B XOR X)

Example: Input: A = 4, B = 6, N = 3 Output: 35

12. Compatible Warehouses

Problem Statement: Given a tree of warehouses rooted at node 1, where each node has a capacity value, an ancestor warehouse u can support a descendant warehouse v if the distance between them in the tree is less than or equal to v's capacity. Count the number of compatible ancestor-descendant pairs.

Input Format:

  • A tree with n nodes given as edges
  • An array capacity of size n

Output Format:

  • The count of compatible ancestor-descendant pairs

Example: Input: edges = [(1,2),(2,3),(3,4)], capacity = [0, 1, 0, 2] (indices 1 to 4) Output: 3

13. Count User Logins

Problem Statement: Given a 2D array of login logs where each entry is [username_with_id, login_time, login_date], filter out invalid entries and return a lexicographically sorted 2D array of [username_with_id, login_date, login_count], counting how many times each user logged in on each date.

Input Format:

  • A 2D string array logs

Output Format:

  • A lexicographically sorted 2D array of [username, date, count]

Example: Input: [["alice1","10:00","2024-01-01"],["bob2","11:00","2024-01-01"],["alice1","09:00","2024-01-01"]] Output: [["alice1","2024-01-01","2"],["bob2","2024-01-01","1"]]

At Last

BNY interviews reward candidates who can write clean, fully working code quickly, not just candidates who can explain an approach. Practice typing out complete solutions under time pressure, brush up on SQL joins and ranking queries, and be ready to discuss OOP concepts and at least one design pattern in depth, since these come up in nearly every technical round.

Join the Telegram group for more resources and discussions.

HR Interview Tips

The HR and managerial rounds check communication, motivation, and overall fit. Common questions include:

  • Why do you want to join BNY.
  • What do you know about BNY.
  • Where do you see yourself in five years.
  • What achievement or moment are you most proud of.
  • How do you stay updated on new technologies.
  • Have you inspired anyone, for example in your village or community.
  • Tell me something you did not tell the previous two interviewers.
  • What is the hardest challenge you have faced, and how did you overcome it.
  • What tech stack are you most comfortable with.
  • Describe a time a project failed and how you handled it, and how you manage your time under pressure.
  • How long would it take you to learn Java if your background is in C++.
  • A handshake puzzle: nineteen people each shake hands with every other person exactly once, how many handshakes happen in total.
  • Classic water measurement and weighing puzzles, including a water jug puzzle and a nine balls weighing puzzle.
  • What progress have you made in the past six months.
  • A hypothetical scenario: how would you complete ten days of work in seven days, working alone with no extra hours.
  • A combinatorics puzzle: in how many ways can five boys and five girls be seated in a row so that no two boys and no two girls sit next to each other.
  • Tell me about a time you displayed leadership skills.
  • Discuss any positions of responsibility you have held in clubs or societies, and what you achieved there.

Complete HR Interview Questions

Useful Resources for Your Placement Prep