HSBC Group
10+ Resurgent India Interview Questions and Answers
Q1. Palindromic Linked List Problem Statement
Given a singly linked list of integers, determine if it is a palindrome. Return true if it is a palindrome, otherwise return false.
Example:
Input:
1 -> 2 -> 3 -> 2 -> ...read more
Check if a given singly linked list of integers is a palindrome or not.
Traverse the linked list to find the middle element using slow and fast pointers.
Reverse the second half of the linked list.
Compare the first half with the reversed second half to determine if it is a palindrome.
Example: Input: 1 -> 2 -> 3 -> 2 -> 1 -> NULL, Output: true
Q2. Search in a 2D Matrix
Given a 2D matrix MAT
of size M x N, where M and N represent the number of rows and columns respectively. Each row is sorted in non-decreasing order, and the first element of each row is g...read more
Implement a function to search for a target integer in a 2D matrix with sorted rows.
Iterate through each row of the matrix and perform a binary search on each row to find the target integer.
Start the binary search by considering the entire row as a sorted array.
If the target is found in any row, return 'TRUE'; otherwise, return 'FALSE'.
Q3. Maximum Level Sum in a Binary Tree
Given a Binary Tree with integer nodes, determine the maximum level sum among all the levels in the tree. The sum for a level is defined as the sum of all node values present ...read more
Find the maximum level sum in a binary tree by calculating the sum of nodes at each level.
Traverse the binary tree level by level and calculate the sum of nodes at each level.
Keep track of the maximum level sum encountered so far.
Return the maximum level sum as the final result.
Q4. Reverse Linked List Problem Statement
Given a Singly Linked List of integers, your task is to reverse the Linked List by altering the links between the nodes.
Input:
The first line of input is an integer T, rep...read more
Reverse a singly linked list by altering the links between nodes.
Iterate through the linked list and reverse the links between nodes.
Keep track of the previous, current, and next nodes while reversing the links.
Update the head of the linked list to the last node after reversal.
Q5. Power Calculation Problem Statement
Given a number x
and an exponent n
, compute xn
. Accept x
and n
as input from the user, and display the result.
Note:
You can assume that 00 = 1
.
Input:
Two integers separated...read more
Calculate x raised to the power of n. Handle edge case of 0^0 = 1.
Accept x and n as input from user
Compute x^n and display the result
Handle edge case of 0^0 = 1
Ensure x is between 0 and 8, n is between 0 and 9
Q6. Inversion Count Problem
Given an integer array ARR
of size N
with all distinct values, determine the total number of 'Inversions' that exist.
Explanation:
An inversion is a pair of indices (i, j)
such that:
AR...read more
Count the total number of inversions in an integer array.
Iterate through the array and for each element, check how many elements to its right are smaller than it.
Use a merge sort based approach to efficiently count the inversions.
Keep track of the count of inversions while merging the sorted subarrays.
Example: For input [2, 4, 1, 3, 5], there are 3 inversions: (2, 1), (4, 1), and (4, 3).
Q7. Palindrome Linked List Problem Statement
You are provided with a singly linked list of integers. Your task is to determine whether the given singly linked list is a palindrome. Return true
if it is a palindrome...read more
Check if a given singly linked list is a palindrome or not.
Traverse the linked list to find the middle element using slow and fast pointers.
Reverse the second half of the linked list.
Compare the first half with the reversed second half to determine if it's a palindrome.
Abstract class can have both abstract and non-abstract methods, while interface can only have abstract methods.
Abstract class can have method implementations, while interface cannot.
A class can implement multiple interfaces, but can only inherit from one abstract class.
Interfaces are used to define contracts for classes to implement, while abstract classes are used to provide a common base for subclasses.
Example: Abstract class 'Shape' with abstract method 'calculateArea' and...read more
Overloading is having multiple methods in the same class with the same name but different parameters. Overriding is implementing a method in a subclass that is already present in the superclass.
Overloading involves multiple methods with the same name but different parameters
Overriding involves implementing a method in a subclass that is already present in the superclass
Overloading is determined at compile time, while overriding is determined at runtime
DELETE removes specific rows from a table, while TRUNCATE removes all rows and resets auto-increment values.
DELETE is a DML command, while TRUNCATE is a DDL command.
DELETE can be rolled back, while TRUNCATE cannot be rolled back.
DELETE triggers ON DELETE triggers, while TRUNCATE does not trigger any triggers.
DELETE is slower as it logs individual row deletions, while TRUNCATE is faster as it deallocates data pages.
Example: DELETE FROM table_name WHERE condition; TRUNCATE tabl...read more
Normalization is the process of organizing data in a database to reduce redundancy and improve data integrity. Denormalization is the opposite process.
Normalization involves breaking down data into smaller, more manageable tables to reduce redundancy.
Denormalization involves combining tables to improve query performance.
Normalization helps maintain data integrity by reducing the risk of anomalies.
Denormalization can improve read performance but may lead to data redundancy.
Exa...read more
Static polymorphism refers to the mechanism where the method to be called is determined at compile time.
Method overloading is an example of static polymorphism where the method to be called is resolved at compile time based on the method signature.
Compile-time polymorphism is another term for static polymorphism.
Static polymorphism is achieved through function overloading and operator overloading.
Private and special IP addresses are reserved ranges of IP addresses used for specific purposes.
Private IP addresses are used within a private network and are not routable on the internet.
Special IP addresses include loopback address (127.0.0.1) and broadcast address (255.255.255.255).
Private IP ranges include 10.0.0.0 to 10.255.255.255, 172.16.0.0 to 172.31.255.255, and 192.168.0.0 to 192.168.255.255.
The OSI Reference Model defines 7 layers that represent different functions in networking.
Physical Layer - deals with physical connections and signals (e.g. cables, hubs)
Data Link Layer - manages data transfer between devices on the same network (e.g. Ethernet)
Network Layer - handles routing and forwarding of data packets (e.g. IP)
Transport Layer - ensures reliable data delivery (e.g. TCP)
Session Layer - establishes, maintains, and terminates connections (e.g. SSL)
Presentatio...read more
Q15. What concepts do you know in Cybersecurity?
I am familiar with concepts such as encryption, network security, access control, and security protocols.
Encryption methods such as AES, RSA, and DES
Network security practices like firewalls, VPNs, and intrusion detection systems
Access control mechanisms like role-based access control (RBAC) and multi-factor authentication
Security protocols such as SSL/TLS, IPsec, and SSH
Q16. DBMS Keys - Composite Key, Primary Key vs Unique Key
Composite key is a combination of multiple columns to uniquely identify a record, while primary key is a unique identifier for a record and unique key allows only unique values.
Composite key is made up of multiple columns to uniquely identify a record
Primary key is a unique identifier for a record and cannot have duplicate values
Unique key allows only unique values but can have null values
Q17. Please explain the Quick Sort algorithm and its process of reallocation.
Quick Sort is a popular sorting algorithm that uses divide and conquer strategy to sort elements in an array.
Quick Sort picks a pivot element and partitions the array around the pivot.
It recursively sorts the sub-arrays on either side of the pivot.
The process continues until the entire array is sorted.
Example: Given array [5, 2, 9, 3, 7], after Quick Sort it becomes [2, 3, 5, 7, 9].
Q18. Write code of react for login page
Code for a login page in React
Create a form component with input fields for username and password
Handle form submission and validation
Use state to store user input and handle login functionality
Top HR Questions asked in Resurgent India
Interview Process at Resurgent India
Top Software Engineer Trainee Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month