Goldman Sachs
300+ Nsight Inc Interview Questions and Answers
Q301. Give me “Mathematical Model” for Bubble sort
Q302. sql: left join vs. right join/ union vs. union all
Explaining differences between left join, right join, union and union all in SQL.
Left join returns all records from left table and matching records from right table.
Right join returns all records from right table and matching records from left table.
Union combines the result sets of two or more SELECT statements and removes duplicates.
Union all combines the result sets of two or more SELECT statements and includes duplicates.
Use left join when you want to include all records ...read more
Q303. 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.
Q304. Check if a given IP address is valid or not
Q305. Least Common Ancestor for n-ary Tree
The least common ancestor (LCA) of two nodes in an n-ary tree is the lowest node that has both nodes as descendants.
The LCA can be found by traversing the tree from the root and checking if both nodes are present in its children.
If one node is the ancestor of the other, it is considered as the LCA.
If the nodes are in different subtrees, the LCA will be the root of the tree.
Q306. Implement smart pointer of your own
Q307. Types of keys in sql and types of joints too.
Types of keys in SQL include primary, foreign, and unique. Types of joins include inner, outer, left, and right.
Primary key: uniquely identifies each record in a table
Foreign key: links two tables together
Unique key: ensures that each value in a column is unique
Inner join: returns only the matching rows from both tables
Outer join: returns all rows from both tables, with null values for non-matching rows
Left join: returns all rows from the left table and matching rows from the...read more
Q308. How will you fund your business?
The business will be funded through a combination of equity financing, loans, and revenue generation.
Seeking investment from venture capitalists or angel investors
Applying for business loans from banks or financial institutions
Generating revenue through sales of products or services
Crowdfunding campaigns on platforms like Kickstarter or Indiegogo
Q309. How to delete a node in a lonked list
To delete a node in a linked list, we need to adjust the pointers of the previous and next nodes.
Find the node to be deleted by traversing the linked list
Adjust the pointers of the previous and next nodes to skip the node to be deleted
Free the memory occupied by the node to be deleted
Q310. What are chargebacks?
Chargebacks are a reversal of a credit card transaction by the card issuer.
Chargebacks occur when a customer disputes a charge on their credit card statement.
The card issuer investigates the dispute and may reverse the transaction if they find it to be valid.
Merchants may be charged a fee for each chargeback they receive.
Common reasons for chargebacks include fraud, product not received, or product not as described.
Merchants can dispute chargebacks by providing evidence to th...read more
Q311. What is clean price and Dirty price
Clean price is the price of a bond excluding accrued interest, while dirty price includes accrued interest.
Clean price is the price of a bond without the accrued interest, while dirty price includes the accrued interest.
Clean price is also known as flat price, while dirty price is also known as full price.
Clean price is used to calculate the yield of a bond, while dirty price is the actual price paid by the buyer.
Q312. What are derivatives?
Derivatives are financial contracts that derive their value from an underlying asset or security.
Derivatives can be used for hedging or speculation.
Common types of derivatives include futures, options, and swaps.
Futures contracts obligate the buyer to purchase an asset at a predetermined price and time.
Options contracts give the buyer the right, but not the obligation, to buy or sell an asset at a predetermined price and time.
Swaps involve exchanging cash flows based on diffe...read more
Q313. What does this query do
Cannot answer without knowing the query
Q314. Given two stacks implement a Queue
Implement a queue using two stacks.
Use one stack for enqueue operation and another for dequeue operation
When dequeue is called, pop all elements from stack 1 and push them onto stack 2, then pop from stack 2
When stack 2 is empty, repeat the process in reverse
Ensure that enqueue operation always happens on the non-empty stack
Q315. Leetcode design system with EC2 instance Fleet
Design a system using EC2 instance Fleet on Leetcode platform
Utilize EC2 instance Fleet to manage a group of EC2 instances for scalability and cost-efficiency
Implement load balancing to distribute incoming traffic across multiple EC2 instances
Use auto-scaling to automatically adjust the number of EC2 instances based on traffic demand
Monitor system performance and health using CloudWatch metrics and alarms
Q316. Some loopholes of DCF?
DCF can be affected by inaccurate projections, discount rate assumptions, and terminal value estimates.
DCF relies heavily on projections, which can be difficult to accurately predict.
Discount rate assumptions can also greatly impact the valuation.
Terminal value estimates can be particularly challenging to determine.
DCF does not account for external factors such as market volatility or changes in industry trends.
DCF assumes a constant growth rate, which may not be realistic in...read more
Q317. What is investment banking
Investment banking is a type of financial service that helps companies and governments raise capital by underwriting and selling securities.
Investment banks act as intermediaries between issuers of securities and investors.
They provide services such as underwriting, mergers and acquisitions, and securities trading.
Examples of investment banks include Goldman Sachs, JPMorgan Chase, and Morgan Stanley.
Q318. Find the shortest super common string
Finding the shortest super common string among an array of strings.
Create a set of all substrings of the first string
Iterate through the remaining strings and remove substrings not present in them
Return the shortest remaining substring
Q319. What is Active directory?
Active Directory is a directory service developed by Microsoft for Windows domain networks.
It stores information about network resources such as computers, users, and groups.
It provides authentication and authorization services for Windows-based computers.
It allows administrators to manage and deploy software, policies, and updates to network resources.
It uses a hierarchical structure of domains and organizational units (OUs) to organize network resources.
It supports integrat...read more
Q320. What are Structured Derivatives?
Q321. What is Black Scholes equation?
Q322. How to handle class imbalance
Handling class imbalance involves techniques such as resampling, adjusting class weights, and using ensemble methods.
Resampling techniques like oversampling the minority class or undersampling the majority class can help balance the classes.
Adjusting class weights during model training can give more importance to the minority class.
Using ensemble methods like bagging or boosting can improve the performance on imbalanced datasets.
Applying anomaly detection or one-class classif...read more
Q323. How you’ve dealt with objection?
I have dealt with objections by actively listening, addressing concerns, providing solutions, and building rapport.
Listen carefully to the objection without interrupting
Acknowledge the concern and show empathy
Provide relevant information or solutions to address the objection
Build rapport and trust by demonstrating expertise and understanding
Q324. Find the fourier transform of a Gaussian
The Fourier transform of a Gaussian is another Gaussian.
The Fourier transform of a Gaussian function is given by another Gaussian function.
The Fourier transform of a Gaussian function is also a Gaussian function.
The width of the Fourier transform is inversely proportional to the width of the original Gaussian.
The Fourier transform of a Gaussian function is widely used in signal processing and image processing.
Q325. Trisect a line using scale and compass
Trisecting a line using scale and compass involves dividing the line into three equal parts.
Draw a line segment using a ruler
Place the compass at one end of the line and draw an arc
Place the compass at the other end of the line and draw another arc
Draw a line connecting the two points where the arcs intersect
Divide the line into three equal parts using the ruler
Q326. 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
Q327. What tools have you worked on.
I have worked with tools such as Apache Spark, Hadoop, and SQL databases.
Apache Spark
Hadoop
SQL databases
Q328. Find the first non repeating character
Use a hashmap to store the frequency of each character and then iterate through the string to find the first non-repeating character.
Create a hashmap to store the frequency of each character in the string.
Iterate through the string and update the frequency in the hashmap.
Iterate through the string again and return the first character with frequency 1.
Q329. Design a parking lot system
Q330. What is inheritance in java?
Inheritance in Java allows a class to inherit properties and behavior from another class.
Inheritance allows for code reusability and promotes a hierarchical relationship between classes.
Subclasses can access the methods and fields of their superclass.
Example: class Dog extends Animal {} - Dog inherits properties and behavior from Animal class.
Q331. Create BST from incoming stream of nodes
Create a Binary Search Tree (BST) from an incoming stream of nodes.
Start with an empty BST
For each incoming node, compare it with the root node and insert it accordingly
Repeat the process until all nodes are inserted
Q332. Implement LRU cache.
Implement LRU cache
LRU stands for Least Recently Used
It is a cache eviction policy that removes the least recently used item
It can be implemented using a doubly linked list and a hash map
Newly accessed items are moved to the front of the list
When the cache is full, the item at the end of the list is removed
Q333. Check if a BT is BST or not
To check if a BT is BST or not, we need to traverse the tree and check if the left child is smaller and right child is greater than the parent node.
Traverse the tree using inorder traversal
Check if the left child is smaller than the parent node
Check if the right child is greater than the parent node
Repeat the above steps for all nodes in the tree
If all nodes follow the above conditions, then the tree is a BST
Q334. Difference between xgboost and gbm
XGBoost is an optimized version of Gradient Boosting Machine (GBM) with additional features and improvements.
XGBoost is a scalable and efficient implementation of gradient boosting algorithm.
XGBoost uses a more regularized model formalization to control overfitting.
XGBoost supports parallel processing and can handle large datasets.
XGBoost provides built-in regularization techniques like L1 and L2 regularization.
XGBoost has a variety of objective functions and evaluation metri...read more
Q335. Implement two stacks in a single array
Implement two stacks in a single array using two different approaches
Divide the array into two halves and use one half for each stack
Use two pointers, one for each stack, and move them towards each other as elements are pushed or popped
Consider edge cases like stack overflow and underflow
Q336. Design an olympic game
Designing an Olympic game that tests physical and mental abilities.
Include a mix of individual and team events
Incorporate traditional sports like track and field, swimming, and gymnastics
Include non-traditional events like obstacle courses and mental challenges
Have a closing ceremony that celebrates all athletes and their achievements
Q337. Difference between c++ and C#
Q338. How JVM works?
Q339. Producer consumer problem
Producer consumer problem is a synchronization problem in which a producer produces data and a consumer consumes it.
The producer and consumer share a common buffer.
The producer produces data and puts it in the buffer.
The consumer consumes data from the buffer.
The problem arises when the buffer is full or empty.
Solutions include using semaphores, mutexes, and monitors.
Q340. Minimum window problem of strings.
Q341. Walk me through a dcf
DCF is a valuation method used to estimate the value of an investment based on its future cash flows.
Forecast future cash flows
Determine the discount rate
Calculate the present value of cash flows
Sum the present values to get the total value of the investment
Q342. Design a traffic light system
Q343. What is a Bull Spread?
Q344. How to prioritize projects ?
Prioritizing projects involves assessing their importance, urgency, resources required, and impact on overall goals.
Evaluate the importance and impact of each project on overall goals
Assess the urgency of each project and any deadlines that need to be met
Consider the resources required for each project, such as budget, manpower, and time
Use prioritization techniques like the Eisenhower Matrix or MoSCoW method
Communicate with stakeholders to understand their priorities and exp...read more
Q345. find a number in sorted rotated array
To find a number in a sorted rotated array, use binary search algorithm.
Identify the mid element of the array
Check if the mid element is the target number
If not, check if the left half or right half of the array is sorted
If the left half is sorted and the target number falls within that range, search in the left half
If the right half is sorted and the target number falls within that range, search in the right half
Repeat the process until the target number is found or the arra...read more
Q346. Deferred tax with examples
Deferred tax is a liability or asset that arises due to temporary differences between accounting and tax rules.
Deferred tax arises due to temporary differences between accounting and tax rules
It can be a liability or asset depending on the nature of the difference
Examples include depreciation, inventory valuation, and tax credits
Deferred tax liability is recognized when taxable income is greater than accounting income
Deferred tax asset is recognized when accounting income is ...read more
Q347. Design a System like Zomato
A system like Zomato for restaurant discovery and food ordering.
Create a database of restaurants with details like menu, location, ratings, etc.
Develop a user-friendly website and mobile app for easy access.
Implement a search feature for finding restaurants based on location, cuisine, etc.
Allow users to rate and review restaurants.
Integrate a secure payment gateway for online food ordering and delivery.
Partner with restaurants for promotions and discounts.
Provide analytics an...read more
Q348. Design a distributed rate limiter.
Design a distributed rate limiter for managing incoming requests.
Use a distributed key-value store like Redis to store request counts and timestamps.
Implement a token bucket algorithm to control the rate of incoming requests.
Use a distributed messaging system like Kafka for communication between rate limiter instances.
Consider using consistent hashing to evenly distribute requests among rate limiter instances.
Q349. Difference between SQL and NoSQL
SQL is a traditional relational database management system, while NoSQL is a non-relational database system.
SQL is structured, uses tables with predefined schema, and is good for complex queries.
NoSQL is unstructured, uses collections or documents, and is good for large amounts of data with simple queries.
SQL is ACID compliant, ensuring data integrity, while NoSQL is BASE (Basically Available, Soft state, Eventually consistent) for scalability and flexibility.
Examples of SQL ...read more
Q350. Reverse a linked list recursively
Reverse a linked list recursively by swapping pointers
Start by checking if the current node is null or the next node is null
If so, return the current node as it is the new head of the reversed list
Otherwise, recursively call the function on the next node and swap pointers
Q351. sql query to find second highest
Use a subquery to find the second highest value in a SQL table.
Use a subquery to select the maximum value from the table.
Then use another subquery to select the maximum value that is less than the maximum value found in the first subquery.
Q352. Explain inner join with an example
Inner join combines rows from two tables based on a related column
Inner join returns only the rows that have matching values in both tables
It is used to retrieve data that exists in both tables
Example: SELECT Orders.OrderID, Customers.CustomerName FROM Orders INNER JOIN Customers ON Orders.CustomerID = Customers.CustomerID;
Q354. Why investment banking
Q355. What is equity, fixed income
Q356. write a code for quick sort
Quick sort is a popular sorting algorithm that uses divide and conquer strategy.
Divide the array into two sub-arrays based on a pivot element
Recursively sort the sub-arrays
Combine the sorted sub-arrays
Q357. Hedge funds for funds accounting
Hedge funds use fund accounting to track investments, manage risks, and report performance.
Hedge funds use fund accounting to accurately track the value of their investments.
Fund accounting helps hedge funds manage risks by providing detailed information on asset allocation.
Reporting performance to investors is a key aspect of fund accounting for hedge funds.
Examples: calculating NAV, reconciling trades, preparing financial statements.
Q358. Trapping rainwater problem
Trapping rainwater problem
The problem involves calculating the amount of rainwater that can be trapped between bars in an elevation map
Use two pointers approach to calculate the water trapped at each bar
Keep track of the maximum height on the left and right of each bar to calculate the trapped water
Q359. Serach in sorted n*n matrix
Search for a target value in a sorted n*n matrix.
Start from the top-right corner or bottom-left corner of the matrix.
Compare the target value with the current element and move left or down accordingly.
Repeat until the target value is found or the boundaries of the matrix are crossed.
Q360. gas and track problem
The gas and track problem involves determining the amount of gas required to complete a track.
Calculate the distance of the track
Determine the fuel efficiency of the vehicle
Divide the distance by the fuel efficiency to get the required amount of gas
Q361. Implement a min stack
A min stack is a stack data structure that supports the usual push and pop operations, along with an additional operation to retrieve the minimum element in constant time.
Create a stack to store the elements and another stack to store the minimum values encountered so far.
When pushing an element, check if it is smaller than the current minimum. If so, push it onto the minimum stack.
When popping an element, check if it is equal to the current minimum. If so, pop from the minim...read more
Q362. Difference between OOP and POP
OOP focuses on objects and classes, while POP focuses on procedures and functions.
OOP emphasizes data encapsulation and inheritance
POP emphasizes sequential execution of procedures
Example of OOP: Java, C++
Example of POP: C, Pascal
Q363. Binary search on rotared array
Binary search on rotated array involves finding a target value in a sorted array that has been rotated at an unknown pivot point.
Identify the pivot point by finding the minimum element in the array.
Divide the array into two subarrays based on the pivot point.
Perform binary search on the appropriate subarray to find the target value.
Q364. What is interest
Interest is the cost of borrowing money or the return on invested funds.
Interest is the amount charged by a lender to a borrower for the use of assets.
It can also refer to the income earned on an investment.
There are different types of interest such as simple interest and compound interest.
For example, when you take out a loan, you will have to pay back the principal amount plus interest.
On the other hand, if you deposit money in a savings account, you will earn interest on y...read more
Q365. LLD for Parking Lot System
Design the Low Level Design (LLD) for a Parking Lot System
Divide the system into modules like parking lot, vehicle, ticket, payment, etc.
Define the classes and their relationships, such as ParkingLot, Vehicle, Ticket, Payment
Include methods for functionalities like parking a vehicle, issuing a ticket, processing payment
Consider scalability and performance aspects in the design
Implement data structures like queues for managing parking spots
Q366. Design Notification System
Designing a notification system for efficient communication and updates.
Identify the target audience for the notifications (employees, customers, etc.)
Determine the types of notifications needed (urgent alerts, general updates, reminders, etc.)
Choose the appropriate communication channels (email, SMS, app notifications, etc.)
Implement a user-friendly interface for managing notification preferences
Include options for customization and personalization of notifications
Q367. Tell ne about urself
Q368. Your current process
My current process involves analyzing data, identifying trends, and creating reports to support decision-making.
Collecting relevant data from various sources
Using statistical tools and software to analyze data
Creating visualizations and reports to communicate findings
Presenting findings to stakeholders for decision-making
Q369. type of loans offered
Various types of loans offered include personal loans, home loans, auto loans, student loans, and business loans.
Personal loans
Home loans
Auto loans
Student loans
Business loans
Q370. Design netflix otp system
Design a Netflix OTP system.
Use a secure algorithm to generate OTPs.
Implement a time-based OTP system.
Integrate with a reliable SMS gateway for OTP delivery.
Implement rate limiting to prevent brute force attacks.
Provide an option for users to disable OTP for trusted devices.
Ensure compliance with data privacy regulations.
Q371. my favorite topic
Q372. Explain recursion
Recursion is a programming technique where a function calls itself in order to solve a problem.
Recursion involves breaking down a problem into smaller subproblems and solving them recursively.
A base case is needed to stop the recursion and prevent infinite loops.
Examples of recursive functions include factorial calculation and Fibonacci sequence generation.
Q373. Internals of hashMap
HashMap is a data structure that stores key-value pairs and uses hashing to quickly retrieve values based on keys.
HashMap internally uses an array of linked lists to store key-value pairs.
When a key-value pair is added, the key is hashed to determine the index in the array where the pair will be stored.
If multiple keys hash to the same index, a linked list is used to handle collisions.
HashMap allows null keys and values, but only one null key.
Example: HashMap
map = new HashMa...read more
Q374. salary exp in high
I have experience with high salary expectations.
I have experience negotiating high salaries based on my skills and experience.
I have successfully secured high salary offers in previous roles.
I am confident in my ability to justify and negotiate for a high salary based on market rates and my qualifications.
Q375. bulk hire experience
I have extensive experience in bulk hiring, including sourcing, screening, and onboarding large numbers of candidates efficiently.
Managed end-to-end recruitment process for bulk hiring projects
Utilized various sourcing strategies to attract a high volume of candidates
Implemented streamlined screening and assessment processes to quickly identify qualified candidates
Coordinated logistics for large-scale recruitment events
Collaborated with hiring managers to ensure timely onboar...read more
Q376. design file system
Designing a file system involves organizing and managing data on a storage device.
Consider the type of data to be stored and access patterns
Choose a suitable file system structure (e.g. FAT, NTFS, ext4)
Implement features like file permissions, encryption, and compression
Plan for scalability and backup strategies
Q377. Collection in java
Collections in Java are classes that hold multiple elements. They provide various data structures like lists, sets, maps, etc.
Collections framework provides interfaces like List, Set, Map, Queue, etc.
ArrayList and LinkedList are examples of List implementations.
HashSet and TreeSet are examples of Set implementations.
HashMap and TreeMap are examples of Map implementations.
Collections provide methods for adding, removing, and accessing elements in a structured way.
More about working at Goldman Sachs
Top HR Questions asked in Nsight Inc
Interview Process at Nsight Inc
Top Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month