HSBC interview questions

275 questions from 44 interviews · updated from reports 2015-2024

Practise HSBC-style

About

HSBC is a banking and financial services company that offers personal banking, wealth management, commercial banking, and investment banking services. In India, its technical hiring includes roles such as Trainee Software Engineer, Software Engineer Trainee, Software Engineer, data, cloud, and support engineering.

The roles that come up most are Trainee Software Engineer, Software Engineer and Software Engineer Trainee. This covers 44 candidate interviews reported from 2015 to 2024. Most sat it at entry level (44 of 44 that recorded a level). Among the 39 that recorded either route, arrivals split between campus drives (37, 95%) and off-campus applications (2, 5%). Most questions fall under CS fundamentals and DSA.

Category
Difficulty
Round

Interview questions

Q. Sort a 2D matrix row-wise.

asked 2xeasySortingOnline test2019

Ans. Sort each row of the matrix independently in ascending order. Iterate through all rows and apply an in-place sorting algorithm or the language’s built-in sort to each row array. No extra data structure is needed apart from sorting overhead. For an m by n matrix, time complexity is O(m n log n).

Q. Reverse a singly linked list

asked 2xeasyLinked listsTechnical2023-2024

Ans. Reverse it by walking through the list once and redirecting each node’s next pointer to the previous node. Keep three pointers: previous, current, and next, so you do not lose the remaining list. At the end, previous becomes the new head. Time is O(n), space is O(1).

Q. Find the maximum element in an array

asked 2xeasyArraysOnline test, Technical2022-2023

Ans. Set the first array element as the current maximum, then scan the array once and update it whenever a larger element is found. This uses the array directly and only one extra variable. The time complexity is O(n), because every element is checked once, and the space complexity is O(1).

Q. What are the differences between C and C++?

asked 2xeasyOOPTechnical2019-2020

Ans. C is a procedural language, while C++ is largely a superset of C with object oriented and generic programming features. C++ adds classes, inheritance, polymorphism, templates, exceptions, references, function overloading and the standard library. The most important difference is abstraction: C gives low level control, while C++ supports higher level design without losing that control.

Q. Check whether a given string is a palindrome.

asked 2xeasyStringsTechnical2021-2024

Ans. Use two pointers, one at the start of the string and one at the end, and compare characters while moving inward. If any pair differs, it is not a palindrome; if the pointers meet or cross, it is. This uses no extra data structure and runs in O(n) time with O(1) space.

Q. Explain Belady’s Anomaly

asked 1xmediumOperating systemsTechnical2015

Ans. Belady’s anomaly is the counterintuitive case where giving a process more page frames causes more page faults, not fewer. It is most commonly seen with the FIFO page replacement algorithm. Stack-based algorithms such as LRU and optimal replacement do not suffer from it because their resident page sets grow monotonically.

Q. Design a payment gateway system

asked 1xmediumLow level designTechnical2023

Ans. Design it as an API service that authorises, captures, refunds, and reconciles payments through multiple payment processors. Key components are merchant authentication, payment orchestration, tokenised card storage, fraud checks, ledger, webhook handling, and reporting. The most important detail is idempotency, so retries never double-charge customers and every state transition is auditable.

Q. Implement a Linked List in Java

asked 1xmediumLinked listsTechnical2017

Ans. Implement it with a Node class holding data and a next reference, and a LinkedList class holding the head, optionally the tail and size. Insertion at the head is O(1), insertion at the tail is O(1) with a tail pointer, and search or deletion by value is O(n).

Q. Explain J2EE servlets and cookies.

asked 1xmediumWebTechnical2018

Ans. J2EE servlets are server-side Java components that handle HTTP requests and generate responses, while cookies are small name-value data items stored by the browser and sent with later requests. Servlets commonly use cookies to maintain state, such as session identifiers, because HTTP itself is stateless.

Q. Explain Java collections framework

asked 1xmediumOOPTechnical2019

