
HSBC Group


10+ HSBC Group Software Developer Interview Questions and Answers
Q1. Contains Duplicate Problem Statement
Given an array of integers ARR
and an integer K
, determine if there exist two distinct indices i
and j
such that ARR[i] == ARR[j]
and | i - j | <= K
.
Input:
The first line c...read more
Given an array of integers and an integer K, determine if there exist two distinct indices i and j such that ARR[i] == ARR[j] and | i - j | <= K.
Iterate through the array and keep track of the indices of each element using a hashmap.
Check if the current element already exists in the hashmap within a distance of K.
Return 'Yes' if a pair of such indices exists, otherwise return 'No'.
The data structures used for implementing an LRU cache are doubly linked list and hash map.
Doubly linked list is used to maintain the order of recently used elements.
Hash map is used for fast lookups to check if an element is present in the cache or not.
When a new element is accessed, it is moved to the front of the linked list to indicate it as the most recently used.
Functional dependency is a relationship between attributes in a database table, while transitive dependency occurs when an attribute is functionally dependent on another attribute.
Functional dependency: A determines B, where the value of A uniquely determines the value of B.
Transitive dependency: A determines B, and B determines C, therefore A indirectly determines C.
Example of functional dependency: Employee ID determines Employee Name.
Example of transitive dependency: Emplo...read more
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity.
Normalization is used to eliminate data redundancy and ensure data integrity.
There are different normal forms such as 1NF, 2NF, 3NF, BCNF, and 4NF.
Each normal form has specific rules to follow in order to achieve it.
For example, 1NF ensures that each column contains atomic values, 2NF eliminates partial dependencies, and 3NF removes transitive dependencies.
A bootstrap program is a small program that initializes the operating system during the boot process.
Bootstrap program is the first code that runs when a computer is turned on.
It loads the operating system kernel into memory and starts its execution.
It performs hardware checks, sets up memory, and initializes system components.
Examples include GRUB for Linux and NTLDR for Windows.
Q6. What is DBMS and RDBMS and difference between them?
DBMS stands for Database Management System, while RDBMS stands for Relational Database Management System. RDBMS is a type of DBMS.
DBMS is a software system that allows users to define, create, maintain and control access to the database.
RDBMS is a type of DBMS that stores data in a structured format using tables with rows and columns.
RDBMS enforces a set of rules called ACID properties to ensure data integrity, while DBMS may not necessarily enforce these rules.
Examples of DB...read more
Q7. What are the 4 pillars of OOPs?
Encapsulation, Inheritance, Polymorphism, Abstraction
Encapsulation: Bundling data and methods that operate on the data into a single unit
Inheritance: Ability of a class to inherit properties and behavior from another class
Polymorphism: Ability to present the same interface for different data types
Abstraction: Hiding the complex implementation details and showing only the necessary features
Q8. What is Object oriented programming?
Object oriented programming is a programming paradigm based on the concept of objects, which can contain data and code.
Objects are instances of classes, which define the structure and behavior of the objects.
Encapsulation, inheritance, and polymorphism are key principles of object oriented programming.
Example: Inheritance allows a class to inherit properties and methods from another class.
Example: Encapsulation hides the internal state of an object and only exposes necessary ...read more
A stack follows Last In First Out (LIFO) order while a queue follows First In First Out (FIFO) order.
Stack: elements are added and removed from the top (like a stack of plates)
Queue: elements are added at the rear and removed from the front (like a line of people)
Stack: push() and pop() operations
Queue: enqueue() and dequeue() operations
Example: Undo functionality in text editors (stack) vs. printer queue (queue)
Q10. Write down code implementing all 4 pillars of OOPs.
Code implementing all 4 pillars of OOPs
Encapsulation: Encapsulate data within classes and provide public methods to access and modify the data.
Inheritance: Create a hierarchy of classes where child classes inherit attributes and methods from parent classes.
Polymorphism: Allow objects of different classes to be treated as objects of a common superclass through method overriding and overloading.
Abstraction: Hide complex implementation details and only show the necessary feature...read more
Q11. What is SQL and who its different from mySQL?
SQL is a standard language for managing databases, while MySQL is a specific open-source relational database management system.
SQL stands for Structured Query Language and is used to communicate with databases.
SQL is a standard language that can be used with various database management systems.
MySQL is a specific open-source relational database management system that uses SQL.
MySQL is one of the most popular database management systems that uses SQL for querying and managing ...read more
Q12. Write a code to find the 2nd largest element in an array.
Code to find the 2nd largest element in an array
Sort the array in descending order and return the element at index 1
Iterate through the array and keep track of the two largest elements
Handle edge cases like arrays with less than 2 elements
Q13. Difference between C and C++?
C is a procedural programming language while C++ is an object-oriented programming language.
C is a procedural programming language, while C++ supports both procedural and object-oriented programming.
C does not have classes and objects, while C++ does.
C does not support function overloading, while C++ does.
C does not have exception handling, while C++ does.
C does not have namespaces, while C++ does.
Q14. Difference between Delete, Truncate and Drop?
Delete removes specific rows from a table, Truncate removes all rows from a table, and Drop removes the table itself.
Delete is a DML command that removes specific rows from a table based on a condition.
Truncate is a DDL command that removes all rows from a table but keeps the table structure.
Drop is a DDL command that removes the entire table along with its structure.
Q15. What is merge sort and its Algorithm ?
Merge sort is a divide and conquer algorithm that divides the input array into two halves, sorts them recursively, and then merges them.
Divide the input array into two halves
Recursively sort each half
Merge the sorted halves back together
Q16. Different kind of Joins in DBMS ?
Different types of joins in DBMS include inner join, outer join, left join, right join, and full join.
Inner join: Returns rows when there is a match in both tables.
Outer join: Returns all rows from one table and only matching rows from the other table.
Left join: Returns all rows from the left table and the matched rows from the right table.
Right join: Returns all rows from the right table and the matched rows from the left table.
Full join: Returns rows when there is a match i...read more
Q17. Difference between Stacks and Queues?
Stacks are Last In First Out (LIFO) data structures, while Queues are First In First Out (FIFO) data structures.
Stacks: Elements are added and removed from the same end, like a stack of plates. Example: Undo feature in text editors.
Queues: Elements are added at the rear and removed from the front, like a line of people waiting. Example: Print queue in a printer.
Q18. Throw vs throw ex
throw vs throw ex is used in exception handling in C#
throw is used to rethrow the current exception without losing the original stack trace
throw ex is used to throw a new exception while preserving the original exception information
It is recommended to use throw without specifying ex to avoid losing important exception details
Interview Process at HSBC Group Software Developer

Top Software Developer Interview Questions from Similar Companies








Reviews
Interviews
Salaries
Users/Month

