BNY
20+ Britania Interview Questions and Answers
Q1. Palindromic Substrings Problem Statement
You are given a string 'STR'. Your task is to determine the total number of palindromic substrings present in 'STR'.
Example:
Input:
"abbc"
Output:
5
Explanation:
The pa...read more
Count the total number of palindromic substrings in a given string.
Iterate through each character in the string and expand around it to find palindromic substrings.
Use dynamic programming to store the results of subproblems to avoid redundant calculations.
Consider both odd and even length palindromes while counting.
Example: For input 'abbc', the palindromic substrings are ['a', 'b', 'b', 'c', 'bb'], totaling 5.
Q2. Minimum Number of Taps to Water the Garden
Given a garden that extends along a one-dimensional x-axis from point 0 to point N, your task is to determine the minimum number of taps needed to water the entire gar...read more
Find the minimum number of taps needed to water the entire garden with given tap ranges.
Iterate over each tap and find the maximum range it can cover.
Sort the taps based on their starting point and ending point.
Use a greedy approach to select the taps that cover the maximum range possible.
Q3. Cycle Detection in a Singly Linked List
Determine if a given singly linked list of integers forms a cycle or not.
A cycle in a linked list occurs when a node's next
points back to a previous node in the list. T...read more
Detect if a singly linked list forms a cycle by checking if a node's next points back to a previous node.
Use Floyd's Cycle Detection Algorithm to determine if there is a cycle in the linked list.
Maintain two pointers, one moving at twice the speed of the other, if they meet at some point, there is a cycle.
If one of the pointers reaches the end of the list (null), then there is no cycle.
Q4. KMP Search Algorithm
KMP Search Algorithm is a string searching algorithm that finds occurrences of a word within a main text.
KMP algorithm is based on the idea of pre-processing the pattern to avoid unnecessary comparisons.
It uses a prefix function to determine the longest proper prefix of the pattern that is also a suffix.
This allows the algorithm to skip characters in the text that cannot be part of the pattern, improving efficiency.
Q5. Ways To Make Coin Change
Given an infinite supply of coins of varying denominations, determine the total number of ways to make change for a specified value using these coins. If it's not possible to make the c...read more
The task is to find the total number of ways to make change for a specified value using given denominations.
Use dynamic programming to keep track of the number of ways to make change for each value up to the target value.
Iterate through each denomination and update the number of ways to make change for each value based on the current denomination.
The final answer will be the number of ways to make change for the target value.
Consider edge cases such as when the target value i...read more
Q6. Minimum Operations Problem Statement
You are given an array 'ARR'
of size 'N'
consisting of positive integers. Your task is to determine the minimum number of operations required to make all elements in the arr...read more
The minimum operations problem involves finding the minimum number of operations required to make all elements in an array equal.
Iterate through the array to find the maximum and minimum values.
Calculate the difference between the maximum and minimum values.
The minimum number of operations needed is the difference between the maximum and minimum values.
Q7. Count Ways to Reach the N-th Stair Problem Statement
You are provided with a number of stairs, and initially, you are located at the 0th stair. You need to reach the Nth stair, and you can climb one or two step...read more
The problem involves finding the number of distinct ways to climb N stairs by taking 1 or 2 steps at a time.
Use dynamic programming to solve the problem efficiently.
The number of ways to reach the Nth stair is the sum of the number of ways to reach the (N-1)th stair and the (N-2)th stair.
Handle base cases for N=0 and N=1 separately.
Consider using modulo operation to avoid overflow when dealing with large numbers.
Q8. Merge Sort Problem Statement
You are given a sequence of numbers, ARR
. Your task is to return a sorted sequence of ARR
in non-descending order using the Merge Sort algorithm.
Explanation:
The Merge Sort algorit...read more
Implement Merge Sort algorithm to sort a sequence of numbers in non-descending order.
Implement the Merge Sort algorithm which recursively divides the input array into two halves and then merges them in sorted order.
Ensure the base case of the recursion is when the size of the array is 1.
Time complexity of Merge Sort is O(n log n) and space complexity is O(n).
Example: For input [3, 1, 4, 1, 5], the output should be [1, 1, 3, 4, 5].
Q9. Tell me about shares and bonds
Shares and bonds are types of investments. Shares represent ownership in a company, while bonds are debt securities issued by governments or corporations.
Shares represent ownership in a company, giving the shareholder voting rights and potential dividends.
Bonds are debt securities issued by governments or corporations, where the issuer promises to repay the bondholder the principal amount plus interest at a specified date.
Shares are considered riskier but offer higher potenti...read more
Q10. Merge Two Sorted Linked Lists Problem Statement
You are provided with two sorted linked lists. Your task is to merge them into a single sorted linked list and return the head of the combined linked list.
Input:...read more
Merge two sorted linked lists into a single sorted linked list without using additional space.
Create a dummy node to start the merged list
Compare the values of the two linked lists and add the smaller value to the merged list
Move the pointer of the merged list and the respective linked list with the smaller value
Continue this process until one of the linked lists is fully traversed
Append the remaining elements of the other linked list to the merged list
Q11. Pattern Matching Problem Statement
Given a pattern as a string and a set of words, determine if the pattern and the words list align in the same sequence.
Input:
T (number of test cases)
For each test case:
patte...read more
Given a pattern and a list of words, determine if the words align with the pattern.
Iterate through the pattern and words simultaneously to check for alignment.
Use a hashmap to store the mapping between characters in the pattern and words.
Return 'True' if the words match the pattern sequence, else return 'False'.
The low-level design of an e-commerce website involves detailing the architecture, components, and interactions of the system.
Define the architecture including front-end, back-end, and database components
Detail the interactions between components such as user authentication, product search, and payment processing
Consider scalability, security, and performance optimizations in the design
Include features like user profiles, shopping cart functionality, and order management
Utili...read more
Q13. What are the key concepts of computer science and data structures and algorithms that are commonly evaluated in interviews?
Key concepts in computer science and data structures commonly evaluated in interviews.
Data structures: arrays, linked lists, stacks, queues, trees, graphs
Algorithms: sorting algorithms (e.g. quicksort, mergesort), searching algorithms (e.g. binary search), dynamic programming, recursion
Complexity analysis: time complexity (Big O notation), space complexity
Object-oriented programming concepts: inheritance, polymorphism, encapsulation
Problem-solving skills: ability to break dow...read more
Q14. what is adressing mode and its types
Addressing mode is a technique used in computer architecture to specify how to calculate the effective address of an operand.
Addressing mode determines how the CPU accesses data from memory
Types of addressing modes include direct, indirect, indexed, and register
Examples: direct addressing mode - MOV A, 1000H, indirect addressing mode - MOV A, [BX], indexed addressing mode - MOV A, [BX+SI], register addressing mode - MOV A, BX
Q15. What is corporate action and its type ?
Corporate action refers to events initiated by a public company that impact its shareholders and securities.
Types of corporate actions include dividends, stock splits, mergers and acquisitions, rights issues, and bonus issues.
Dividends are payments made to shareholders from a company's profits.
Stock splits involve dividing existing shares into multiple shares to lower the share price.
Mergers and acquisitions are when two companies combine or one company takes over another.
Rig...read more
Q16. what is tcp osi difference
TCP is a transport layer protocol while OSI is a reference model for network communication.
TCP is a protocol responsible for establishing and maintaining a connection between two devices.
OSI is a conceptual framework that standardizes the functions of a telecommunication or computing system into seven abstraction layers.
TCP operates at the transport layer (Layer 4) of the OSI model.
OSI model includes layers like physical, data link, network, transport, session, presentation, ...read more
Q17. What is the most difficult accounting situation you handled
The most difficult accounting situation I handled was resolving a complex financial discrepancy in a multinational company.
Identifying and reconciling discrepancies in financial records
Coordinating with multiple departments and stakeholders
Analyzing large volumes of data to identify the root cause
Implementing corrective measures to prevent future discrepancies
Ensuring compliance with accounting standards and regulations
Q18. reverse linkedlist in 3 steps
Iterate through the linked list and reverse the pointers in 3 steps
Iterate through the linked list and keep track of the previous, current, and next nodes
Update the pointers to reverse the direction of the nodes
Repeat the process until the end of the linked list is reached
Q19. What is derivative?
A derivative is a financial contract whose value is derived from the performance of an underlying asset, index, or interest rate.
Derivatives can be used for hedging, speculation, or arbitrage.
Common types of derivatives include options, futures, forwards, and swaps.
For example, a stock option gives the holder the right to buy or sell a stock at a specified price within a certain time frame.
Q20. Write a SQL code to union two tables with ID not present in another table
Q21. What do you mean by cascade
Cascade refers to the automatic propagation of changes made to a parent record to its related child records.
Cascade is a feature in database management systems that ensures data consistency and integrity.
It allows changes made to a parent record to be automatically reflected in its related child records.
For example, if a parent record is deleted, all its child records will also be deleted automatically.
Cascade can be set up for various types of actions, such as update, delete...read more
Q22. What do mean by derivatives
Derivatives are financial instruments whose value is derived from an underlying asset or group of assets.
Derivatives can be used for hedging risk, speculating on price movements, or gaining exposure to assets without owning them.
Common types of derivatives include options, futures, forwards, and swaps.
Derivatives can be traded on exchanges or over-the-counter (OTC).
They are often used by investors, companies, and financial institutions to manage risk or enhance returns.
Q23. Difference between delete and truncate
Delete removes specific rows while truncate removes all rows from a table.
Delete is a DML command while truncate is a DDL command.
Delete can be rolled back while truncate cannot be rolled back.
Delete is slower than truncate as it logs each row deletion while truncate does not.
Delete can have a WHERE clause to specify which rows to delete while truncate deletes all rows.
Delete does not reset the identity of the table while truncate resets the identity of the table.
Example: DEL...read more
Q24. SQL to union two Tables
Top HR Questions asked in Britania
Interview Process at Britania
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month