Ans. The Java Collections Framework is a standard set of interfaces and classes for storing, retrieving and processing groups of objects. Its core interfaces are Collection, List, Set, Queue and Map. The key detail is that you choose an implementation, such as ArrayList, HashSet or HashMap, based on ordering, uniqueness and performance needs.

Q. Concatenate two Binary Search Trees

asked 1xmediumTreesTechnical2015

Ans. Convert both BSTs to sorted inorder lists, merge the two lists, then build a balanced BST from the merged sorted list. The key detail is that inorder traversal preserves BST order. This uses arrays or linked lists as temporary storage and takes O(m + n) time and O(m + n) extra space.

Q. Implement a HashMap data structure.

asked 1xmediumHashingTechnical2021

Ans. Use an array of buckets, hash each key to an index, and store entries with the same index in a small linked list or dynamic array. Implement put, get, and remove by searching that bucket. Resize and rehash when load factor grows too high. Average time is O(1), worst case O(n).

Q. Design a basic login website for HSBC

asked 1xmediumWeb designTechnical2022

Ans. Build a secure web login flow with a front end, API gateway, authentication service, user store, session store, and audit logging. The key detail is security: use TLS, password hashing with salt, MFA, rate limiting, device and fraud checks, secure cookies, CSRF protection, account lockout, monitoring, and clear recovery flows.

Q. When do we use decision table testing?

asked 1xmediumSoftware testingTechnical2015

Ans. We use decision table testing when the output or action depends on multiple conditions combined in different ways. It is most useful for business rules, validations, permissions, discounts, or workflows. The key benefit is that it makes each condition combination explicit, so important test cases are not missed.

Q. Explain multithreading concepts in Java

asked 1xmediumOperating systemsTechnical2019

Ans. Multithreading in Java means running multiple threads within one process to perform tasks concurrently while sharing the same memory. Threads can be created with Thread, Runnable, Callable, or preferably managed through ExecutorService. The key concern is thread safety, handled using synchronised blocks, locks, volatile variables, concurrent collections, and careful coordination.

Q. Write SQL queries of medium difficulty.

asked 1xmediumSQLTechnical2023

Ans. For medium SQL queries, I identify the required rows first, join only the necessary tables, then aggregate or filter with grouping, subqueries, or window functions. The key detail is choosing the correct grain, such as one row per customer or order, before adding conditions and calculations.

Q. Conceptual questions on Operating Systems

asked 1xmediumOperating systemsOnline test2019

Ans. An operating system manages hardware resources and provides services for programs, such as process scheduling, memory management, file systems, device access and security. The key idea is abstraction: it hides hardware details behind interfaces, while coordinating safe and efficient sharing of CPU, memory, storage and input or output devices.

Q. Explain your knowledge of Java and Python

asked 1xmediumProgramming languagesTechnical2019

Ans. I have practical knowledge of both Java and Python, mainly for backend development, scripting, data handling and problem solving. In Java, I understand object-oriented design, collections, exceptions, streams and concurrency basics. In Python, I use its simple syntax, libraries, data structures and scripting strengths to build fast, readable solutions.

Q. Compare Oracle Database and MySQL Database

asked 1xmediumDBMSTechnical2023

Ans. Oracle Database is a commercial, enterprise-grade RDBMS built for large, complex, high-availability workloads, while MySQL is a simpler, widely used open-source RDBMS often chosen for web applications. Oracle offers richer features for security, clustering, partitioning, and administration, whereas MySQL is easier to set up, cheaper, and usually sufficient for moderate workloads.

Q. Explain Dijkstra’s shortest path algorithm

asked 1xmediumGraphsTechnical2015

Ans. Use an adjacency list and a min priority queue to repeatedly choose the unvisited node with the smallest known distance, then relax all outgoing edges. Initialise distances to infinity except the source as zero. Push improved distances into the heap and ignore stale entries. Time complexity is O((V + E) log V) with a binary heap.

Q. Explain SSL and security in web applications

asked 1xmediumNetworkingTechnical2019

