Skip to main content

Fourkites - Online test

Date of visit: 25.7.2018
Criteria: CGPA 7 above (there was no restriction reg. current arrears)
Platform: Hackerearth 
Duration: 2.30 hrs

Objective 10 questions: ( with varying weightage of 6 to 4 points)

The questions were based on data structures and algorithms.

Que 1: Given an expression like this "*+pq-rs", you have to write the postfix version of the expression.

Ans: pq+rs-* (explanation)
-------------------------
Que 2: For a given set of integers, where N is no. of elements in the set, choose a data structure with O(logN) to find the minimum element in the set and to insert a new element in the set which is not already present.

Options : (min-heap, binary search tree, binary tree..)

Ans: AVL-Tree (Solution)
-------------------------
Que 3: For a given postorder traversal of a tree (10, 9, 23, 22, 27, 25, 15, 50, 95, 60, 40, 29), find the inorder traversal for the given.

Ans: <try to solve it, and if done just update the answer.>
-------------------------
Que 4: For a given preorder "abdecfg" and inorder "dbeafcg", find the postorder traversal of this.

Options : ("debfgca", "edbgfca", "edbfgca", "defgbca")

Ans: debfgca (Solution)
-------------------------
Que 5: Find the complexity of the given function.
            function(int n){
                  if(n == 1) return;
                  for(i=1;i<=n;i++){
                        for(j=1;i<=n;j++){
                                printf("*");
                        }
                  }
                  function(n-1); 
            }

Options : (O(n^2), O(n^3), O(nlogn), O(n^2logn))

Ans: <try to solve it, and if done just update the answer.>
-------------------------
Que 6: Find the tightest upper bound  that represents time complexity of  inserting an object in a binary search tree of n nodes.

Options : (O(1), O(logn), O(n), O(nlogn))

Ans: O(n) (Solution)
-------------------------
Que 7: A priority queue is implemented as max-heap and initially it has 5 elements. The level order traversal is (10, 8, 5, 3, 2), two elements "1" and "7" are inserted in this order. Find the level order traversal of this heap after the insertion of new elements.

Options : (10, 8, 7, 3, 2, 1, 5), (10, 8, 7, 1, 2, 3, 5), (10, 8, 7, 2, 3, 1, 5), (10, 8, 7, 5, 3, 2, 1)

Ans: <try to solve it, and if done just update the answer.>
-------------------------


Programming 2 question (each 100 points)

Que 1: A tree with root R and relations are represented (N-1) edges.(Note the tree is N-ary ). Each node has a value associated with it Vali. Construct the tree and perform two operations:

Sum i ( should return the sum of the ith node and its children).
Update i , k  ( should update the node with value i by i+k )

Input
1st line : N  R
2nd line: N spaced integers (Example: if N is 5, you have to get 5 integers separated by a space)
N-1 line: U  V (i.e., There exist an edge between U & V)
Next line: Q
Next Q line: Query type.

Constraints
1<= N <= 10^5
1<= R <= N
1<= K <= 10^6
1<= Q <= 10^5
-----------------------------------------------------------
Que 2: There are N friends who have M friendships between them. They have rules: Friendship betwee two is (U, V). If U, V are friends and V, W are friends then U, W are friends. Each person have some money represented by coin value Ci. Given a sum of money find whether a person can borrow that amount from his friends. Print "YES" if he can borrow or "NO" if he cannot.

X - is the person borrowing money.
Y - is the amount that the person wants to borrow.

Input
1st line: N
2nd line: N spaced integers (Example: if N is 5, you have to get 5 integers separated by a space)
3rd line: M (No. of friendships)
M line: (U, V)
Next line: Q
Next Q line: X, Y




Comments

  1. In Interview I asked a question to Interviewer that how we Could get placed in big companies and he replied that it depends on the position we applying for..If we apply for software development,we need to be strong in programming,data structures,DBMS..etc.If we apply for Research & Development ,we need to be strong in Mathematics Subjects like Probablity & Statastics ,Operations Research,Graph Theory..etc.

    ReplyDelete
  2. Answer for 3rd question:

    In order transform always will result in increasing order of elements that is

    Ans:9,10,15,22,23,25,27,29,40,50,60,95

    ReplyDelete

Post a Comment

Popular posts from this blog

Sahaj - Online Test and Coding Round

Date of visit : 29/08/2018 Criteria        :  7.5 above First Round Duration : 40 minutes. The first round was a online test that had 50 multiple choice questions. The questions were very standard and covered everything like java, C, C++, Python, CSS, DBMS, OOPs, Networks, OS etc. After the first round 20 people were shortlisted for the second round. Second round Duration : 45 minutes  The second round was a coding round where we were given only one question. The objective of the round was not only to check whether the logic and code was correct but whether the students have used paradigms of the programming language they chose. for example, if we choose java to write our code we must have used OOPs principles. The question was to encode the given string in a format specified. Input : this is a secret procedure : 1. remove the spaces, s = thisisasecret 2. find the length of s, l  = 13 3. find w which is the ceil of sqrt of l, w = 4 4. separate s using w, s=

Accolite Online Test and Interview Experience

Date of Visit : 11.08.2018 Criteria : 6.0 and above (No Current Arrear) ROUND 1 Duration : 1 hr This round composed of both written and online test Each one happened for 30 Minutes consecutively without any filtration. There is no negative grading. This is a MCQ type round. Both test covered OS Topics like Job Scheduling,Process,Dead lock detection and avoidance algorithm,semaphore,Output for C programs , Network Topics from sub net mask problems,TCP header information,Purpose of Time To Live (TTL), DBMS queries from natural join,left join,join, Age Problems,Data structure 1. Here are some words translated from an artificial language. migenlasan means cupboard lasanpoen means boardwalk cuopdansa means pullman Which word could mean "walkway"? A.    poenmigen B.    cuopeisel C.    lasandansa D.    poenforc 2. Consider three processes (process id 0, 1, 2 respectively) with compute time bursts 2, 4 and 8 time units. All processes arrive at time ze

Ninjacart - coding round

Platform: Hackerrank     The challenge comprised of three questions which were based on arrays and strings .. It may seem easy but the problems were little tricky to solve.. If one is strong enuf in those concepts, then solving them becomes piece of cake😋. I listed two problems(I ve forgot the third one) asked below: Question 1: Buy stocks .. problem link Question 2: Find the number of smooth pairs problem link