Adobe
10+ VGC Advisors Interview Questions and Answers
Q1. Sort Array by Set Bit Count
Given an array of positive integers, your task is to sort the array in decreasing order based on the count of set bits in the binary representation of each integer.
If two numbers ha...read more
Q2. Reverse Linked List Problem Statement
Given a singly linked list of integers, return the head of the reversed linked list.
Example:
Initial linked list: 1 -> 2 -> 3 -> 4 -> NULL
Reversed linked list: 4 -> 3 -> 2...read more
Q3. 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
Q4. Validate BST Problem Statement
Given a binary tree with N
nodes, determine whether the tree is a Binary Search Tree (BST). If it is a BST, return true
; otherwise, return false
.
A binary search tree (BST) is a b...read more
Q5. Maximum Non-Adjacent Subsequence Sum
Given an array of integers, determine the maximum sum of a subsequence without choosing adjacent elements in the original array.
Input:
The first line consists of an integer...read more
Q6. Colourful Knapsack Problem Statement
You are given N
stones labeled from 1 to N
. The i-th stone has the weight W[i]
. There are M
colors labeled by integers from 1 to M
. The i-th stone has the color C[i]
which i...read more
Q7. Minimum Number of Lamps Needed
Given a string S
containing dots (.) and asterisks (*), where a dot represents free spaces and an asterisk represents lamps, determine the minimum number of additional lamps neede...read more
Q8. Linked List Merge Point Problem
You are given two singly linked lists and a third linked list, such that the two lists merge at some node of the third linked list. Determine the data value at the node where thi...read more
Q9. 1>linked list node contain a string field and next.find if by concatenating all string fields the string formed is palindrome or not? 2-> merge to sorted array in which one arra is large enough to accomodate el...
read moreThe first question is about checking if a string formed by concatenating all string fields in a linked list is a palindrome or not.
Traverse the linked list and concatenate all string fields
Check if the concatenated string is a palindrome by comparing characters from both ends
Consider edge cases like empty linked list or single node with an empty string field
Q10. Puzzle question -> 12 people on island with a seesaw. 11 of them have identical weight, one has higher or lower. How can you find out which one? You can only use the seesaw 3 times
Use the seesaw 3 times to find the person with different weight among 12 people on an island.
Divide the 12 people into 3 groups of 4.
Compare 2 groups on the seesaw, then narrow down the group with the different person.
Take the 4 people from the identified group and compare 2 of them on the seesaw to find the person with different weight.
Q12. 1. Binary tree traversal 2. Multiply 2 big numbers represented in the form of string. 3. Detect the k-th node from the back of a linked list.
Questions on binary tree traversal, multiplying big numbers represented as strings, and detecting k-th node from the back of a linked list.
Binary tree traversal can be done in three ways: in-order, pre-order, and post-order.
To multiply two big numbers represented as strings, you can use the grade-school algorithm or Karatsuba algorithm.
To detect the k-th node from the back of a linked list, you can use two pointers approach or find the length of the list first.
Q13. Difference between process and thread
A process is an instance of a program, while a thread is a unit of execution within a process.
A process is an independent entity that runs in its own memory space, while threads share the same memory space within a process.
Processes have their own resources, such as file handles and memory, while threads share these resources.
Processes are heavyweight and have higher overhead, while threads are lightweight and have lower overhead.
Processes provide better isolation and securit...read more
Q14. Explain C++ memory management & pointers
C++ memory management involves allocating and deallocating memory for variables, while pointers store memory addresses.
Pointers are variables that store memory addresses.
They are used to access and manipulate data stored in memory.
Example: int* ptr = new int; *ptr = 10; delete ptr;
Q15. Modified unbounded knapsack.
Modified unbounded knapsack problem involves maximizing the value of items with unlimited quantities and weight constraints.
Consider items with values and weights, along with a weight constraint
Dynamic programming can be used to solve this problem efficiently
Examples: Given items with values [60, 100, 120] and weights [10, 20, 30], and a weight constraint of 50, maximize the value
More about working at Adobe
Interview Process at VGC Advisors
Reviews
Interviews
Salaries
Users/Month