Ans. SSL, more accurately TLS today, secures web traffic by encrypting data between the browser and server, authenticating the server with certificates, and preventing tampering in transit. In web applications, it should be combined with HTTPS everywhere, secure cookies, input validation, access control, CSRF protection, safe password storage, and regular dependency patching.

Q. Explain database normalization with examples

asked 1xmediumDBMSTechnical2015

Ans. Database normalization is the process of organising tables to reduce duplicated data and avoid update, insert and delete anomalies. For example, instead of storing customer name and address on every order row, create a Customers table and reference it from Orders using a customer ID. Common forms include 1NF, 2NF and 3NF.

Q. Reverse a Binary Search Tree using recursion

asked 1xmediumTreesTechnical2015

Ans. Reverse a Binary Search Tree by recursively swapping the left and right child of every node. Start at the root, swap its children, then call the same function on both subtrees. This uses the call stack as the data structure, visits each node once, and takes O(n) time and O(h) space.

Q. Explain OOP concepts with real-life examples.

asked 1xmediumOOPTechnical2024

Ans. OOP organises software around objects that combine data and behaviour, like a car object having colour and speed, and methods such as start or brake. Encapsulation hides internal details, inheritance lets an electric car reuse car features, polymorphism lets different vehicles respond to drive differently, and abstraction exposes only essential actions.

Q. What is a Translation Lookaside Buffer (TLB)?

asked 1xmediumOperating systemsTechnical2015

Ans. A Translation Lookaside Buffer is a small, fast cache in the CPU’s memory management unit that stores recent virtual to physical page address translations. Its main purpose is to avoid repeatedly walking the page table. A TLB hit makes address translation fast, while a miss requires a slower page table lookup.

Q. Explain how a SQL query is executed internally.

asked 1xmediumDBMSTechnical2019

Ans. A SQL query is parsed, validated, optimised into an execution plan, then run by the database engine. The key step is optimisation: the planner chooses access paths, join order, indexes, and algorithms using statistics and costs. The executor then reads pages, applies filters, joins and aggregates, and returns rows under transaction rules.

Q. Difference between micro-kernel and macro-kernel

asked 1xmediumOperating systemsTechnical2015

Ans. A micro-kernel keeps only essential functions, such as scheduling and IPC, in kernel space, while a macro-kernel, usually called a monolithic kernel, runs most OS services in kernel space. Micro-kernels are more modular and fault-isolated, but often slower due to message passing. Monolithic kernels are faster but less isolated.

Q. Explain ACID properties in DBMS with an example.

asked 1xmediumDBMSTechnical2023

Ans. ACID properties ensure database transactions are reliable: Atomicity means all steps complete or none do, Consistency preserves valid rules, Isolation keeps concurrent transactions from interfering, and Durability makes committed changes permanent. For example, in a bank transfer, debit and credit must both happen, balances must remain valid, parallel transfers must not conflict, and the result must survive a crash.

Q. Explain the PDCA cycle and where testing fits in

asked 1xmediumSoftware testingTechnical2015

Ans. PDCA is Plan, Do, Check, Act, a continuous improvement cycle for building and refining a process or product. Testing mainly fits in the Check stage, where results are measured against expectations. Test findings then drive the Act stage, where defects are fixed, processes are improved, and the next cycle is planned.

Q. Explain ACID properties and transactions in DBMS.

asked 1xmediumDBMSTechnical2024

Ans. A DBMS transaction is a sequence of database operations treated as one logical unit of work. ACID means Atomicity, all operations happen or none do; Consistency, rules and constraints remain valid; Isolation, concurrent transactions do not interfere incorrectly; Durability, committed changes survive failures. These properties protect correctness, especially during errors or concurrency.

Q. What are the typical elements of a process image?

asked 1xmediumOperating systemsTechnical2015

Ans. A process image typically contains the program code, global and static data, heap, stack, and the process control information held by the operating system. The key detail is that it represents everything needed to run and manage the process, including its address space, registers, program counter, open files, and scheduling state.

