Professional Documents
Culture Documents
Z Scalar
Z Scalar
Explain paging, Deadlock, ROM, RAM, Bankers algorithm, What is cloud computing, different
between cloud computing and data centers, some linux commands like how to delete a process
how you are able to find the process id.
Match the substring in the bigger string and find the index of the first occurrence of the string
catch was that if The bigger string is ABCFABCXBCDABCX and the substring is ABCD in place
of X the fourth matching character is on that place. I wrote the code in 11-12 minutes then they
asked me to optimize the code I said we can do that by using knuth morris algo.
Ancestral Sorting
Spin Wheel Question
Problem on Merge sort (Inverse Swap count):
https://www.geeksforgeeks.org/number-substrings-count-character-k/
Given n piles of boxes of unequal height. Find the minimum number of steps required to
make all piles of the same height. In one step, and no. of boxes can be removed from a
pile of bigger height to the next lower height pile.
5. You are given a binary array (with only 1s and 0s), and you are supposed to bring
all the 1s to the right and all the 0s to the left, or vice-versa. The operation that can
be performed is to swap two adjacent values, find the minimum number of
operations needed.
6. You start from the 0th position and at every step, you can choose to move I (i is
the step number) steps forward or can remain in your position. There is a bad
index in which you cannot stand. Find the maximum index you can reach in k
steps after avoiding the bad Index.
7. Given a list of names appended with roman numbers. First sort them with names,
then with the numbers appended to them, in increasing order.
8. A string question related to appending a string multiple times to get a given string.
If we can make the first string by appending the second string multiple times, then
we have to return the smallest string that will produce the second string by
appending one or more times.
Difference between TCP and UDP. What happens when you type www.google.com in your
browser. What happens when you connect an Ethernet cable to your system. What is
dynamic IP.
1. Given an array of size n and an integer k, find the maximum values of all the
subarrays of size k.
2. Evaluate an expression tree.
3. Asked the third question, to tell the logic of forming the expression tree, but then
the time was over.
1. Then asked a coding question: Given a comma-separated list of keys and some
other comma-separated values in a vector of strings(like a CSV file), parse that
and return a vector of the map with key-value pairs in it.
2. Asked about child, parent, zombie process.
3. Difference between thread and a process, I was confused and giving wrong
answers, but he went on for around 10 mins.
4. Then loaded a question from the first round (question with the badIndex), and told
me to optimize my code, I was able to give the optimization in the case when we
are calling the function multiple times(by storing all the results beforehand).
Wrote the code: char *ch = new char[10]; Asked about memory allocation in heap and
stack. Create 10 character pointers.
Count the number of consecutive letters and append the number to the character. Not
allowed to use the map or any extra space. Manipulations had to be done on the input
itself. The only extra space given was some space at the end of the input string (which is
equal to the length of the string). Struggled for an hour in that but didn’t reach the final
answer.
Input : “aaaabbbca”
Output : “a4b3c1a1”
Section C: This section has 3 coding questions. The first one was on array, the second
one was on a string and the third on was on trees. The first two questions were easy but
the third one was very difficult.