Goldman Sachs
20+ Absika Solutions Interview Questions and Answers
Q1. Climbing the Leaderboard Problem Statement
In a game leaderboard, scores determine rankings where the highest score gets rank 1. Players with identical scores share the same rank, followed by the next rank down...read more
Q2. Design a HashSet
Create a HashSet data structure without using any built-in hash table libraries.
Functions Description:
1) Constructor: Initializes the data members as required. 2) add(value): Inserts an eleme...read more
Q3. Fenwick Tree Problem Statement
You are provided with an array/list ARR
consisting of 'N' integers, along with 'Q' queries. Each query can be of one of the following two types:
- Type 1 (Range Sum): Given two int...read more
Q4. Print Nodes at Distance K from a Given Node
Given an arbitrary binary tree, a node of the tree, and an integer 'K', find all nodes that are at a distance K from the specified node, and return a list of these no...read more
Q5. Flatten the Multi-Level Linked List Problem
You are provided with a multi-level linked list consisting of 'N' nodes. Each node contains a 'next' and 'child' pointer that may point to another node. Your task is ...read more
Q6. Find Pairs in a Doubly-Linked List
A sorted doubly-linked list of distinct positive integers is provided, along with an integer 'X'. Your task is to identify and print all unique pairs from the list whose sum e...read more
Q7. Minimum Depth of a Binary Tree Problem Statement
Given a Binary Tree of integers, determine the minimum depth of the Binary Tree. The minimum depth is defined as the number of nodes present along the shortest p...read more
Q8. Prime Numbers Identification
Given a positive integer N
, your task is to identify all prime numbers less than or equal to N
.
Explanation:
A prime number is a natural number greater than 1 that has no positive d...read more
Q9. Word Search Problem Statement
Given a two-dimensional grid of size N x M
consisting of upper case characters and a string 'WORD', determine how many times the 'WORD' appears in the grid.
The 'WORD' can be forme...read more
Q10. Maximum Subarray Sum Problem Statement
Given an array arr
of length N
consisting of integers, find the sum of the subarray (including empty subarray) with the maximum sum among all subarrays.
Explanation:
A sub...read more
Q11. Partition Set Into Two Subsets With Minimum Difference
Given an array of N non-negative integers, split the array into two subsets such that the absolute difference between their sums is minimized.
The task is ...read more
Q12. Find K-th Smallest Element in BST
Given a binary search tree (BST) and an integer K
, the task is to find the K-th smallest element in the BST.
Example:
Input:
BST: Order of elements in increasing order is { 2, ...read more
Q13. Partition to K Equal Sum Subsets Problem
Given an array of integers and a positive integer 'K', determine if it is possible to divide the array into 'K' non-empty subsets such that the sum of elements in each s...read more
Q14. Maximize Stock Trading Profit
You are given an array prices
, representing stock prices over N consecutive days. Your goal is to compute the maximum profit achievable by performing multiple transactions (i.e., b...read more
Q15. Problem Statement: Minimize the Maximum
You are given an array of integers and an integer K
. For each array element, you can adjust it by increasing or decreasing it by a value of K
. Your goal is to minimize th...read more
Q16. Arithmetic Progression Queries Problem Statement
Given an integer array ARR
of size N
, perform the following operations:
- update(l, r, val):
Add (val + i)
to arr[l + i]
for all 0 ≤ i ≤ r - l
.
- rangeSum(l, r):...read more
Q17. Minimum Number of Platforms Needed Problem Statement
You are given the arrival and departure times of N trains at a railway station for a particular day. Your task is to determine the minimum number of platform...read more
Q18. Two and Four Wheeler Roads Problem Statement
There is a country with N
cities and M
bidirectional roads of 3 types:
Type 1: Two Wheeler Road - Only vehicles with two wheels can use this road. Type 2: Four Wheel...read more
Q19. Next Greater Number Problem Statement
Given a string S
which represents a number, determine the smallest number strictly greater than the original number composed of the same digits. Each digit's frequency from...read more
Q20. Rat in a Maze Problem Statement
You need to determine all possible paths for a rat starting at position (0, 0) in a square maze to reach its destination at (N-1, N-1). The maze is represented as an N*N matrix w...read more
Q22. 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
Q23. 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
Q24. 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
Q25. 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
More about working at Goldman Sachs
Interview Process at Absika Solutions
Top Software Analyst Interview Questions from Similar Companies
Reviews
Interviews
Salaries
Users/Month