Q. On what basis is an acceptance test plan prepared?

asked 1xmediumSoftware testingTechnical2015

Ans. An acceptance test plan is prepared based on the agreed requirements, acceptance criteria, and business objectives of the system. The most important source is the requirements specification or contract, because acceptance testing checks whether the delivered product satisfies what the customer or user agreed to accept.

Q. Can a laptop or PC run without an Operating System?

asked 1xmediumOperating systemsTechnical2023

Ans. Yes, a laptop or PC can power on without an operating system, but it cannot provide the normal user experience. The firmware, such as BIOS or UEFI, can initialise hardware and run setup or boot code. To run useful applications, manage files, memory, devices and users, it normally needs an operating system.

Q. Conceptual questions on Database Management Systems

asked 1xmediumDBMSOnline test2019

Ans. A Database Management System is software that stores, retrieves and manages data efficiently and safely. The key ideas are data models, schemas, queries, transactions, concurrency control, indexing, normalisation and recovery. The most important detail is that a DBMS enforces ACID properties so data stays correct even with failures or many users.

Q. Explain the four OOPS concepts with proper examples

asked 1xmediumOOPTechnical2023

Ans. The four OOP concepts are encapsulation, abstraction, inheritance and polymorphism. Encapsulation keeps data and methods together, like private balance with deposit methods in Account. Abstraction hides details, like a Car exposing drive. Inheritance lets SavingsAccount extend Account. Polymorphism lets different objects implement pay differently through the same method call.

Q. Design an API and discuss authentication in REST APIs

asked 1xmediumApi designTechnical2019

Ans. Design REST APIs around resources, using clear nouns, HTTP methods, status codes, pagination, filtering, versioning, and idempotency for writes where needed. Authentication should use HTTPS plus standard schemes such as OAuth2 with short-lived bearer tokens, validated on every request, with scopes or roles enforcing authorisation separately from identity.

Q. Explain JavaScript promises and error-first callbacks

asked 1xmediumProgrammingTechnical2019

Ans. JavaScript promises represent a future result of an asynchronous operation, while error-first callbacks pass an error as the first argument and the result after it. Promises move control flow into then, catch, and async or await, making chaining and centralised error handling easier than nested callbacks, which often become hard to read.

Q. How would you define the color red to a blind person?

asked 1xmediumCreative thinkingHR2021

Ans. I would define red through associations they can sense: heat, urgency, danger, and strong emotion. I might say red is the colour people use for fire, blood, stop signs, and warnings. It often feels like warmth on your skin, a racing heartbeat, or anger and passion made visible.

Q. How would you handle high pressure from your manager?

asked 1xmediumStress managementHR2016

Ans. Pick a real situation where pressure was high but manageable, such as a deadline, escalation, or changing priority. Emphasise staying calm, clarifying expectations, agreeing priorities, communicating progress, and asking for help early if needed. Interviewers listen for resilience, professionalism, ownership, and the ability to work with a demanding manager without becoming defensive.

Q. Given a string, find the longest palindromic substring

asked 1xmediumStringsTechnical2015

Ans. Use expand around centres: for each index, expand once for an odd-length palindrome and once between indices for an even-length palindrome, tracking the best start and length. The key detail is handling both centre types. This uses only a few variables, runs in O(n squared) time, and uses O(1) extra space.

Q. Explain OS concepts such as semaphores and page faults.

asked 1xmediumOperating systemsTechnical2024

Ans. Semaphores are synchronisation primitives, and page faults are virtual memory events handled by the operating system. A semaphore is a protected counter used with wait and signal operations to control access to shared resources. A page fault occurs when a process accesses a virtual page not currently in RAM, so the OS loads it or raises an error.

Q. What happens when you paste a web address in a browser?

asked 1xmediumNetworkingTechnical2015

