Goldman Sachs
70+ Globe Capacitors Interview Questions and Answers
Q1. Ninja and the Game of Words
In this game, Ninja is provided with a string STR
that might contain spaces, and a list or array WORDS
consisting of N
word strings. Ninja's task is to determine how many times each ...read more
Q2. Wildcard Pattern Matching Problem Statement
Implement a wildcard pattern matching algorithm to determine if a given wildcard pattern matches a text string completely.
The wildcard pattern may include the charac...read more
Q3. Digits Decoding Problem
Ninja has a string of characters from 'A' to 'Z', encoded using their numeric values (A=1, B=2, ..., Z=26). The encoded string is given as a sequence of digits (SEQ). The task is to dete...read more
Q4. Good old standard problem: Playing number game with your friend to select any of the number between 1 to 3. Whoever reaches 20 first, wins. You have to tell the strategy to win the game. Basically, you start wi...
read moreThe strategy is to always subtract the number chosen by the friend from 4 to ensure reaching 16 first.
Start with 20 and subtract the number chosen by the friend from 4.
Continue this strategy until reaching 16 before the friend reaches 17-19.
Ensure the friend ends up at any number between 17 to 19 before reaching 16.
Q5. Chocolate Distribution Problem
You are given an array/list CHOCOLATES
of size 'N', where each element represents the number of chocolates in a packet. Your task is to distribute these chocolates among 'M' stude...read more
Q6. Gold Mine Problem Statement
You are provided with a gold mine, represented as a 2-dimensional matrix of size N x M with N rows and M columns. Each cell in this matrix contains a positive integer representing th...read more
Q7. Group Anagrams Together
Given an array/list of strings STR_LIST
, group the anagrams together and return each group as a list of strings. Each group must contain strings that are anagrams of each other.
Example:...read more
Q8. Greatest Common Divisor Problem Statement
You are tasked with finding the greatest common divisor (GCD) of two given numbers 'X' and 'Y'. The GCD is defined as the largest integer that divides both of the given...read more
Q9. Given a tank with liquid, and there are flows in and out, inflow is U and outflow is Kx, where x is current height of liquid in tank, all needed quantities given, what are the conditions for overflow and steady...
read moreConditions for overflow and steady state in a tank with inflow and outflow
Overflow occurs when the inflow rate is greater than the outflow rate
Steady state is achieved when the inflow rate equals the outflow rate
Overflow can be prevented by adjusting the inflow rate or increasing the outflow rate
Steady state can be maintained by balancing the inflow and outflow rates
Q10. Boyer Moore Algorithm for Pattern Searching
You are given a string text
and a string pattern
. Your task is to find all occurrences of pattern
in the string text
and return an array of indexes of all those occur...read more
Q11. Maximum Subarray Sum Problem Statement
Given an array ARR
consisting of N
integers, your goal is to determine the maximum possible sum of a non-empty contiguous subarray within this array.
Example of Subarrays:...read more
Q12. Circular Tour Problem Statement
Consider a circular path with N petrol pumps. Each pump is numbered from 0 to N-1. Every petrol pump provides:
- The amount of petrol available at the pump.
- The distance to the ne...read more
Q13. Given we have a (un)biased die, with given probabilities, and we toss it till we get a sum of 100 or more (basically if the sum crosses 100), and we stop. What is the most probable number you will get on the la...
read moreThe most probable number on the last toss is 6.
The probability of getting a sum of 100 or more is highest when the sum is 99.
The last toss will be made to reach the sum of 100, so the most probable number is the one that will take the sum closest to 100.
The sum of 94 can be achieved by rolling a 6 on the last toss, which is the most probable number.
Q14. LRU Cache Design Question
Design a data structure for a Least Recently Used (LRU) cache that supports the following operations:
1. get(key)
- Return the value of the key if it exists in the cache; otherwise, re...read more
Q15. Shortest Path in a Binary Matrix Problem Statement
Given a binary matrix of size N * M
where each element is either 0 or 1, find the shortest path from a source cell to a destination cell, consisting only of 1s...read more
Q16. Suppose a man starts at 0, and has to go to 20 on the number line. He can either move in steps of 1 or 2. How many number of ways can he do this? Extending this, if we know the number of ways for going from 0 t...
read moreCount number of ways to reach 20 on number line starting from 0 in steps of 1 or 2. Derive recursive formula for n+1.
Use dynamic programming to count number of ways for each step.
For each step, number of ways is sum of number of ways for previous 1 or 2 steps.
Recursive formula: ways[n+1] = ways[n] + ways[n-1]
Q17. If you are asked to play a game where you toss a fair coin again and again until you get consecutive heads and win Re. 1 or you get consecutive tails and lose and quit, how much will you be willing to pay to pl...
read moreI would be willing to pay 50 paise to play this game.
The expected value of the game is 50 paise.
This is because the probability of getting consecutive heads is 1/3 and the probability of getting consecutive tails is 1/4.
Therefore, the expected value of the game is (1/3 * 1) - (1/4 * 1) = 1/12 = 8.33 paise.
However, since the minimum amount that can be won is Re. 1, I would be willing to pay 50 paise to play the game.
Q18. There is an urn with n red balls and 1 black ball in it. You and your friend play a game where you take turns drawing from the urn. The player who draws the black ball first wins. Should you go first or second?
Go second. The probability of winning is higher when going second.
The probability of winning when going first is (1/n+1), while the probability of winning when going second is (n/n+1)
This is because the first player has a chance of drawing the black ball on their turn, while the second player has a chance of drawing the black ball on their turn or the first player's turn
For example, if there are 10 red balls and 1 black ball, the probability of winning when going first is 1/1...read more
Q19. Suppose there are N chocolates, and I pick a random one, and eat that chocolate and also everything to the right of it. I then continue this process with the remaining. How many ways are there to do this?
There are (N-1)! ways to eat chocolates from left to right.
The first chocolate can be chosen in N ways, the second in (N-1) ways, and so on.
However, since the order of chocolates eaten matters, we need to divide by the number of ways to order N chocolates, which is N!.
Therefore, the total number of ways to eat chocolates is (N-1)!
For example, if N=4, there are 3! = 6 ways to eat the chocolates.
Q20. Given 3 functions, f which gives the first day of the current month, g gives the next working day and h gives the previous working day, conpute the 3rd working day? Compute the 2nd working day of the previous m...
read moreCompute working days using given functions f, g, and h.
To compute the 3rd working day, apply function g three times to function f.
To compute the 2nd working day of the previous month, apply function h to function f, then apply function g twice.
To compute the 4th working day of the next month, apply function g four times to function f.
Q21. An IT sector multinational wants to expand its business into more countries. Suggest a strategy. This was the question given in the VC round by the Partner. It was followed by a lot of numerical and qualitative...
read moreTo expand into more countries, the IT sector multinational can adopt a market entry strategy that includes market research, partnerships, localization, and scalability.
Conduct thorough market research to identify potential countries for expansion
Establish strategic partnerships with local companies to leverage their knowledge and networks
Adapt products and services to meet the specific needs and preferences of each target market
Ensure scalability of operations to handle the i...read more
Q22. Suppose you and I are playing a dice game. The one who get the lesser number looses the games. The dice has n sides. If I start the game, what is the probablity of you winning?
Probability of winning a dice game where the one with lesser number wins.
The probability of winning depends on the number of sides on the dice.
If the dice has an odd number of sides, the probability of winning is higher for the second player.
If the dice has an even number of sides, the probability of winning is equal for both players.
Q23. There is a 2D plane with infinite parallel, vertical lines with a spacing of 1 unit between them. You drop a rod of length L randomly on the plane, with random position and orientation. What is the probability...
read moreProbability of a randomly dropped rod of length L intersecting a line on a 2D plane with infinite parallel, vertical lines.
The probability depends on the length of the rod L.
The probability can be calculated using geometric probability.
The probability is 1 - (2L - 1) / infinity.
For example, if L = 1, the probability is 0.5.
If L = 2, the probability is 0.75.
Q24. Given a biased coin, how do you create an unbiased toss?
Flip the coin twice and consider the outcome as follows.
Flip the coin twice and consider the outcome as follows:
- If both flips are heads or both are tails, discard and flip again.
- If the first flip is heads and the second is tails, consider it as heads.
- If the first flip is tails and the second is heads, consider it as tails.
This method ensures a 50-50 chance of getting either heads or tails.
Alternatively, use a physical method to balance the weight distribution of the coi...read more
Q25. Given a number line, and we have a rod of length L. We drop the rod on the line, what is the probability that it covers an integer?
Probability of a rod of length L covering an integer on a number line.
The probability depends on the length of the rod and the distance between adjacent integers on the number line.
If the length of the rod is less than the distance between adjacent integers, the probability is zero.
If the length of the rod is greater than or equal to the distance between adjacent integers, the probability is (L - d)/d, where d is the distance between adjacent integers.
The probability can be c...read more
Q26. Supposed there is a party, with 9 people, each person wants to give gifts to 3 people and also wants a gift from them. Is this scenario possible? If not, when is this possible? Give me a general case
No, it is not possible for each person to give gifts to 3 people and receive a gift from them in a party of 9 people.
In this scenario, each person would need to receive 3 gifts, which is not possible if there are only 9 people.
This scenario would be possible if there were at least 10 people at the party.
In general, for a party of n people, each person can give gifts to n-1 people and receive gifts from n-1 people.
Q27. 1. What is the probability that a person starting at 1 and who takes single steps ahead/back with equal probabilities reach 0 before 100?
The probability is 1/2.
The person can either move forward or backward with equal probabilities.
The probability of reaching 0 before 100 is 1/2.
This is a simple random walk problem.
Q28. You have an n x n matrix in which all the rows and all the columns are sorted. Given an input number, describe an algorithm to search for the number in the matrix
Algorithm to search for a number in an n x n matrix with sorted rows and columns.
Start from the top-right corner of the matrix
If the current element is greater than the target, move left
If the current element is less than the target, move down
Repeat until the target is found or the bottom-left corner is reached
Q29. Is the price of a barrier option more or less than a normal option?
The price of a barrier option is generally less than a normal option.
Barrier options have a condition that must be met for the option to be activated, which reduces the likelihood of the option being exercised.
This reduced likelihood of exercise means that barrier options are generally cheaper than normal options.
However, the price of a barrier option can vary depending on the specific conditions and terms of the option.
For example, a knock-in barrier option may be more expen...read more
Q30. You roll a die until the sum of all die rolls becomes at least 100. What is the most likely value of the last roll?
What is the most likely value of the last roll in a game where a die is rolled until the sum of all rolls is at least 100?
The last roll must be at least 4 to reach a sum of 100
The probability of rolling a 4, 5, or 6 is 1/2
The most likely value of the last roll is 4 or 5
Q31. Given coordinates of some points, find a figure that encompasses all of the points. The figure should have the least possible area and be formed by joining points using straight lines. Convex Hull.
The Convex Hull is the smallest convex polygon that encloses all given points.
Sort the points based on their x-coordinate.
Find the upper hull by starting from the leftmost point and moving clockwise.
Find the lower hull by starting from the rightmost point and moving counterclockwise.
Combine the upper and lower hulls to form the convex hull.
Q32. If I have to buy fuel from you, what option would I buy?
You can buy fuel from us through our fuel card program.
We offer a fuel card program that allows you to purchase fuel from our network of stations.
Our fuel card program offers discounts and rewards for frequent users.
You can easily track your fuel expenses and usage through our online portal.
We also offer customized fuel solutions for businesses and fleets.
Our fuel is high-quality and meets all industry standards.
Q33. If we increase the volatility of the stock, how does the price of a call option change?
Increasing stock volatility increases the price of a call option.
Higher volatility means higher potential for the stock to move in the option holder's favor, increasing the option's value
The option's delta and gamma will also increase with higher volatility
Example: If a call option on a stock with a strike price of $50 has a premium of $2 when the stock has a volatility of 20%, increasing the volatility to 30% may increase the premium to $2.50 or higher
Q34. Find the magic number in an sorted array. magic number is the one whose value and index position is same
Find the magic number in a sorted array where value and index are same.
Iterate through the array and check if the value and index are same
If found, return the value
If not found, return -1
Q35. Clarification about what CPI stands(Is it the same as Grade Point Average?)
CPI stands for Consumer Price Index, not the same as Grade Point Average (GPA).
CPI is a measure of the average change over time in the prices paid by urban consumers for a market basket of consumer goods and services.
It is used to track inflation and price changes in the economy.
GPA, on the other hand, is a measure of academic performance and represents a student's average grade point across courses.
CPI and GPA are completely different concepts and have no relation to each ot...read more
Q36. How many years will it take the Delhi Metro to break even?
The Delhi Metro is expected to break even in 2025.
The Delhi Metro has been expanding rapidly and has seen a steady increase in ridership.
The metro has been able to generate revenue through advertising and property development.
The government has also provided financial support to the metro.
Based on current projections, the Delhi Metro is expected to break even in 2025.
Q37. Dice rolled several times until sum of outcomes till now comes greater than equal to hundred. What is most likely number to occur as final sum?
The most likely number to occur as the final sum is 100.
The sum of the outcomes of the dice rolls will keep increasing until it reaches or exceeds 100.
Since the dice have equal probabilities for each outcome, the sum will have a higher chance of reaching 100.
The probability of rolling a sum greater than 100 decreases as the sum gets larger.
Q38. Why are gold prices increasing and why are US treasury bonds still valuable?
Gold prices are increasing due to economic uncertainty and inflation concerns. US treasury bonds remain valuable due to their safe-haven status and reliable returns.
Gold prices are increasing due to economic uncertainty and inflation concerns.
Investors often turn to gold as a safe-haven asset during times of market volatility.
The demand for gold is also influenced by factors such as geopolitical tensions and central bank policies.
US treasury bonds are still valuable because t...read more
Q39. What is the expected number of tosses of a fair coin to get 3 consecutive heads?
Expected number of tosses of a fair coin to get 3 consecutive heads.
The probability of getting 3 consecutive heads is 1/8
The expected number of tosses to get 3 consecutive heads is 14
This can be calculated using the formula E(X) = 2^k + 2^(k-1) + 2^(k-2) + ... + 2^2 + 2^1 + 2^0, where k is the number of consecutive heads required
Q40. How many airplanes are flying in the Indian sky at the moment?
The exact number of airplanes flying in the Indian sky at the moment is not available.
The number of airplanes flying in the Indian sky changes constantly.
It depends on factors such as time of day, weather conditions, and airline schedules.
However, on average, there are around 2,000 flights in the Indian airspace at any given time.
This number includes both domestic and international flights.
The Indian aviation industry has been growing rapidly in recent years, with more and mo...read more
Q41. Cutting three random points on the circle of radius 1 centered at (0,0) . What is probability that point (1,0) lies in longest cut
Finding probability of point (1,0) lying in longest cut of three random points on circle of radius 1 centered at (0,0)
The longest cut will be the one that spans the smallest angle between two of the three points
The probability can be found by calculating the area of the region where the longest cut includes point (1,0)
This can be done by finding the angle between (1,0) and the two other points and using trigonometry to calculate the area of the corresponding sector of the cir...read more
Q42. What is a call option? Why are call options bought?
A call option is a financial contract that gives the buyer the right, but not the obligation, to buy an underlying asset at a predetermined price within a specified time period.
Call options are bought by investors who believe that the price of the underlying asset will rise in the future.
The buyer of a call option pays a premium to the seller for the right to buy the asset at a predetermined price, known as the strike price.
If the price of the asset rises above the strike pri...read more
Q43. How do you calculate the price of a call option?
The price of a call option is calculated using the Black-Scholes model which takes into account the underlying asset price, strike price, time to expiration, risk-free interest rate, and volatility.
Determine the current price of the underlying asset
Determine the strike price of the option
Determine the time to expiration of the option
Determine the risk-free interest rate
Determine the volatility of the underlying asset
Plug these values into the Black-Scholes model to calculate ...read more
Q44. How many ways can a king go from one end of the chessboard to the diagonally opposite square(The king can move only towards the corner and not diagonally)
The king can move only towards the corner and not diagonally. How many ways can a king go from one end of the chessboard to the diagonally opposite square?
The king can only move towards the corner, so there are limited options for each move
The total number of moves required to reach the opposite corner is 14
Using combinatorics, the total number of ways the king can reach the opposite corner is 3432
Q46. How to create a uniform distribution from 1 to 200 using an ubiased coin?
To create a uniform distribution from 1 to 200 using an unbiased coin, we can use the rejection sampling method.
Divide the range into equal parts based on the number of outcomes of the coin toss.
Toss the coin and select the corresponding part of the range.
If the selected number is outside the desired range, reject it and repeat the process.
Repeat until a number within the desired range is obtained.
Example: If the coin has 2 outcomes, divide the range into 2 parts of 100 each....read more
Q47. An IT sector company wants to increase the number of BPOs in India. Devise a metric that will help it rank cities according to their favourability to host this BPO
A metric to rank Indian cities for BPOs
Consider factors like availability of skilled workforce, infrastructure, cost of living, and government policies
Weight each factor based on its importance to the company
Collect data on each factor for different cities and assign scores
Rank cities based on their total score
Examples of factors: number of universities, quality of transportation, cost of office space, tax incentives
Regularly update the metric to reflect changes in the busine...read more
Q48. Given two arrays of size n each, describe an algorithm to find the largest common subarray of the two arrays
Algorithm to find largest common subarray of two arrays of size n
Create a 2D array to store the lengths of common subarrays
Traverse both arrays and fill the 2D array with lengths of common subarrays
Find the maximum length and its corresponding ending index in the 2D array
Use the ending index to retrieve the largest common subarray from either of the arrays
Q49. Variants of using random number generators/Monte Carlo Simulations to generate value of Pi and other quantities
Random number generators and Monte Carlo simulations can be used to estimate the value of Pi and other quantities.
Monte Carlo simulations involve generating random numbers to estimate a value or solve a problem
To estimate Pi, random points are generated within a square and the ratio of points inside a circle to total points is used
Other quantities can be estimated using similar principles, such as estimating the area under a curve or the value of an integral
Q50. Row sorted and column sorted matrix problem of finding an element.
The problem involves finding an element in a matrix that is sorted both row-wise and column-wise.
Start from the top-right corner of the matrix
Compare the target element with the current element
If the target is smaller, move left; if larger, move down
Repeat until the target is found or the matrix boundaries are crossed
Q51. Given a matrix containing several positive numbers find max path from bottom left to top right using only up and right steps
Find max path from bottom left to top right in a matrix using only up and right steps.
Start from bottom left corner and move towards top right corner.
At each step, choose the maximum value between the cell above and the cell to the right.
Keep track of the sum of values in the chosen path.
The final sum is the maximum possible sum of values in a path from bottom left to top right.
Q52. Different efficient ways to implement product and summation of n numbers. And limitations
Efficient ways to implement product and summation of n numbers with limitations.
For summation, use a loop or built-in functions like sum() or reduce().
For product, use a loop or built-in functions like prod() or reduce().
Limitations include overflow errors for large numbers and memory constraints for very large arrays.
Using parallel processing or vectorization can improve efficiency.
Consider using data structures like binary trees or prefix sums for faster calculations.
Q53. If You have an infinite array then how many ways to sort it and also tell the complexities
There are infinite ways to sort an infinite array with varying complexities.
Sorting algorithms like QuickSort, MergeSort, HeapSort, etc. can be used to sort the array.
The time complexity of sorting algorithms varies from O(n log n) to O(n^2).
The space complexity also varies depending on the algorithm used.
Sorting an infinite array is not practical, so it is usually done in chunks or using parallel processing.
The sorting order can be ascending or descending based on the requir...read more
Q54. What do you know about options?
Options are financial contracts that give the buyer the right, but not the obligation, to buy or sell an underlying asset at a predetermined price.
Options can be used for hedging or speculation
There are two types of options: call options and put options
Call options give the buyer the right to buy the underlying asset at a predetermined price, while put options give the buyer the right to sell the underlying asset at a predetermined price
Options have expiration dates and strik...read more
Q55. A person can climb 1 or 2 stairs. Find the number of ways to jump n stairs
Number of ways to jump n stairs if a person can climb 1 or 2 stairs.
Use dynamic programming to solve the problem.
The number of ways to jump n stairs is equal to the sum of ways to jump n-1 stairs and ways to jump n-2 stairs.
Base cases: if n=0, return 1 and if n=1, return 1.
Q56. Given a 2d matrix sorted row and column wise, search an element
Searching an element in a sorted 2D matrix
Start from the top-right corner or bottom-left corner
Compare the target element with the current element
Move left or down if the target is smaller or move right or up if the target is larger
Q57. Efficient algorithms on calculating Fibonacci’s Sequence
Efficient algorithms for calculating Fibonacci's sequence
Use dynamic programming to avoid redundant calculations
Implement matrix exponentiation to reduce time complexity to O(log n)
Use memoization to store previously calculated values
Iterative approach using constant space complexity
Binet's formula for direct calculation of nth Fibonacci number
Q59. What platforms have you used for this process in the past?
I have used platforms such as Excel, Tableau, and Power BI for data analysis in the past.
Excel
Tableau
Power BI
Q62. How to merge multiple sorted arrays into one sorted array
Merge multiple sorted arrays into one sorted array
Iterate through each array and merge them into a single array
Use a priority queue or heap data structure to efficiently merge the arrays
Implement a merge sort algorithm to combine the arrays into one sorted array
Q63. How will you mane a LRU Cache
An LRU cache can be made using a doubly linked list and a hash map.
Create a doubly linked list to store the cache items.
Create a hash map to store the key-value pairs.
When a new item is added, check if the cache is full. If it is, remove the least recently used item from the linked list and hash map.
When an item is accessed, move it to the front of the linked list.
When an item is removed, remove it from both the linked list and hash map.
Q64. Find integer solutions of x^y=y^x.
Find integer solutions of x^y=y^x.
If x=y, then x^y=y^x=1
If x
If x>y, then x^y>y^x
Only solution is (2,4) and (4,2)
Use logarithms to prove
Q65. difference between hedge funds and private equity
Hedge funds are actively managed investment funds that use various strategies to generate high returns, while private equity firms invest in private companies and aim to increase their value.
Hedge funds are open to a wider range of investors than private equity funds
Hedge funds use leverage to increase returns, while private equity firms use debt to finance acquisitions
Hedge funds have a shorter investment horizon than private equity firms
Private equity firms typically take a...read more
Q66. Design a newspaper subscription system
Design a newspaper subscription system
Create a user registration system
Allow users to select subscription plan and payment method
Provide options for delivery frequency and start/end dates
Send reminders for subscription renewal
Allow users to modify or cancel subscription
Track subscription history and payment records
Q67. Explain what is Binary Search Tree
Binary Search Tree is a data structure where each node has at most two children, with left child less than parent and right child greater.
Nodes have at most two children - left and right
Left child is less than parent, right child is greater
Allows for efficient searching, insertion, and deletion of elements
Q68. What is Asset Management
Asset management is the process of managing and optimizing a company's assets to maximize their value and minimize risk.
Asset management involves identifying, tracking, and evaluating assets
It includes developing strategies to optimize asset performance and minimize risk
Examples of assets that can be managed include financial investments, real estate, and equipment
Asset management can be done in-house or outsourced to a third-party firm
Q69. what is custodian banking
Custodian banking involves holding and safeguarding financial assets on behalf of clients.
Custodian banks provide services such as asset safekeeping, settlement of trades, and corporate actions processing.
They also offer reporting and analytics to clients on their holdings and transactions.
Examples of custodian banks include State Street, BNY Mellon, and J.P. Morgan.
Custodian banking is important for institutional investors such as pension funds, mutual funds, and hedge funds...read more
Q70. What is trade life cycle
Trade life cycle refers to the stages involved in a trade from initiation to settlement.
Trade initiation - Trade is proposed and agreed upon by parties involved
Trade execution - Trade is executed on the exchange or over-the-counter market
Trade confirmation - Parties confirm the details of the trade
Trade settlement - Payment and transfer of securities occur
Trade reconciliation - Ensuring all details match between parties
Q71. what is private equity
Private equity is a type of investment where funds are raised from investors to acquire or invest in companies that are not publicly traded.
Private equity firms typically buy a controlling stake in a company and then work to improve its operations and profitability before selling it for a profit.
Private equity investments are typically made in mature companies with a proven track record of success.
Private equity firms may also invest in distressed companies with the goal of t...read more
Q72. What is a strength of yours
One of my strengths is my ability to analyze complex data and identify key insights.
Strong analytical skills
Ability to think critically and problem-solve
Experience with data analysis tools such as Excel or Tableau
Q73. Linked list Algorithms
Linked list algorithms involve operations on linked lists, such as insertion, deletion, and traversal.
Linked list algorithms are used to manipulate data stored in linked lists.
Common operations include inserting a new node, deleting a node, and traversing the list.
Examples of linked list algorithms include reversing a linked list, finding the middle node, and detecting a loop in the list.
Q74. Clone a binary tree with random pointer
Clone a binary tree with random pointer
Create a new node for each node in the original tree
Store the mapping of original node to new node in a hash map
Traverse the original tree and for each node, connect the corresponding new node's random pointer
Return the root of the new tree
Q75. Trees solved using recursion
Trees can be solved using recursion by breaking down the problem into smaller subproblems.
Recursively traverse the tree by calling the function on the left and right child nodes.
Base case should be when reaching a leaf node or null node.
Examples: inorder, preorder, postorder tree traversal.
Q76. Walk me through a DCF
A DCF (Discounted Cash Flow) is a valuation method used to estimate the value of an investment based on its future cash flows.
Estimate future cash flows of the investment
Apply a discount rate to the cash flows to account for the time value of money
Calculate the present value of the cash flows to determine the investment's value
Q77. Formula of WACC
WACC is the weighted average cost of capital, calculated by multiplying the cost of each capital component by its proportional weight and summing the results.
WACC = (E/V) * Re + (D/V) * Rd * (1 - Tc)
E/V represents the proportion of equity in the company's capital structure
Re is the cost of equity
D/V represents the proportion of debt in the company's capital structure
Rd is the cost of debt
Tc is the corporate tax rate
Example: If a company has 70% equity and 30% debt, with a cos...read more
More about working at Goldman Sachs
Top HR Questions asked in Globe Capacitors
Interview Process at Globe Capacitors
Top Analyst Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month