Ans. The browser turns the address into a request, finds the server, fetches the page, and renders it. It parses the URL, uses DNS to get an IP address, opens a TCP connection and usually a TLS session, sends an HTTP request, receives HTML, CSS and JavaScript, then builds and paints the page.

Q. Explain complicated exception handling scenarios in Java

asked 1xmediumOOPTechnical2019

Ans. Complicated Java exception handling mainly involves ordering, propagation, and masking. Catch the most specific exception first, use finally for cleanup, and prefer try-with-resources because it preserves suppressed exceptions. If both try and finally throw, the finally exception can hide the original, so avoid throwing from finally unless absolutely necessary.

Q. Explain static blocks and initialization blocks in Java.

asked 1xmediumOOPTechnical2019

Ans. Static blocks initialise class-level state and run once when the class is loaded, while instance initialization blocks initialise object-level state and run every time an object is created. Static blocks can access static members only. Instance blocks run before the constructor body, after the superclass constructor, and are useful for shared constructor setup.

Q. What are the disadvantages and risks of cloud computing?

asked 1xmediumCloud computingTechnical2023

Ans. Cloud computing risks include loss of direct control, provider outages, security and privacy exposure, vendor lock-in, unpredictable costs, and compliance issues. The most important detail is shared responsibility: the provider secures the platform, but customers must still configure access, encryption, backups, monitoring, and data governance correctly to avoid breaches or downtime.

Q. Explain the differences between C, C++, Java, and Python.

asked 1xmediumOOPTechnical2019

Ans. C is procedural and low level, C++ adds object-oriented and generic programming, Java runs on a virtual machine with managed memory, and Python is high level, interpreted, and dynamically typed. The key difference is the trade-off between control and productivity: C and C++ give more control, while Java and Python simplify development.

Q. Find the weight of the heavy ball using a balance puzzle.

asked 1xmediumLogical reasoningTechnical2022

Ans. A balance scale can identify the heavier ball, but it cannot give its actual weight unless a known weight or extra information is provided. For eight balls, weigh three against three. If balanced, weigh the remaining two. If not, take the heavier group and weigh one against one; the heavier side, or the unweighed ball if balanced, is the answer.

Q. What is an API and explain the basics of cloud computing.

asked 1xmediumNetworkingTechnical2019

Ans. An API is a defined way for software systems to communicate, usually through requests and responses with clear inputs and outputs. Cloud computing means using remote servers over the internet for computing, storage, databases and services instead of owning local hardware. The key benefit is scalable, on-demand resources with managed infrastructure.

Q. Compare C, C++ and Java in terms of features and use cases.

asked 1xmediumOOPTechnical2017

Ans. C is procedural, low level and used for operating systems, embedded software and performance critical code. C++ adds object oriented and generic programming, making it common in games, trading systems and large native applications. Java is object oriented, garbage collected and platform independent through the JVM, so it suits enterprise, Android and backend services.

Q. Sort elements in a 2D array/matrix based on given criteria.

asked 1xmediumSortingOnline test2019

Ans. Flatten the matrix into a list, sort the list using the given comparator or key, then write the sorted values back into the matrix in the required order. Use an array or list to store elements temporarily. For an m by n matrix, time complexity is O(mn log(mn)) and extra space is O(mn).

Q. Can we build a website using only Java with all validations?

asked 1xmediumWeb developmentHR2019

Ans. Yes, you can build a website with Java handling the backend, business logic, database access and all server-side validations. In practice, the browser still receives HTML, CSS and usually JavaScript for the user interface. The most important point is that validation must always exist on the server, even if client-side validation is also used.

Q. Sort n numbers in the range from 0 to 2^n - 1 in linear time

asked 1xmediumSortingOnline test2015

Ans. It cannot be done in O(n) in the usual comparison model; the range bound is still too large. The input can contain n distinct values in any order, so comparison sorting needs Ω(n log n). Counting sort would take Θ(2^n), and ordinary radix sort over n-bit keys is not linear.

Q. How can you cut a cake into 8 equal pieces using only 3 cuts?

asked 1xmediumLogical reasoningHR2018

Ans. Make two straight vertical cuts through the centre of the cake at right angles, dividing it into four equal quarters. Then make one horizontal cut through the middle of the cake, parallel to the top and bottom. That splits each quarter into two equal layers, so 4 pieces become 8 equal pieces.

Q. Explain process scheduling and deadlocks in operating systems.

asked 1xmediumOperating systemsTechnical2019

Ans. Process scheduling is how the operating system chooses which ready process runs on the CPU, using policies such as round robin, priority, or shortest job first. A deadlock occurs when processes wait forever for resources held by each other. The key conditions are mutual exclusion, hold and wait, no pre-emption, and circular wait.

Q. Explain object-oriented programming concepts in Java in detail.

asked 1xmediumOOPTechnical2019

Ans. Object-oriented programming in Java organises code around objects, which combine state and behaviour through classes. The core concepts are encapsulation, inheritance, polymorphism and abstraction. Encapsulation hides data behind methods, inheritance reuses and extends classes, polymorphism lets one interface have many implementations, and abstraction exposes essential behaviour while hiding implementation details.

Q. What would you do if your boss insults you in front of everyone?

asked 1xmediumConflict resolutionHR2016

Ans. A strong answer shows you would stay calm, avoid reacting publicly, and protect the working relationship. Pick a situation where you handled criticism professionally. Emphasise listening first, asking to discuss it privately, explaining the impact respectfully, and focusing on the work. Interviewers listen for maturity, self-control, confidence, and conflict management.

Q. Given multiple workplace scenarios and a list of tasks, how would you prioritize the tasks?

asked 1xmediumLogical reasoningOnline test2020

Ans. Prioritise tasks by urgency, importance, impact, and dependencies. First identify any safety, legal, customer, or deadline-critical work. Then rank tasks that enable others or prevent delays. Estimate effort and choose quick high-value actions where possible. If priorities conflict, clarify with the manager and communicate any trade-offs or delays.

Q. Tell me about a situation where you had to go against your ethics and principles. How did you handle it?

asked 1xmediumIntegrityHR2019

Ans. Choose a situation where your values were challenged, not one where you seriously breached ethics. Emphasise how you recognised the issue, sought advice, raised concerns respectfully, and chose the least harmful or most compliant path. Interviewers listen for integrity, judgement under pressure, accountability, and whether you would speak up rather than blindly comply.

Q. Given several balls where all have equal weight except one heavier ball, identify the heavier ball using a balance scale in minimum number of weighings.

asked 1xmediumLogical reasoningTechnical2024

Ans. Divide the balls into three groups as equal as possible. Weigh two groups against each other. If they balance, the heavier ball is in the unweighed group. If not, it is in the heavier side. Repeat the same process on the suspect group. The minimum number of weighings is ceiling of log base 3 of the number of balls.

Q. Calculate the total distance travelled by a bee flying back and forth between two moving objects until they meet (variant of the classic bee distance puzzle).

asked 1xmediumLogical reasoningTechnical2024

Ans. Find the time until the two objects meet, then multiply by the bee’s speed. If the objects start distance d apart and move towards each other at speeds a and b, meeting time is d divided by a plus b. The bee’s total distance is bee speed times that time.

Showing 60 of 275 questions. Ranked by how often the same question came back across interviews.

Practise a HSBC-style interview

A spoken interview built from these questions, scored when you finish; the feedback is yours.

Start practising

When you are ready, record The One: a single interview hiring teams watch, so you stop repeating first rounds.

Common questions

What questions does HSBC ask?

Candidate interviews most often cover CS fundamentals (53%) and DSA (32%).

How many rounds does HSBC interview have?

Candidate interviews show an average of 4.0 rounds per experience, with a typical sequence of Online test → HR → Technical → HR. Individual interview paths can vary.

Is the HSBC interview hard?

Among questions with a recorded difficulty, the mix is easy 55%, medium 43%, hard 2%.