2019-20 Inter Iit Placement Questions

Download as pdf or txt
Download as pdf or txt
You are on page 1of 198
At a glance
Powered by AI
The key takeaways from the document are guidelines on formatting, coloring and maintaining the company interview question document. It provides information on companies that have recently visited different college campuses and also requests to add details for some other companies.

Some of the guidelines mentioned are to mention college name and CPI cutoff eligibility using colors, add companies on separate pages, don't remove headings as it affects formatting, and don't remove questions as others may be referring to them.

Companies that have recently visited campuses mentioned are Oski Tech, Salesforce, JP Morgan, Morgan Stanley, APM, Jio, Swiggy, Jaguar Land Rover, Sprinklr among others for colleges like IITs, IISM, IIIT Allahabad etc.

Guidelines:

● Mention your college name


● Mention C​ PI Cutoff and eligible discipline,​ please apply
red color highlights mi
● While typing, use ​Ctrl + Enter​ to go to new page
● PLEASE KEEP COMPANIES ON ​SEPARATE PAGES
● Enable outline for Company Shortcut
● Page edit history will be maintained in History Page
○ why has the edit history link disappeared?
● Please ​don’t remove questions​, some people are ​frequently
deleting screenshots​/questions.
○ someone removed ​motorq 3rd question​ and also solution
link to another company’s question​ ​which company?
● If possible, mention whether the company is open for
M.Tech. or not
● Green
○ For External Links
○ And Answers to any questions
● Red
○ For CPI and Discipline Cutoffs
● Orange
○ For Very Important details
● Pink
○ For Important details
● Cyan
○ For a Question
● While adding ​external solution links​, please apply green
color highlights
● Mention ​CPI Cutoff and eligible discipline​, please apply
red color highlights
● Please ​don’t edit or remove​ heading 1 or heading 2 style ,
it ​screws up the outline​ and makes the ​document look
chaotic.

KINDLY ENTER COMPANY HERE, ​ONLY IF​ ANY INFO IS ​ADDED IN DOC
(Anyone who solved the question completely is requested to
share the solution​ and/or approach)
Company GRID

Queries, Request, and Grievances Section


Enter a Tag [Q], [R], or [G]
● [Q] Have any of the following companies visited any campus?

Question (company) Answer Details

Oski Tech

Salesforce Oct 29 @ IIT ISM


Nov 9 @ IIT R
Nov 9 @ IITKGP

JP Morgan Oct 12 @ IITG SDE test

Morgan Stanley Oct 12 @ IIT BHU SDE Test


Nov 5 @ IIT ISM

APM
(Challenge results date?)

Jio

Swiggy

Jaguar Land Rover


(for SW & Core Mech)

Sprinklr India

Worldwide IITD
Oct 31 @IITR​Oct 31 @IIT

NOV 7 @IITGN

Will visit IIIT Allahabad

Oct 23 @ IIT KGP

anixNov 2 @ IITB

Oct 9 @ IIT& Visited IITB

EXL Service Oct 1


8 @IIT BHU

BAJAJ AUTO(ELECTRICAL)

Oneplus Nov 2 @IITB SW Test

American Express IITD

Nutanix @IITBcan -
@IIT ISM 6 Months Intern

Gartner ?

ABinBev IIT KGP 10thNov Questions link


://docdro.id/OYK5J6H

MTX Group https

● [R] Please add following company(ies) details


○ Please delete after adding the company details in the document

Company Details Required Want


Response from

Razorpay questions

@ IITK

Policybazaar CTC Breakup


Microsoft questions @ BITS
@ NIT
Kurukshetra
@ NIT Trichy
@ IIIT
Bangalore
@ IIIT Delhi
@ NIT Wgl

Uber questions @ NIT Wlg

Salesforce questions @ IIT ISM

Amazon MCQsn @ IIT ISM

Atlassian

Swiggy questions +1+1@ IIIT


( also not there in last yr Allahabad
doc)

Qualcomm (Sw. Engg) questions +1+1+1+1+1+


1@ IIT Delhi

Jio questions

VMWare

FRT

Oracle Coding questions

Salesforce Coding questions @ NIT Wgl


@ All NIT
@ IIT ISM

Softbank Coding questions

CISCO questions @ IIIT BNGLR

Futures First questions @ IIT BBS


@ IIT ISM

L&T questions

TATA questions

ECC questions
Make My Trip questions @ NIT Wgl
@ NIT
Surathkal

Citibank (Technical Online test questions @ IITKgp


Programmer Analyst)

OLA (APM) Selection Process

sprinklr Questions needed

EXL Service Questions needed

Fractal tAnalytics Questions link: 10th Nov


https://docdro.id/EsVrF IITKGP
Gp

MasterCard AI Questions needed


+1

Irage Capital Please add the


questions

Sumo Logic Please add the


questions

Mavenir Systems Questions @ IITD


needed​+1+1+1+1 @ NITTrichy
@ IISC

Barclays QuestionFphopepes
needed

Siemens PLM Software @IITKGP

Someone deleted zauba questions please add


them back​ ​+1+1+1+1+1+1+10
● [G] @NIT
○ PLEASE ALSO MENTION YOUR COLLEGE NAME ALONG WITH THE QUESTION
SET
(IIT guys have written their college name)
● [G] @ IIT
○ [IITK] Please tell the placement scenario in your campus? The count of companies at
IITK is quite low compared to last year.
○ [IITD] WHOEVER UPLOADS ZIP FILES FROM​ IITD​ THEY ALL ARE CORRUPTED.
PLEASE ​SHARE SCREEN SHOTS​(BY INSERTING IMAGE IN THIS DOC) OR
DESCRIBE THEM IN TEXT
● [Q] Has Flipkart shared it APM ppt challenge in any college?
○ yes in IITG, IITBHU, IITR, IITK, IITB, IITM, IITKGP, IITD,

​ ​Has Fractal Analytics visited any campus?? ​Link to the questions’ PDF added above
Can someone add ​coding questions​ asked in ​Data Analyst profile​ in ​Zilingo?
Zilingo

ZILINGO QUESTIONS please ! only IIT BHU and IIT G have added. IIT R has test today.
Please
ZESTMONEY add more questions please!
What is the CPI cutoff for Amazon? ​(None in IITD, IITKGP)
What is the CPI cutoff for Flipkart? ​(None in IITD, IITKGP)
What is the CPI cutoff for Microsoft(SDE / DS)? ​7.0(in IITK)
What is the CPI cutoff for Worldquant? ​8.5(IITM)
Has Flipkart visited any college? ​IITK, IITG, IITB, IIT BHU, IITR,IITKGP everywhere with APM profile -
visited IIT BHU, IIT KGP with APM, SDE, Analyst
MNIT guys please add OYO Rooms Business Analyst questions ? (*What is BA ??)
What is the CPI cutoff Samsung R&D Delhi? - ​7.0
Upload Honeywell questions if they came anywhere yet.
job sequencing problem 2. leetcode 741 cherry pickup 3. Is this a tree?. ​IIT-H IIT-K
Has dwell visited any college?
Any information about dunzo test? They asked 3 coding question in IITK in one hour
What were the sections in the test of Goldman Sachs?+1
add some more questions asked by Goldman Sachs.
What is CPI cutoff for FlowTraders? And, also can someone describe test+interview process
followed by FlowTraders? test patterns,etc ​1st round questions are in the doc, 2nd round is easy fast
math ( 75 questions in 10 mins ) {min 60% cutoff}, 3rd round is IQ round ( venn diagram,LR, etc) (68
questions in 30 minutes)
Please add Atlassian Questions.​+1+1
Has Publicis Sapient visited any college? If yes, please add the questions. Yes, it has visited NIT
Warangal. But those guys don’t post the questions. If anyone has a friend from NIT Warangal ask

them
Inversions in an array
Did cohesity opened for M.tech in IIT Delhi and what were the branches it was open for? ​No, only for
dual degree and BTech
Did Visa come any place and opened for M.Tech? ​Earlier didn’t open for mtech but opened on
12/10/19 for CS, in IITK.​ It is open for Mtech students in IITG
Someone please add the questions asked by VMlware(2018). 
Please add Microsoft questions. There are only 3 questions till now! 
Has Accenture(JPN) visited any campus till now? Please add rquestion asap. questions please +1   

Has Cure Fit visited any campus? Please add questions ​Questions please! @IITG ​one easy greedy question,
second also easy graph question could
be solved easily by doing a modified bfs​ Which profile??? Can anyone tell the specific questions!
Has Dynamic Technology Lab visited any campus? ​Shortlisted only 6 for test in IITK in one profile
and 7 in another..so very hard and tough shortlisting process even for giving the test
Has jiosaavn and SPL labs visited any campus till now? Please add questions.
Please add Questions of HSBC. IIT H?? ​Screening Test Question same as given on ​Li nk​.
If Mercedes Benz, Qualcomm visited any IIT plz add the questions ​Its is gonna visit IIT Kanpur
If MATHWORKS visited any IIT plz add the questions​ yes, IITK, ​MATHWORKS has visited IIT kgp/
questions added, probably they are going to ask from the previous years only as most of the
questions and pattern were repeated
IITK AND IITKGP Guys do Mathworks coding question were same for all core electrical and CS ..?
YEAH mostly similar
as Meesho visited any campus for SDE? please add questions if visited.
Has Flipkart released its dates for APM case study or released the names of selected students after
APM deck? Not in IITG. ​Declared in IITKGP IITK
If UIDAI and GSTN visited any campus, pls add questions. ​Only MCQs were asked related to
Reasoning and CS concepts.
Is Quadeye scheduled in any IIT? YES IITB IITK
Test in IITD is scheduled on Oct 16th. Test in IITB on 2nd Nov
What branches was cogoport open for in IIT KANPUR?? ​CSE,EE,MTH(Btech,Mtech,Dual)

IIT MADRAS guys update CodeNation question if they visited​. ​Not yet
Has Oracle visited any other campus other than IITG? ​IITD IITB IITH
Eligibility of Plutus Research Capital and cpi cutoff? ​CSE (B.Tech) EE(B.Tech
and Dual Degree); no cpi cutoff
Why was Accenture Japan test got cancelled, IITG guys?? ​server issue from
accenture side
Did Trexquant visit any college ?? Yes IITB IITK ---Please add questions​ ​dont remember the 3 coding
questions exactly but can be easily done using Python. one question especially asks to do in python.
All rest MCQ’s were of same kind where one headline/situation was given and was asked whether the
stock price of the company affected as per the headline will go up or down
Is Python Allowed for Microsoft Online Test?
HAS PHONEPE VISITED ANY CAMPUS YET? URGENT ASAP? ​Yes, IITR and NSIT.​ ​When will
Phonepe visit your college ? test is scheduled in iitk.
Is INDEED visiting any campus this year? If not visiting then write “No” ​ Not IITD as of now, “No”
IITBHU,
PLEASE ADD ENPHASE ENERGY QUESTIONS IITK ELECTRICAL GUYS

Please add Oracle company screenshots


mastercard​+1+1+1+1+1+1

Please add Trexquant questions +3


Trexquant test CGPA cutoff? IITK, IIT Delhi.?(No cutoff for IITM)
Did Goldman Sachs visit any IIT? If not what are the tentative dates?+1 ​IITD
visited and will be visiting IIT-B; test on 1st Nov; IITKGP- test on 1st Nov;
IITM-test on 1st Nov; IIT(ISM) test on 1st Nov.
Did Salesforce visit any IIT? If not what are the tentative dates? in iitr 9th nov
IITKgp guys please add Intel Questions. +1for hardware
IIT G Guys please add SocGen MCQ Screenshots.+1
Has Sprinklr asked MCQ related to OS / DBMS / Networks in any college? Not in
IITK(asked three coding q) Not in IITR also
has SAP labs visited any college? please add questions ?? +3 ->iitk
IIT BHU guys please add Societe Generale Questions.?+1
Did MasterCard(AI) visited any IIT ?if not what are tentative dates? Yes it
visited IIT R today. Someone please update questions asap.
Did Cairn India visited any IIT?
Can someone add Udaan.com questions for finance and supply chain roles?
Did Schlumberger Software visited any IIT ? please add questions??+1 ​IITR
(​very easy ques. 1.) find the lexicographically smallest substring |s| <= 100​ 2.) {
Array with ‘w’ and ‘b’ given, if you see three consecutive w’s pop middle w, same for b. Store count of w pops and b pops if(b> w) return
“BOB” else wendy. Mcqs also easy. String search time complexity, inorderer traversal time complexity, l = k+1,

}
Please add EXL SERVICE questions @IIT BHU if test has been conducted
Has these companies visited any campus? And any idea if they are hiring
this year or not:
1. Lucideus
2. IBM IRL — Yes (Visiting IITD on 9th November) Please add the coding
questions asap
3. Fortanix
4. Myntra - Coming to IITM, can anyone upload the solutuion of Load
balancing problem.
5. Paytm
6. PayU
7. PhonePe -- Yes (IITM, iitr, IITKgp,IITG, IITR)
8. Thoughtspot
9. Apple -- Yes(Visiting IITKgp on 14th Nov) Please add questions

BOUNCE: What was the resume shortlisting


criteria? Branch? Cgp?IIT BHU GUYS Pls Respond

IITK,IITG guys please add Vmware questions Screenshot ?

What was the duration of MotorQ coding exam ?

Has Barclays visited any campus? Someone please share the


coding questions asked.. Platform?

What is the CTC offered by Squarepoint Capital?

Somebody deleted TRELL questions please add again. ​Added back


Someone deleted zauba questions please add them …………..please

“Sprinklr” questions r not at all opening plz delete and reupload asap​.
MICROSOFT
Only 3 questions from Microsoft. Microsoft visits almost all colleges, come on
guys add more questions/. PLSSS
One Queue Based Question. Just queue and dequeue the elements and compute a
function when the given condition reaches.

Minimum adjacent swap required to make a string palindrome.


(solution​https://stackoverflow.com/questions/8031939/finding-maximum-for-every-window-of-
size-k-in-an-array

https://www.codechef.com/problems/ENCD​23

Codechef Solution Link​ (​ Don’t follow this solution, it gives incorrect answer for “ntiin”, refer
to the code on stackoverflow )
Find the minimum distance between a given 2D point and a set of 2D pos ( had to
round it off).

IITD
SDE Profile: Conducted on mettl platform. 1.5 hrs for 3 coding questions.
Same ad-hoc question as above. Queue approach passed all the test cases.
Same as above.
Same as above except for maximum instead of minimum. Brute force approach passed
all the test cases. ​Can you please elaborate 3rd question with an example ?
Link to the questions: ​https://imgur.com/a/DmOhB0y4
(python users hint: user round(num,6) to round num to 6 decimal places
(Both the codes in the images were accepted)

DS Profile: Conducted on mettl platform.


62 MCQs in 60 minutes. No negative marking. Questions based on concepts in classical
ML, recommender systems, NLP, etc.

IITH
SAME

fAmazon
1. String Parsing Question. (​URLiffy​)
2. Infix to Postfix
3. Postfix Evaluate
Infix evaluation (using 2 stacks)
4. Alien Dictionary
5. Sort numbers when rank of each number in decimal system is changed.(​Could anyone please
elaborate the question or give some link
of this question on some website) ​ as per my understanding when each number is mapped
to another number for eg. 1 has rank
4, 2 has 9, etc and then you have to sort the modified number system.
6. Inversions in array.
7. Longest Common Subsequence.
8. Longest increasing Subsequence
9.​ ​https://www.geeksforgeeks.org/dice-throw-dp-30/
10. Longest decreasing subsequence.
11. MEAN, MEDIAN, MODE OF AN ARRAY .
12 You are given a String S made of lowercase English Alphabets. Find the length of smallest substring
with maximum number of distinct characters.
1<= |S| <= 10^5, where |S| denotes the length of the String.
https://www.geeksforgeeks.org/length-smallest-sub-string-consisting-maximum-distinct-characters/
13. ​https://www.geeksforgeeks.org/count-possible-decodings-given-digit-sequence/
14. ​Replace every element with the smallest element on the right side
15 Right, Left, Top, Bottom view of the tree.
please mention the platform ?
****Can anyone know what was “Walls” problem last year in IIT Delhi? Please write if anyone knows.

IITG
2 coding question from the pool of questions. (90 mins total for both section) ​Were all these
questions given and we had to select and do any two? ​You get two questions from the
pool
28 mcq - all of them focused on selecting the correct output of a C/C++ program out of 4 options
Coding:(Platform mettl) Do add ​using namespace std​ if you want to print something in console.
Dice Throw: ​https://www.geeksforgeeks.org/dice-throw-dp-30/
Longest palindromic subsequence:​ Please don’t erase the questions
Number of inversion in a array: ​https://www.geeksforgeeks.org/counting-inversions/
Count Derangements:
https://www.geeksforgeeks.org/count-derangements-permutation-such-that-no-element
-appears-in-its-original-position/
Evaluate Postfix :
https://www.geeksforgeeks.org/stack-set-4-evaluation-postfix-expression/​ ​Was it single
digit version or multidigit version with space as given on the gfg. It has two version ?
Same question as in the link: ​https://codeforces.com/problemset/problem/245/B
Nth number of a GP: Return answer upto 3 decimal places
Largest sum contiguous array:
https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/
Mean, Mode, Median:
https://www.geeksforgeeks.org/program-for-mean-and-median-of-an-unsorted-array/
Euler’s Totient Function: ​https://www.geeksforgeeks.org/eulers-totient-function/ 
Given a, b and c coefficients of a quadratic equation, find the roots of the
equation(assume roots to be real)
Longest Increasing subsequence:
https://www.geeksforgeekwios.org/longest-increasing-subsequence-dp-3/
Infix to Postfix expression

IITD
2 coding question from the pool of questions. The pool questions were same as mentioned above.
28 MCQ mainly asking output of C/C++ program. (Tip - Use the IDE provided for coding to get the nt
issues if they occur and don't lose calm. ​Was it fullscreen mode?​output of asked MCQ question, if
you change the language from any other to C/C++, the whole code for that coding question will be
lost.).
Sharing my experience:
1. Even though #include <bits/stdc++.h> was getting added, using map or unordered_map was
giving error. So, my advice is not to use it. Also, you need to add using namespace std; yourselves.
2. Mettl platform is not good as hacker rank so be prepared for environment issues
3. ​Amazon_IITD_9​ (Don’t delete this link)
4. Check apples question from the link as its not there in above pool. ​Apple question is not clear in
the above link. can anyone give some test cases or explain? ​As per my understanding we can take
out the mean of the apples takes O(n) and then for the baskets that has apples more than the mean
(only they are to be moved in baskets with apples less than mean) you can count the sum of extra
apples. e.g A = {1,2,4,6,7} mean is 4 apples so the basket of our interest is 4th and 5th and apples to
be moved are (6-4)+(7-4) = 5 apples(Desired Answer) Someone correct me if I am wrong.
5. For mean, median and mode question, my nlogn approach (alo]ng with a few friends who got the
same question) to find the median did not get accepted. It may be the case I made some serious
blunder, hence request someone from IITD to acknowledge this question if your test cases passed
for this question and also to share the code. ​ Can we do it using multiset takes O(n) ? Was
there a space complexity issue? ​ ​I sorted the array (nlogn) and found mean, median and
mode, 1 test case gave TLE, rest all passed (Python).
(** Same , im pretty sure my solution is correct (only default case passed).What can we do now?** )
Were you getting TLE ?
Please see this link for O(N) solution to find median
https://www.geeksforgeeks.org/kth-smallestlargest-element-unsorted-array-set-2-expected-linear-tim
e/
I think it could be solved in O(n) using median = mean - ((mean - mode)/3) formula, which is relation
between them. Mode can be calculated in O(n) using hashing.Correct, if I am wrong? ​It’s not always
true. It works only when the data is normally distributed. Consider the case when arr={1,1,2,2,2} and
calculate the mean, median and mode by yourself and check.

IIT(ISM) DHANBAD
Same set of coding questions and mcqs as above, no difference Mode median question can be done
in O(nlogn) . See how to convert string to char array dynamically from gfg, bcoz every string function
you have to return dynamically in char array form only. so practice it. Mettl platform is not good as
other. Some STL were not working. map /unordered_map were working fine

IITB
Mettl platform
Same MCQ set as above
Same Coding questions as above

IIT KGP (24/10)


Same mcq set as above.
Coding questions:
1) Dice throw
2) Given an arr, arrange it so that the sum of absolute differences of adjacent elements is minimum
(sol:just sort the arr)
3) Inversions count in array (n^2 sol accepted)
4) Given coefficients ,find the roots (repeated from above).
5) A linear equation is given in the form of a string for eg “12+13+x=8”. Find x.
6) Internet address. (codeforce p
7) roblem 245 b).
TIP: mettl(platform of test. It keeps track of tab switch)(test is open in new tab) but you can keep it in small
screen so that you can see things in the below tab you can even scroll things in the below tab; keep solutions
of pool questions in a tab below the test tab
IIT KGP(16/10)
open for almost all
2 questions from a pool of questions. Mostly repeat from previous year.
total 37 question including 2 coding questions. there are many sets of questions. I
don't know all.
one part from mixing of OS, DBMS, networking.
three parts from c, c++, java respectively. You have to attend any two out of three
sections.-
there is a bonus section for python
In my set:
code 1:
team formation from previous year.
Given an array of non negative integers, select largest numbers from it given the following
conditions:
Choose the numbers in sequence and keep removing them from the array, every time number
can only be selected from first or last m elements, in case of conflict choose the one with
lower index. In case first and last m elements overlap, choose the largest number of array.
Return the total sum of them. ​solution here
another solution ​here
Can this be done using two priority queues of pairs sorted in custom order?
code 2:
You are given a string of only small character and an integer k. And you are given an array of
value (0/1) for every character. 0 means normal and 1 means special. k denotes how many
normal characters at most you can use in your longest substring.
ex:
string=abcde, k=1;
charValue: abcdefghijklmnopqrstuvwxyz
10101111111111111111111
then longest substring would be abc or cde. so answer will be 3.
explanation: “abc” one normal char is ‘b’. so you can not include ‘d’ anymore, because k=1.
same apply in “cde”.
** you have to do two different coding question in two different languages.
** there are still many questions. in another set, I heard, “simple query” was there from previous
year.

Code 2:
There was another question named DIAMOND MINE which has been asked previously.

Solution_approach - I tried using recursion approach, the answer was correct BUT it was
showing TLE on most of the cases
there were 15 test cases and I passed 3 using recursion.
you have to use dynamic programming.
This is same to LEETCODE 741 cherry pickup, here is the ​link
Code.4: 2 sum
Code.5 : roll a string. rotate characters of a string for an array of queries. eg if query is 4 and
string is “kharagpur” then output should be “libsagpur”
Code.6: Distinct pairs forming a target sum in an array (repeat of prev. year)
Code7:
IIT Kharagpur
Time - 90 mins
Department- Open for all
Profile- CS Bachelors, Embedded,Control,VLSI,Signal Processing
Platform-hackerrank
No of Questions-36 (including 2 coding questions rest all MCQs)
6 questions -Aptitude/probability, 6- c language, 6- c++,6- OS, 5-java(choice),5 python
(bonus)

language allowed(c/c++,java)
write codes in any two different language
Code 8

IIT Kanpur
There were different questions for different sets (2 coding questions per set).
Diamond mine (previously asked)
Roll a string
https://www.geeksforgeeks.org/roll-characters-string/
Weird Faculty
Team selection

IIT BOMBAY
Same as above
OS Scheduler: Publishing house has to print and bind ​N​ books, ​X​ printing machines are given with different
printing time and ​Y ​binding machines, each binding machine takes ​K​ time. Find minimum time.

Graph with red-black nodes: each node has value 0 or 1(red or black). And cost of each edge is given, find
minimum cost from source to destination such that abs(count(red)-count(black))<=K.

IITD
2 Questions, 1.5 hr
Role: Member of Technical Staff
Open for M.Tech
https://imgur.com/a/kPqGHf

IITK, IITM
Que 2.
THOUGHTSPOT
Build BST from sorted LL.
Snakes and Ladder game..
Max length valid palindrome ​ //what does it mean ? (longest palindromic
substring?)

GOLDMAN SACHS
What is the probability of getting consecutive 6,6 before consecutive
6,5{Please verify answer: 1/2}​[I am also getting ½] can any one write solution for these
Derive an Fexlion for the expected number of steps an ant makes to travel from one
vertex to diametrically opposite vertex of an N dimensional object(eg - N=3 is cube).
The ant is free to move at any path each time from a vertex.
Is the question correct? Is there a condition on number of steps(hope it is in ‘n’ steps) ans: (n!
n​
/ n​ )? else isn’t the answer 1 ..?
Answer is 10(N=3) assume some variable and do recursion
(https://math.stackexchange.com/questions/28179/logic-question-ant-walking-a-cube)
Prove that for a given ring, there exists at least two diametrically opposite points,
which will have the same temperature (temperature is continuous along the ring).
(how does the temperature is varying…. please write the solution)

What is expected no. of throw to get consecutive 6 different numbers on a dice.d no. ,
(SOLUTION REQUIRED)

Also, many questions were on the higher level concept of "Expectation". So do study
the same.
Leetcode problem: ​Product of array except self

IIT​ ​Roorkee
Q.1) ​https://www.geeksforgeeks.org/longest-monotonically-increasing-subsequence-size-n-log-n/​(​n^2
passed only 3/10 hidden test cases​)
https://www.geeksforgeeks.org/minimum-number-deletions-make-sorted-sequence/

Q.2.) ​1/x + 1/y = 1/360. Number of solutions for x and y, x and y are natural numbers (ans = 105 (i think
so))

Q.3)

IIT Bombay

Q1:Four points are chosen uniformly at random on the surface of a sphere. What is the probability that the
center of the sphere lies inside the tetrahedron whose vertices are at the four points?

(https://www.quora.com/Four-points-are-chosen-uniformly-at-random-on-the-surface-of-a-sphere-What-is-the-p
robability-that-the-center-of-the-sphere-lies-inside-the-tetrahedron-whose-vertices-are-at-the-four-points)

Q2: If the integers m and n are chosen a t random between 1 and 100, then the probability that a number of
the form 7m+7n is divisible by 5 is A.¼ B.1/7 C.⅛ D.1/49

(https://www.quora.com/Four-points-are-chosen-uniformly-at-random-on-the-surface-of-a-sphere-What-is-the-p
robability-that-the-center-of-the-sphere-lies-inside-the-tetrahedron-whose-vertices-are-at-the-four-points)

IIIT Hyderabad (ADD THIS IN main doc)


Coding :3 coding question (2 + 1(advanced))
1.Total fused bulbs
Given a string of 0 and 1 (0 indicates bulb is off , 1 indicated bulb is off) . Given range of indices : Add
1 to the indices. Print the number of values which are greater than equal to a given number d( No of
toggle required to fuse the bulb).
Return number of fused bulbs( Value=1 is considered toggled once)
Ex:
S: 010011
Q: [1,3] , [3,5], [0,2]
d:2
Final string: 132222
Return val: 5
Solution : Use range query (Brute force was also working)
2. Permutation of string
​Given an array of N numbers with M distinct no . Find minimum no. of numbers such that on permuting those
in any order , digit with same value come together.
Ex: 1 3 1 5 6
Choosing indices 0 and 1 or 1 and 2 makes all the one’s together
So ans: 2 ( two indices are chosen)

3. Digit Sum (Advanced) (based on Digit DP)


Given a lowerlimit and upperlimit (Values on coupon).
A coupon containing the sumofdigits= S will win the lottery. Find S in such a way that max no of people win
the lottery.
In short return the count of sum (S) that is repeating max no of times. And the ways to choose that count.
Ex: LL:1 UP:5
array:[1,2,3,4,5]
Sumof digits: [1,2,3,4,5]
Count:1
No of ways to choose that count :5 (max count =1 for 5 )
Ex: LL:1 UP: 10
Array [1,2,3,4,5,6,7,8,9,10]
Sumofdigits: [1,2,3,4,5,6,7,8,9,1]
Count: 2 (sum=1 is repeating 2 times)
No of ways to choose :1

Constraints : 1<=lowerlimit<upperlimit<=10^18

https://www.geeksforgeeks.org/digit-dp-introduction/

Other:
1. 3-4 questions were from previous asked questions rest were different. Questions were from
OS, Expectation and probability.
2.​: If the integers m and n are chosen a t random between 1 and 100, then the probability that a number
of the form 7^m+7^n is divisible by 5 is A.¼ B.1/7 C.⅛ D.1/49

CISCO
(Software Consulting Engineer)
1)Digital Electronics+aptitude+3 finance questions+networking+os+basic puzzles. (Every section had
cutoff).
2)one programming question: Confusing one,had to play with cin.getline(), cin.ignore() and many
terms to read and output strings in different lines.
Total 26 questions, 25 mcqs and 1 coding. Coding was also of 1 mark. Give more time to mcqs. 1
hour time was given. Platform:HR
Can somebody tell the exact programming question?

IITK
MCQ were from Operating system, networking, logic gates, digital electronics, aptitude, basic C
Programming, computer organization. 60 Min 27 Questions
Operating System(around 3-4 questions):
Processes with their arrival and run time was given and one has to find lowest average
turnaround time among round first represent ids and second is the time taken for each
process id. Return top k ids robin, FCFS, SJF scheduling policy
One was related to deadlock
Coding Question (There were two questions):
Longest distinct characters substring
Given two array, with maximum time. If two processes take same time, then pick most
recent process-id.f
Aptitude(around 4-5 questions):
One was using AM>=GM, This section was simple
Family relation question
maximum distance between any two points in a cube
Logic Gates
POS was given and one has to find equivalent SOP
Networking(1-2 questions):
This was based on the definition of different transmission modes: simplex, half duplex
and full duplex.
One specific question related to VMWare configuration (can't recall exact Q: ‘what is
VMWare consolidated backup?’ there were options provided)

IITR
Coding,Networking,OS exactly same questions as IITK
Can someone post the screenshots of the MCQs? ​ ​+1

FLOW TRADERS
IITG
Profile: Graduate Trader.
Coding: only in python.
Problem One: Tennis Game
Tennis players A and B have probabilities of a = 0.6 and b = 0.4 respectively to win a point. The
current score is 30:30, what is the probability that tennis player A wins this game?
The games are scored as per normal tennis rules starting at "love" (or zero) and go up to 40. From
love, the first point is 15, then 30, then 40, then the game point, which wins the game. One of the
players has to win by two points. Say your opponent wins the point after you are up 40–30, the score
would then be tied, and you would announce: "40–all", otherwise known as "deuce". Now you
continue to play until one of you has a two-point advantage and wins the game.
You need to submit both python file and image of your work inside a zipped file
You'll receive -1 for all wrong submissions so make your submissions judiciously
Problem Two: Elevators
There are n elevators moving independently of each other in a building of 100 floors. The elevators
move continuously through floors 1, 2, . . . , 100, 99, . . . , 2, 1, 2, . . . , except that they stop on a floor
on which the button has been pressed. Assume that time spent loading and unloading passengers is
very small compared to the travelling time. Suppose you reside on floor 92, answer the following
questions accordingly:
What is the probability that the first elevator arriving on your floor moves up?
Suppose the lifts move at the rate of 20 floors per minute, what is the expected time it takes to reach
floor 1 from floor 92, assuming you take the first lift that arrives on your floor. Compute your answer
in seconds and just give the integral part. So if your answer is 123.67, return 123
We'd recommend that you try to solve this for small values of n and then figure out the general logic
You'll receive -1 for all wrong submissions so make your submissions judiciously
Problem Three: Logicians with Hats
Thirty-one logicians came from different countries to participate in the Annual International
Conference on Logic. After greeting all 31 participants, the main organiser remarked that it would
be necessary to run a special test to check whether all participants were indeed logicians as they
claimed to be. He explained kindly that in the past there had been cases where some
non-logicians tried to get into the conference, and he would not allow that to happen again. He
further explained the basis of the test: he said that each participant would get a dot of some
colour that he would place on each participant’s forehead. Each participant would be allowed to
look around (thus everyone would see the dots of all other participants except his own), but no
communication of any sort would be allowed. After a while, the organiser would ring a bell and if
any participant had deduced the colour of his or her dot, they should leave the room. The
organiser would ring a bell as many times as necessary. As the organiser knows the colour of all
of the dots, he also knows when each participant should leave the room (if the participant is a
logician). This was the essence of the test.
At this stage, the organiser asked the participants whether there were any questions. One
participant raised his hand and asked whether it was possible to pass the test - i.e., to correctly
guess the colour of his dot. The organiser replied that he had selected the colours of all the dots
in such a way that every participant should be able to deduce the colour of his/ her dot.
As this was the only question from the crowd, the test started. The organiser placed the colour
dots on the foreheads of all of the participants and waited for a while so that everyone had a
chance to look around. After a few minutes, he rang the bell for the first time. At this moment,
four participants left the room. When he rang the bell for the second time, all the participants with
red dots left the room. When he rang the bell for the third time, no one moved. When he rang the
bell for the fourth time, at least one participant left. Soon afterwards, he rang the bell again, the
participant who asked the only question before the commencement of the test left together with
his sister and some other participants - he and his sister had dots of different colours. At this
stage, there were still some participants left in the room. Assuming that all the participants were
true logicians (so everyone was leaving the room at the right time), how many times did the
organiser ring the bell?
You'll receive -1 for all wrong submissions so make your submissions judiciously

ITRON

IITM
1.Aptitude 35 questions
2.3 coding questions
https://www.geeksforgeeks.org/find-two-numbers-sum-xor/
https://www.geeksforgeeks.org/perfect-number/
Given N lists, each list has P strings find if count of unique strings is greater than K.

NFERENCE LABS

IITM
2 coding questions
Array Journey
The Jungle Book
http://prochal.com/2019/06/the-jungle-book/
PLEASE ADD THE PROBLEM DESCRIPTION FOR “ARRAY 4

HONEYWELL

IITH
1 ) Activity Selection Problem :- Arrival, duration arrays of companies given.
Need to schedule such that number of meetings are maximised-------------------
https://www.geeksforgeeks.org/activity-selection-problem-grefaceedy-algo-1/
2) Dynamic Programming :- N*N matrix of (-1,0,1) given. -1 represents
blockade, 1 represents a diamond and 0 is for empty route. A traveller goes
from (0,0) to (n-1,n-1) and returns to (0,0). Need to output the maximum no of
We want to construct a structure made as follows: imagine that two long
cylindrical pillars each with radius 1 intersect at right angles and their centers
also intersect. What is the volume of this intersection?diamonds collected (a
diamond can only be collected once)
https://www.geeksforgeeks.org/maximum-points-top-left-matrix-bottom-right-re
turn-back/
3) Tree based question:- given edges in (parent,child) form. Return
Lexicographically least Preorder traversal.
sol 3
IITKGP
For software profile (no CGPA cutoff, open to all depts and all courses):
https://imgur.com/a/x8xbOuD
IIT Delhi
Same as above
WORLD QUANT

IITD
Is there any cg cutoff?​8.5

40 questions, timed test with each question having its own time. Three
questions wethe re same as that in last year’s doc.
Apart from them:
https://brainstellar.com/puzzles/1018
https://math.stackexchange.com/questions/2455709/possible-dimen
sions-of-the-intersection-of-three-vector-subspaces
A stock increases in its value by 5% or decreases by 5% in a day
with equal probability. Expected value after 60 days
is it’s answer is =0?? ​It will be the same as the initial price of the stock
r1=distance of a point from center, r2=distance of point from
circumference. r=min{r1,r2}. Median of r. (​solution : (r by root 8)​ ???
A question on definition of exponential decay.x
https://math.stackexchange.com/questions/1839496/expected-numb
er-of-tosses-to-get-3-consecutive-heads
z^3-2z-5=0 has roots a,b,c. Cubic equation with roots a^2, b^2, c^2
with leading coefficient 1.
Volume of tetrahedron inside a cuboid, such that 4 vertices have no
common edges. (Do with box product)
Some questions on code outputs

Samsung R&D, Bangalore

Test Details & Pattern:


Write code in C/C++/Java to solve a given problem. Code should compile, run and pass all given test
cases.

·​ ​Emphasis on working code with efficient Programming Logic, Algorithms, Data structures,
NOT dependent on any Platform/API

Duration 3 hours

·​ ​Candidates proficient in C# or other


Allowe C, C++, language can also take the test, by
d Java choosing one of C / C++ / Java to write the
Langua code as the focus is on Algorithms & Data
Structures. (Some language-specific
ges learning/refreshing and practice may be
required )

·​ ​The question details the problem, gives


Number One constraints, test inputs, and sample
of outputs
Question
s

Languag Memory Input, Output


Allowed Basic e
Function memory
s, mgmt,
input,
C malloc, scanf, printf
Libraries free
output

C++ new, cin, cout,


delete, scanf, printf
malloc,
free

Java New java.util.Sca


(memory nner,
freeing is System.out.p
automatic rint, println
by
garbage
collector)
·​ ​Other functions, libraries not allowed
·​ ​Test taker needs to write any required
utility functions

·​ ​VS ·​ T
​ o be pre-installed on the Test PC/Laptop
Allowed (C/C+
IDEs +)
·
Eclip
se
(Java
)

·​ ​ “Sample test-cases” are given to test


Criteria Pass all locally
for test-cases
·​ D
​ eveloped program has to:
Passing
Test
·​ ​Pass all “Evaluation test cases” on server
(not shared with test-taker) and generate the
output in specified format
·​ ​Meet efficiency criteria given in question
(max limit on execution time, heap memory, and
stack)

2) Preparation recommended

a) Refresh/Learn data structures & algorithms

i) e.g., Array, Grid, List, Tree, Graph, Map, String, Search, Sort,
Permutations, Combinations, Probability, Traversal, Path finding,
Optimization, Dynamic Programming etc.

ii) Some popular external websites for study/practice: geeksforgeeks,


hackerrank, codeforces, top​coder…. ,...... codechef, spoj, project-euler etc.

IIT B
1 Question , 3 Hours
Travelling Salesman Problem (DP with bitmasking)

IITD

Role: Software Developer(open only for M.Tech) - CGPA Criteria: 6.5


​Was it open for IDD branches?
Software Engineer Research(open for B.Tech as well as M.Tech) - CGPA criteria: 8.5
Date: 18/09/2019
Platform: Their software
Test was of 3 hour. ​Only 10 submission allowed(​compile as many times you want​). 50 test cases to be passed
Problem: (same as last year’s IITK problem)
Constraints:-
1<=N<=50, 1<=M<=50
Note: You can’t use anything else than cin, cout(scanf,printf), new, delete from STL in c++ as
mentioned in the above instructions (you can’t use vector, priority_queue and all)
Solution 1: I used dijkstra kind of shortest path algorithm, looped over to find min at each step(as
you can’t use STL’s priority_queue(heap)), solution’s complexity - O(N^2 * M^2) ​What should we find
in this question ?
NOTE: don’t use pure DFS kind of backtracking method because there was time constraint also. I
used BFS with a matrix which stored minimum jump to a point and it passed all the test cases.
I still did not understand the question. Can someone please explain the question ?
Can somebody explain how this question can be

done using dfs/bfs? + 1


Y2Phq9Y​ (Please let me know if the solution is correct)(In input, denote goal state by G)
Note: Their IDE sucks. Install Visual Studio 2013 Version Only their versions don’t work) for C++ Or
Eclipse IDE for Java.

IITG
same question as IITD. Same rock climbing question.
They even gave solution approach with question, which worked perfectly.
can you please explain what was the solution approach?

NIT Agartala
Q) There is a source (S) and destination (D) and a spacecraft has to go from S to D. There are N
number of wormholes in between
which has following properties:
Each wormhole has an entry and an exit.
Each wormhole is bi-directional i.e. one can enter and exit from any of the ends.
The time to cross the wormhole is given and the spacecraft may or may not use the
wormhole to reach D.
The time taken to travel outside wormhole between two points (x1, y1) and (x2, y2) is
given by a formula |x1 - x2| + |y1 - y2| where, (x1, y1) and (x2, y2) are the coordinates of
two points.
The coordinates of S and D are given and we have to find the minimum time to reach D from S.
Note: It’s not mandatory to consider all the wormholes
Example : source=(0,0), destination(100,100), wormholes=3
coordinates are:
(1,2),(120,120) Cost = 5
(4,5),(120,100) Cost = 21
(6,8),(150,180) Cost = 23
Sample output=48
Explanation:
Cost from (0,0) to (1,2) is 3
Cost of wormhole 1 is 5
Cost from (120,120) to (100,100) is 40

So, total 48 ​Someone please provide the solution with explanation . ​Wormhole Question
asked in SRI Delhi
IITR
CGPA>=8.5 required
https://discuss.codechef.com/t/samsung-question-geeksforgeeks/17092​ Repeated
NOTE: You can’t use stl queue for bfs, have to implement it by yourself.

IITK
CGPA >= 8.5
Same Question which came in IITR just above. Repeated.
All questions asked by any samsung campus are all repeated and from a set of 10-11 fixed
questions(almost all brute force types). See previously asked questions for the last 2 years and
you’ll find them all. All the best !!! ​@Shubham, do you have solution for ​Wormhole Question
which is frequently asked in Samsung ?​ ​https://ide.geeksforgeeks.org/pC9w4ETP2x​ This solution
was posted in last year’s doc( Bruteforce but should work i guess) . ​Thanks @Shubham. Can
we use BFS from every road and find the farthest rare element and update the answer if it is less. Is
there any better solution than this for
https://discuss.codechef.com/t/samsung-question-geeksforgeeks/17092​ (problem form IITR and
IITK).

AppDynamics

IITD
GATE MCQs + Aptitude repeated same as that of 2018 asked in IITD:
https://imgur.com/a/PIXIxR8
What is the answer of grape crushing problem from the above link - 12,.ie, None
I’m getting 18
Code 1: Same as the previous year’s 3rd question on vowels in the link above.
can vowels be done simply by using prefix sums after counting all strings
starting and ending with vowels?
//​YES
Code 2:
https://leetcode.com/discuss/interview-question/363036/twitter-oa-2019-activate-fountain
Code3:
​What is Code 3?
// Does anybody knows how to solve this Q.3?? please provide the solution below, it would
be of great help. ​Which Qn3 are you talking about? Digit Sum question ..Can you plz explain
the question. I’m not able to find it
// Dictionary which keeps a count of all the unique character.

IITK
MCQs: not too hard data structure problems, complexity analysis, probability (basic) and a
few others
Coding: a simple array manipulation question
a very simple class implementation to test OOP concepts and Java language (it was
Java-specific, couldn't use other language)
knapsack problem with a different cover story (buying and selling shares)

IITR
Eligibility:
UG ​JEE 0ALL
PG ​M.Tech​. - CSE, EE, ECE
CGPA Criterion:

UG ​B.Tech. - CSE, EE, ECE ( CGPA>7 ) IMSc. - MSM ( CGPA>7 ) IDD - CSE, EE, ECE ( CGPA>7 ) + Other
Non-Circuital Branches (CGP A>8)

PG ​M.Tech​. - CSE, EE, ECE ( CGPA>7 )


MCQs: Total 12 MCQ questions ,some of them were same as asked in IITD, 3 questions from
SQL.
Code1: given height and positions of walls. Mud is filled in the region between two
consecutive walls, such that height of mud is at max 1 greater than its adjacent height (of
wall/mud). Find max height of mud that can be placed
Eg: pos: 1, 6, 10
height: 1, 3, 3.
mud placed: 1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4, 5 -> 4, 6 -> 3, 7 -> 4, 8 -> 5, 9 -> 4, 10 -> 3
Bold ones are walls, normal ones are height of mud at their respective positions
ans = 5;
Code2: array of length n, sliding window of size x, get minimum value in all the windows and
finally return the maximum. x <= n <= 1000000
Code3: Angry animals
IIT KGP
(CGPA Cutoff: For circuital branches (7+), for all other depts (8+)) [12 MCQs + 3 Coding]
Most MCQs same as IIT D (​https://imgur.com/a/PIXIxR8​)
Other MCQs were on B-Trees, simple math problem on simple interest-compound interest
Coding:w
Sliding Window Minimum Maximum (Same as IITR)
Mud Wall Question (Same as IITR)
Almost Sorted Array - find minimum nos. That must be deleted so that array is
almost sorted. (An array is almost sorted if it can be sorted by deleting at most
1 element.) Eg 2,1,5,4,6 So answer is 1. As if we delete 1 or 4 we get almost
sorted array. Can be solved using nlogn version of LIS

Cohesity
Was Cohesity opened for any other branch apart from CSE??
Ans: No, just CSE.

IITD
CPI: 7
Role: Member of technical staff
Two coding questions. Code1 of 50 marks and Code2 of 100.
Code 1: Very similar to minimum window substring
https://leetcode.com/problems/minimum-window-substring/
Here T was “AGCT”
Code 2: Given two equal sized arrays A and B. Also given an array S containing tuples
(index1,index2).
Tuples in S can be used to swap elements of A at indexes index1,index2. Tuples can
be used any number of times.
The task was to find the minimum hamming distance between A and B.
Hamming distance is total number of locations where A[i] != B[i]
Solution:​ Make an undirected graph where edges are pairs (index1, index2). Find
connected components in this. Minimize hamming distance for each connected
component of indexes greedily.
Proof: 1. No pair of elements in separate connected components can be swapped.
2. Every pair of elements in the same connected component can be swapped.
(There exists a sequence.)
​** could you please elaborate more about the solution? I can not understand “Minimize
hamming distance for each connected component of indices greedily​” ​Reply: Lets say one
of the connected component is composed of indices: 0-3-4-8 and the corresponding
elements in A are: 10, 24, 90, 29 and in B are: 10, 10, 24, 90. Now, note that you can obtain
any possible permutation of elements in a connected components, so, find out how many of
B’s elements in this component exist in
A’ component (you can use ‘map’). In this case answer is 3.

IITK
Role : Research Engineer
CTC : 57 Lakhs
CPI : 8.5 (Only 25-30 people were shortlisted for the test. All had CPI above 8.5)
2 Questions : Hackerearth Platform
Duration : 70 mins
Ques 1 (100 Marks):
A 0-1 matrix of width w and height h was given. 0 means black and 1 means white. Picture it like
a bar code. If the whole column is filled with 1 then it’s a white strip on a bar code. if n consecutive
columns are filled with 0, then it will represent a black strip of width n. Now the matrix is not
perfect(some columns are not completely white or completely black ie they have some irregularities).
Cost of switching a single 0 with 1 or vice versa is 1;
You arncoe given x and y where x is the minimum width a strip in the barcode must have and y is the
max width. You have to find the minimum cost required to convert the original imperfect matrix into a
valid barcode matrix satisfying constraints on x and y ie each strip’s width is between [x,y]. Very few
people were able to do this. Brute force backtracking will not work(⅖ test cases passed
though).​(Solution Approach?) ​Constraints?
Ques 2 (70 Marks):
Dependency graph was given. Topological sort order was expected in the output. Only
constraint was that if 2 tasks are independent and can be done at a certain point(ie all dependencies
are satisfied) then the one lexicographically smaller should be done first.

IITR
Role: Research Engineer
CTC: 57 Lakhs
CPI: 8 and above
2 problems: Hackerearth
Duration: 60 mins
Q1: 70 marks

N students are standing in a row. i th student has height H​i ​ A student X can see a student Y in
front of him only if all students between X & Y have height less than Hx. Find the number of possible
pairs (X, Y)
Sol: Can be solved using stack
Q2: 100 marks
A car with fuel C is placed at origin on number line. It cost 1 unit fuel to move 1 unit of
distance.The car has to reach a destination at a distance D from the origin. There are N fuel stations
placed at positions Xi and it costs Ri to use the ith fuel station. At a fuel station the car can either
ignore and continue or replace the original fuel with capacity Ci. Find the minimum cost needed to
reach the destination.
Sol: can be solved with dp and segment tree. Start from end. For every i, if the car replaces the fuel
with capacity Ci, find the maximum fuel station it can reach(using binary search) let it be j. dp[i] = r[i]
+ min(dp[x]) for x in range i+1 to j. This min can be calculated using segment tree and dp[i] is
updated in the tree.

Samsung Research Institute Delhi

IITD
Wormhole Question​ repeated. ​Please post the code for this question. It is
repeated in all colleges. ​Posted previous year’s soln under samsung r&d
bangalore IITK section

IITK
https://www.geeksforgeeks.org/samsung-interview-experience-set-28-campus/
coding question.

IITG
1 coding question, 3hr. Other details already mentioned in doc.
Graph Cycle : ​https://drive..com/file

/d/1ftOziYTPrsIKlQwSdKrZsOuZYITEDXZy/view?usp=sharing
(Same question was asked in SRI Noida also in IITG)

Arista Networks

IIT Jammu

Question 1

CGPA CutOff 8.0, Discipline: Computer Science and Engineering

Question 2
Question 3
Oyo Rooms

IIT Jammu

Question 1medi
Max Rectangle in Binary Matrix:
https://www.ierviewbit.com/problems/max-rectangle-in-binary-matrix/

Media.net

IIT Kanpur
IITG
Added under Directi as both companies are the same.

Directi

IIT Gandhinagar
.
can someone share the solution for the above question (question 1)? ​( Use
binary Search over length of submatrix with prefix sum preprocessing to get
the number of 1’s in a submatrix - Pseudo Code?? )
How to solve question 1??
can somebody put question 2 also? and 3 as well?+1

https://ide.geeksforgeeks.org/WE`XYc1JoZI​ someone please verify the solution

-------------------------------------------------------

please share solution for above question???​(+1)

IITG
3 coding question:
https://drive.google.com/file/d/1po3hPwX0NUm84dIwsAfCn002YImR6nO1/view?usp=sharing
This is the first question. It's also there in above link.

IIIT H
All coding questions were same as above.

Edge Verve

IIT BHU @ 29/09/2019


Hackerrank, STL Allowed, 1 Section, 3 hrs, 3 coding questions. Each question had 15 test cases.
Q1 - Scatter Palindrome : Given a string, find the no. of substrings which can be rearranged into a
palindrome.
Brute Force solution accepted. For all possible substrings, check if odd occurring characters are not
more than one b/w the start and end index.
Solution Approach explained on ​StackOverflow
Q2 - Colouring the Blocks : Given n boxes and the costs for colouring each of them with 3 colours
(say R,G,B) find minimum total cost to colour all boxes such that no two adjacent boxes of same
colour.
DP solution accepted. Populate DP table with minimum possible costs for each choosing a colour till
that index. 2^n (bruteforce) also acceptd

Q3 - Arbitrary Shopping : Find the length of the longest sub-array such that sum of elements does
not exceed ‘k’.
Two Pointer solution accepted. For each index, add the element to your current sum, and decrement
from beginning index ‘l’ so that the sum fits in ‘k’ units of money.
{ O (n) with sliding window approach} , {O(nlogn) with current sum + binary search} : both worked.

Advice​ - Don’t worry about complexity, just solve it by bruteforce.


https://drive.google.com/file/d/18kHmOiJ8HQ8uA7BqQZ3GQ6eVZ4afn2Fm/view
-

Hexagon Capability Centre India

IIT Kanpur ( 30/9/2019) :


Aptitude Test
Total 50 Questions : 50 Min
3 section:
Quantitative Aptitude : 20
Logical Reasoning and data interpretation: 15
Verbal Ability:15
Reference : CAT book + pariksha type question asked
Clumio Technologies India LLP

IIT Kanpur - 3/10/2019


(Member of Technical Staff) (M. Tech allowed)
2 coding questions. Duration: 70 minutes
Platform: Hackerrank
Count all substrings of a string such that the substring contains all the vowels and it
doesn’t contain any character apart from a vowel.
https://www.geeksforgeeks.org/count-substrings-that-contain-all-vowels-set-2/
Given a list of cities along with their x and y coordinates for a grid, for each query city,
find its nearest city such that the city has the same x or y coordinate
One Logical Reasoning section
One Business Analysis Section(Data was given and using it we had to make inferences)
These 3 sections were allotted 60 minutes
One Coding section(60 minutes)

IIT Roorkee - 20/10/2019


2 coding question: Duration 60 mins
Platform: Hackerrank
Given N cars placed at some positions on a number line. Find the minimum length of
shed such that at least K cars are under it. K <= N <= 1e5
Find the maximum size of sub matrix such that all sub matrices of that size have sum
less than a given maxSum. N <= 1550
Sol: Binary Search on the size, N^2logN;

IITG
3 coding question: Duration 1 hr
Mtech open
0
Questions: ​https://drive.google.com/open?id=1Ho-FosWiTivBh2dYzA3V2c4RzDUSiAGq
Deskera
(MTECH CS WAS ALLOWED??) YES

(IIT Kanpur)(03/10/2019)
total of b 18 questions (5 aptitude+5logical+5 technical+3 coding questions) ​ which platform???
hackerrank?? ​platform was techgig
3 coding question based on string
1.​https://www.geeksforgeeks.org/longest-palindrome-substring-set-1/
2.​https://www.geeksforgeeks.org/recursively-remove-adjacent-duplicates-given-string/
//what should be the output of mississipie for 2nd question?(because on gfg its quite unclear) ​mpie
Shouldnt it be mipie??
3.​https://www.geeksforgeeks.org/length-of-the-longest-substring-without-repeating-characters
/

IIT D (19/10/2019)
Same question as above.

Wells Fargo

IIT-Bombay (26th October 2019)


Program Associate Profile: 2 Coding
Travelling is Fun :
https://www.hackerrank.com/contests/hack-it-to-win-it-paypal/challenges/q4-traveling-is-fun/problem
Minimum Loss (It’s variant actually) :
https://www.hackerrank.com/challenges/minimum-loss/problem

IIT-Madras (3rd October 2019)


Program Associate Profile: 10 Questions - 8 Aptitude + 2 Coding
Solution to Angry Animals?
Can someone explain the input format for part 2?
Can SOMEONE PLEASE EXPLAIN HOW TO SOLVE ANGRY ANIMALS?? (+3)
Solution​ Angry Animals
first line is the number of animals. followed by the size of array ‘a’ then accordingly the number
follows. Then these are followed by the size of array ‘b’ then the number follows
Check the link below for input format explanation (Complete question for part 2)
Can someone please elaborate what type of aptitude questions were asked
What were the aptitude questions ??? Anyone? Did aptitude contains verbal ability
questions?+1,+1,+1,+1
What was the test duration?
Someone earlier deleted the screenshot having angry animals questions. Please refrain
yourselves from doing such things.
3
Please put other questions as well

IITG (10th Oct 19) What profile?


This was an aptitude test. (120 minutes) Hosted on amcat (​ what were the level of these
questions ???/types??? )​)
One Verbal reasoning section(Comprehension, sentence correction)
2 Questions from a pool of questions(please add more)
Locate number of substring occurrences in a string( Ex.
Tim​likestoeatfoodand​timl​ ovesgames, Tim) Ans. 2(Exp: occurrences are in bold.
Note - the substring is case insensitive)
Question was reduced to finding length of longest cycle in graph...​Directed or
undirected graph??? and what were constraints?
Given (x,y) coordinates of two circles and their radii, find area of intersection
https://www.geeksforgeeks.org/find-minimum-number-of-merge-operations-to-make-an-array-pa
lindrome/​ ​instead of count, we had to return the palindrome array
Technical test
Total 57 people were shortlisted from the aptitude test.
7 questions - 1 hour test
You have to write answer along with the complete explanation required for that problem.
First two questions were standard puzzles from interview bit.
Then 2 questions where you have to check for cases and solve equations.
1 sequence series problem.
1 problem on verbal reasoning. (It was not like normal easy ones you will find on the
internet.)
Last problem was a linear programming problem.
1st problem -
https://medium.com/i-math/a-king-1000-bottles-of-wine-10-prisoners-and-a-drop-of-poison-2
dd1959a8dd2

IIT ROORKEE
Platform: Amcat (shitty platform)
4 sections
Logical reasoning _
Verbal & comprehension | 60 min.
Business Analysis -
Coding round :- 60 min 2 ques;
:find the value of (S^n%10)^m)%1000000007;
https://www.geeksforgeeks.org/modular-exponentiation-power-in-modular-arith
metic/
2: Implement shortest first job scheduling algo.
3. Same as IIT G Question : Locate number of substring occurrences in a string( Ex.
Tim​likestoeatfoodand​timl​ ovesgames, Tim) Ans. 2(Exp: occurrences are in bold. Note - the
substring is case insensitive) ( ::will upload few screenshots also )
https://www.geeksforgeeks.org/program-for-shortest-job-first-or-sjf-cpu-scheduling-set-1-no
n-preemptive/
4. find the largest square palindromic submatrix of a given mxn matrix. a matrix will be
palindromic if A[i][j] = A[n+1-i][n+1-j], i&j are 1 based index. ​Note: While printing space
seperated elements or ans for test cases in seperate line do not print last space or last
newline. Today, I couldn’t pass both of my qns due to this :(

IIT Kharagpur
Open to all circuit branches and from non circuit only 8.5+ CGPA

BookMyShow

IIT Hyderabad
Zendrive
IITG (SDE PROFILE) (salary 20-27 CPI 6.5)
Test was of 1 hour
3 questions

I don’t have ss if someone has plz add


Q1. You are given N points on a positive number line. You have to put them in different jars. Each jar
can have at most C points and difference b/w any two points in a jar cannot exceed K.
Find minimum number of jars required. (20 MARKS)
Approach;
func(int a[],int k,int c){
int n=a.size();
sort(a,a+n);
in i=0;
int start=0;
int c;
while(i<n){
start=i;
c++;
while(i<n && A[i]-A[start]<=K && i-start+1<=C){
i++;
}
}
return c;
}
Q2:(50 MARKS)
You are given an array. You are allowed to square exactly 1 element of array. Find max subarray
sum after you square an element.
Approach :
For every index find max subarray sum with subarray starting at that index. Call this array start
For every index find max subarray sum with subarray ending at that index. Call this array end
Note: if element is negative,set start[i]=0;end[i]=0;
Compute start and end using start[i]=max(0,arr[i]+start[i+1);
end[i]=max(0,arr[i]+end[i-1]);
for(all i){
val=A[i]*A[i];
ans=max(ans, val + start[i+1] + end[i-1]);
}

This approach can be optimized to O(1) space complexity. However the above solution has no issue.
Q3:(30 MARKS)
You are given a 2D grid. each cell contains either a 0 or 1. 0 means the cell is empty 1 means there is
a tower on that cell. Each tower has height 1. Find max water you can store in the grid.
Water can be stored in empty cell if they are surrounded by tower on all sides. IF a empty cell is
connected to edge of grid then water will flow out
Input
0110
1011
1001
1110
Output:
3
Solution :
Simple dfs question.
Move along the edge of the grid. IF there is a 0 apply dfs converting all 0’s seen to 1.
finally count all 0 in the grid.
Can be solved using bfs too. Convert the edge dots to some other symbol,

IITK
1hr. 3 coding ques. Platform- Hackerearth
Q1. There are n butterflies and k colors.You have to color the butterflies, but you cant color two
adjacent butterflies with the same color. There is also a special color(it could be one of the k colors
or a different color). There is no coloring restriction while using the special color. You have to output
the number of ways mod(1e9+7) of coloring the n butterflies….​solution anyone?
Q2. You have an array of size n. The elements of array look like {0,k,2*k,4*k,8*k…} There are Q
queries. In each query you will be given a number S. For each query you have to output the largest
P<=S such that P is obtained from sum of some of the elements of the array(not necessarily
contiguous and each element of the array can be used only once to determine the sum)
Q3.You are given an infinite 2D grid. There are two points on this grid source and dest. From each
point in the grid, you can move to any of the 4 adjacent points at a cost of 1 point. There are also N
tunnels. The information of start and endpoints of tunnels is given to you. Moving through the tunnel
costs you k points(fixed for every tunnel). Output the minimum cost for going from source to
dest….​solution anyone?

IITD
https://imgur.com/a/ZcPuA5P

CITRIX

IIT Guwahati
2 hours test
40 MCQS , 2 coding
MCQs consists of Aptitude,OS,Networks,C++, OOPS
MCQ Questions : ​https://imgur.com/a/4W8vTeQ
Coding1:
https://www.geeksforgeeks.org/sliding-window-maximum-maximum-of-all-subarrays-of-size-k/
Coding 2:​https://leetcode.com/problems/special-binary-string/

IIT BHU
HackerRank | STL Allowed | 2 Sections | Total 120m | Section Inter-switching Allowed | All Students
Same Questions
Same Format as IIT-G | Around 5 MCQs repeated from IIT-G
Section A : Coding
Q1 - Scatter Palindrome : Given a vector of strings, for each string, find the no. of substrings in it
which can be rearranged into a palindrome.
> O(26*n*n*(number of strings in input)) solution accepted for most students.
> Same question appeared in Edgeverve, IIT BHU - Only difference being in Citrix there could be as
much as a 100 strings in input.
> Note: map and unordered_map were giving TLE in some cases. Use array to pass all test cases.
> [Weird time limits] 100 queries*1000 word length [100*1000*1000=10^8]
> ​Solution Approach​ explained on ​StackOverflow
Q2 - Triple Dijkstra : Calculate minimum distance to be travelled for going from place 1 (first index) to
x, then x to y, then y to n (last index).
> Given an undirected graph, and its edges (with weights). A child has to run some errands at two
nodes X and Y (in that order), and then reach school. Nodes are numbered from 1 to N. Find the
shortest path such that child reaches X, then Y, and finally School. Always starts from node 1, and
school is always at node N. X and Y will be greater than 1 and less than N and will be given as
parameters. Any node can be visited any number of times.
(Constraint - 10^5)
> Write Djikstra function - d(source_node, dest_node) and call it three times.
> The answer will be d(1, X) + d(X, Y) + d(Y, N)
> Remove all debug codes present or you might get TLE
Section B : MCQs
> 40 MCQs
> Around 20 on C++ and C Program Output, OOPS, Syntax [Level: Hard]
> Around 5 on Operating Systems (Process Scheduling and Memory Management mainly) [Level:
Easy/Medium]
> Around 5 on Networking (IP Addressing & Subnets and OSI/TCP Facts mainly) Ex, Given an IP find
no. of total subnets. [Level: Easy]
> Around 10 on Aptitude (Mixtures, Probability, Reasoning) Ex, Probability of getting a sum of 18 in
4-dice simultaneous throw? Ans. 5/81 [Level: Easy]
> ​VERY IMPORTANT :​ Section inter-switching was Allowed [at least in IIT BHU], but copying code
from C++ MCQs was restricted by HackerRank. So you should write the code of C++ MCQs using
pen-paper, then debug the same in compiler of Section A and get the output!

IIT R
Section B:
> 40 MCQs
> similar pattern as above; 3-4 questions were same from IITG
Section A:
Q1: Pappu wants to buy fiction books. He has n comic books and m coins. He can trade 1 comic
book and x coins for 1 fiction book i.e. 1 comic book + x coins = 1 fiction book. You will get y coins if
you sell 1 comic book. So, given n,m,x,y determine the maximum amount of fiction books pappu can
buy. ​I did this Qn using binary search, some did by making direct formula and some did by
bruteforce in O(n) Limits were 10^9
Q2: You have n computers and you want to form k groups such that the all previous groups formed
have less computers. You’ve to determine the number of ways we can form groups. for eg. n=5,k=3
you can form grps in 2 ways {1,1,3} and {1,2,2}. ​This could be done by dp[i][j][prev] i.e dividing i
computers in j grps where previous group has prev computers.

Sharechat
IIT Kanpur
Did they allow C++ ? And the profile they offered was data scientist? ​Yes, C++ was allowed. The
profile was Software Development Engineer.
1 hour, 3 coding questions:
Q1: Given a string S composed of lowercase letters, you are allowed to reverse any substring of S at
most once. Find out how many different strings can you generate. Eg. For 'aatt' : one can make 'atat'
(reversing S[1]..S[2]), 'ttaa' (reversing whole string), etc.
Q2: Given a string of lowercase letters, output the compressed form of the string. Compressed form
of a string 'aaabccdde' is : a3bc2d2e.
Q3: Given a string S of lowercase letters, find out the size of smallest possible substring of S which
contains all the distinct letters of S at least once.

Walmart Labs

IIT Guwahati
CPI cut-off 6.5 Open for all branches
Was this open to all branches or just circuit branches? ​Ans. ​All B.Tech, All M.Tech, All M.Sc, MSR
with C.P.I. 6.5 and above
Were there MCQs from OS, DBMS, Networks as well?​ ​Ans. No, only the topics mentioned down here.

​ ttps://imgur.com/a/Z7h58m0
Link to Questions:​ h

There were 23 MCQ questions and no coding questions to be done in one hour. Questions were
based on
Unix commands like cal, command to sort files in decreasing order, etc,
Unix VI editor modes
Cloud computing questions (based on Amazon cloud (Question-Name ​architecture in
which a single instance of a software application serves multiple customers? Ans.
Multi-Tenancy))-
OOPS questions based on Java(Derived Class,Integer Class,valueOf function), C++,
ASP. (Basic)
Logical Reasoning Questions & basic maths questions (For example: on the interest
rate).
Different pseudocodes were given and were asked to tell the algorithm name. (Codes
were of Bellman-Ford, Floyd Warshall, Bubble Sort, and Knapsack).

IIT Dhanbad
https://www.geeksforgeeks.org/length-smallest-sub-string-consisting-maximum-distinc
t-characters/
The Test was conducted on 14/10/2019. It was an hour-long test which consisted of 10
MCQs and 1 coding question. The MCQs were based on general aptitude, OOPs, one
question from cloud computing and one question from networks. Make sure you
practice a few questions of masking an IP address.
The coding question was:
https://www.geeksforgeeks.org/length-smallest-sub-string-consisting-maximum-distinc
t-characters/

IIT BHU
Same format as ISM
MCQs - Kubernetes (1 qstn), Cloud computing (2-3 qstn), Simple and compound
interest, Android dev (1 question), Spring Security framework (1 qstn), etc.
Coding question​ - Given a binary string find the length of maximum subsequence (NOT
substring) which matches the regex 0*1*0*1*
Eg input - 0101000, output - 6 (011000)
Eg input - 0101 output - 4 (0101)
Constraint - Length of string = N < 10^5
For test case 1, Where is 1 in the output ? Shouldn’t the output be 01010 because 01000 does
not match the regex 0*1*0*1* ​* can be an empty sequence. Both subsequences are correct and
will result in 5 length.
Why the answer is not 6 for first test case? 011000?? index 0,1,3,4,5,6??
Can someone verify the answer please for above test case.
Yes it should be 6, not 5. I made those examples myself and didn’t pay much attention. The
answer should be 6.
Correct me If I am wrong, is this question same as Longest Common subsequence Problem ?
IDK how it could be related to LCS (not sure), here solution will form a 4*N DP table and the
complexity of DP solution will be O(n). We need to maintain 4 states here.
So, the second string for LCS would be 0101, (I mean just remove *s in second string and
apply the LCS pattern ? @Rahul Kumar please confirm ​See my above comment. Idk if your
logic of relating it to LCS is correct or not :/
What does regex 0*1*0*1* mean ?​Regular Expression (google it)
In 011000, 0 should precede 1 second time according to 0*1*0*1 which is not happening. I am
missing something ? Can you explain how 011000 is the answer​011000 can be formed with
the regex 0*1*0*1* by omitting the last 1. I think you missed the last star after 1.

IIT Kanpur
Profile: Data Scientist
M. Tech Allowed
Time: 1 hour

10 MCQ based on verbal ability and probability


1 program

There is an infinite array. A[0]=0, A[i]=A[i-1] xor i


There are a number of queries having L, R
For each query, find the XOR of the elements between L and R(inclusive)

Constraints: 1 <= L,R <=10^15


1 <= Q <= 10^5

AQR Capital Management

IITG
There were 2 coding questions, which had to be solved in 75 minutes. (Level - Easy/Medium)
1st Question - Given list of edges in a graph, you have to keep on storing the maximum size of all the
connected components in the graph. So, suppose there are 4 nodes. And edges are [[1,2],[3,4],[2,3]].
You have to return :- 2 2 4. (​Can someone explain how did this come as a output​)(Explanation: On the first
iteration, graph has one edge i.e. 1-2 and so the output is 2. On the second iteration, graph has 2
edges 1-2 and 3-4 (But they are disconnected!), so the largest length of connected component still
remains 2 so output is again 2. On the third iteration, graph has 3 edges and becomes 1-2-3-4, so the
largest length of connected component becomes 4 now, so output is 4. Hope it helps) ​Was it a
Directed Graph or undirected???​Undirected
Solution - Union Find with path compression and a size array will work fine.
Constraints were pretty loose, so I think brute force DFS should even work. ​I used DFS, it passed all
test cases.
2nd question - Given a list of points which basically represent polygons, you have to return all those
polygons which are mirror images of each other. Both X-axis and Y-axis act as mirrors.
Solution - Did this using brute force. You have to store the points in a 2D Vector. Then sort all those
vectors (A custom compare function needs to be written here), and then keep on comparing.
9/12 test cases passed. I might have missed some corner cases, it was not TLE for sure.
(Please upload any better solution).
Alternate: I created a function for checking if two polygons are mirror image of each other(having
two parameters which are the coordinates of the two polygons). After comparing the size of the
vectors, push points of a polygon with y-coordinate negated(doing it for checking mirror image w.r.t
x-axis, same can be done for y-axis). Then check whether all points of the other polygon are present
in the set and it passed all the cases.
WHAT IS the MAXIMUM LENGTH OF LIST??? ​--- 500 points
Test Platform?? Ans. HirePro: ​https://www.hirepro.in/

IITH
Q1. Rock Paper Scissor Game///​cud u give some link for this?
It’s a usual game. Here the player’s move [rock, paper or scissors is given as input in a string]. have
to compute the number of matches totally played to come to a winner. and the players in Quarters,
Semi and Winner.
Example 2 players.
input:
2
R RPS
S SPR
-------------
finals: 1,2
winner: 1
-------------

output:
1,2
1
Q2. Given position of knight and queen, find min num of cells travelled to reach queen from
knight.///​were we allowed to move the queen?
NO, you can’t move the Queen. NOTE: Here cells travelled is not same as moves made. Consider as
no. of cells for a knight to move from position (x,y) to (p,q)
Motorq
Can someone share the solution or approach for
question 2 substring and distinct characters
above?
Any pseudo code??
https://ideone.com/RPufgK
basically in above code I calculated for len = 1 to 26 distinct characters number of substrings
possible, and to calculate the number of substrings in O(n) I used the approach mentioned in this
link solution ​leetcode​, so overall complexity is O(n).

Cogoport
CPI cutoff: 7.5
Which branches it was open for?

IITK
M. Tech. allowed (Software Development Engineer)
There were different sets of questions for different students. Please add more questions.
The test consisted of 3 sections
Behavioral: This test was without any time limit. In the first page, we had to select
those behaviour which people expect from us. Eg cleanliness, punctuality. In the next
page, we had to select those behaviour which defines us. We cannot go to the first
page while answering the second page.
Logical reasoning and aptitude: ​Duration: 12min.​ This test consisted of 50 questions of
logical reasoning, patterns, aptitude. We had to answer quickly within 12 minutes and
there were only a few questions from quantitative aptitude so it was better to leave
them.
Programming: Duration: 2 hours. Platform: Hackerearth.
Question 1:​ Given an array of size N and Q queries, where each query consists
of two integers L and R, representing left and right indices in the array, tell
whether all the integers present within these two ranges are present even
number of times or not. Brute force will not work here
For each prefix if we store XOR , then by checking if prefix XOR is 0 or not gives the
answer. But what if array contain 0??​.
Hi there, for the case of zero you can make a similar prefix array of number of zeroes
then counting the number of zeroes in a range is trivial.
-> The solution with xor is incorrect as it is possible for 3 numbers to have xor = 0 e.g.
1^2^3 = 0. ​no xor wil work
Will segment tree work?? This can be solved by MO's algorithm
I DON’T THINK YOU NEED TO IMPLEMENT MO’S algo ..…….PREFIX METHOD IS
SUFFICIENT TO PASS THE TEST CASES.
https://www.geeksforgeeks.org/queries-to-check-whether-all-the-elements-in-the-given-
index-range-occur-even-number-of-times/
The above link has the same error - 1^2^3 = 0. How will you take care of this?
Can anyone who solved all test cases confirm if XOR solution was working??

Question 2: ​Given an array of size N and Q queries, where each query consists
of three integers L and R and K, return the K-step sum within the range L and R.
For example for the array [1, 2, 3, 4, 5, 6, 7], if a query is L=2, R=6 and K=2, then
the numbers 1, 3, 5, 7 are a part of the 2 step sequence and among these, only 3
and 5 lie within the range(array indexing starting from 1). So the required sum =
8.
SOL: MAKE A MATRIX(N*N) WITH A PREFIX SUM OF CORRESPONDING ROW WITH K
JUMPS. SO FOR A GIVEN QUERY “K” = THAT WILL BE YOUR ROW AND JUST TAKE
(prefix[k][R] - prefix[k][L-1]).
E.G. K=2 prefix[2] = 1 1 4 4 9 9 16 || ANS = (9-1) = 8
IITH - ALL THE BEST
​Please provide constraints for n,q and k for both problems??+1
---------------------------------------------------------------------------------------------------------------------------------
IITM
Different people had different questions. I wanted to share a question that i got in programming test.
Another question i didn't give a try.
Question: Given a string S, find the longest palindromic prefix substring. 1<= len(S) <=100000
Input1: ababa
Output 1: 1 1 3 3 5
Explanation 1:
prefix = a || max palindrome length=1 || palindromic string=a
prefix = ab || max palindrome length=1 || palindromic string=a or b
prefix = aba || max palindrome length=3 || palindromic string=aba
prefix = abab || max palindrome length=3 || palindromic string=aba
prefix = ababa || max palindrome length=5 || palindromic string=ababa
Input2: aaba
Output2: 1 2 2 3
Explanation2:
prefix = a || max palindrome length=1 || palindromic string=a
prefix = aa || max palindrome length=2 || palindromic string=aa
prefix = aab || max palindrome length=2 || palindromic string=aa
prefix = aaba || max palindrome length=3 || palindromic string=aba
Brute force O(N^3) will fail !!!
O(N^3) Solution​:
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
int pal(string s){
string t=s;reverse(t.begin(),t.end());
if(s==t) return 1;
return 0;
}
int main() {
//code
string s="asabbasarr";
map<int,int> m;
vector<int> res(s.length(),0);
for(int i=0;i<s.length()-1;i++){
string temp="";temp+=s[i];
for (int j=i+1;j<s.length();j++){
temp+=s[j];
if(pal(temp)) {
if(m.find(j)!=m.end()){ if(temp.length()>m[j]) m[j]=temp.length();}
else m[j]=temp.length();
}
}
}
int mx=1;
for(int i=0;i<s.length();i++){
if(m.find(i) !=m.end() && m[i]>mx) res[i]=m[i];
else res[i]=mx;
if(mx<res[i])mx=res[i];
}
for(auto it:res) cout<<it<<" ";cout<<endl;
return 0;
}
Output:​1 1 3 3 3 4
6888
Linear Solution: ​https://www.akalin.com/longest-palindrome-linear-time
All the best !!!
-----------------------------------------------------------------------------------------------------------------------------------

IITH

(cg 7.5 , allowed all branches)


Test was conducted on hackerearth. Everyone got different set of questions
Given an array A(A[i]<10^9) of size N(<10^5) and Q range queries(<10^5).
x L R (array values are to be manipulated based on x and within range L and R).
can you specify the manipulation
Given integer array of length N, which contains values between 1 to M, and Q range
queries.
for each query [L,R], output element which occurs more than (R-L+1)/2 times in range
A[L...R] if such element exist.
1 <= N <= 3*10^5
1 <= M <= 10^5
1 <= Q <= 10^5
Given an array of N integers, you choose elements one by one from array (choose in
any order, each elem can be chosen at max once)
You need to achieve target T.

Constrain: After selecting some numbers suppose you have currently value P, and
next chosen element is X.
new Value will be P - floor(P/100) + X

Find minimum steps, required to achieve target T.


1 <= N <= 10^5
1 <= T <= 10^5
------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------

IIT R
Test was conducted on hackerearth. Everyone got different set of questions
Do we have to use Segment Tree for Prime Coins questions. I got this question in an Internship exam
and using the Sieve of Eratosthenes gave me TLE. So, please confirm.
Yes Sieve + Segment Tree is the probable solution.
Solution for question 1 ​code​. It took 999951479.5799993 s on my dicky machine for the test case
N=100 and k=100. If someone has a more optimized solution please keep your approach limited to
you​.

NetApp
IIT Guwahati
3 coding question in 45 min.(M.Tech CSE,EE,ECE ONLY)
30 MCQs in 30 min.
Coding:
Given a number represented in binary as a string( length <=100). Return 1 if divisible by
6 else return 0.
Given infinite coins, and 3 pockets, we have to put the coins in 3 pockets, such that the
sum of all coins is in the range [X,Y] inclusive. Find number of ways to put the coins.
Input will be range X,Y
Input: [4,5] [X=4, Y=5]
Output: 9 (3+6)
total coins = 4. Number of ways = 3
{1,1,2} {1,2,1} {2,1,1}
total coins = 5. No of ways = 6
{1,1,3} {1,3,1} {3,1,1} {1,2,2} {2,1,2} {2,2,1}
https://www.geeksforgeeks.org/connect-n-ropes-minimum-cost/
MCQ topics: OS, Network, Aptitude, CPP output
//Please add MCQ questions if possible.
For question 1, if the last bit is 0, the number is divisible by 2, if the number of non-zero bits in even
positions - number of bits in odd positions is a multiple of 3, the number is a multiple of 3. Refer
here:
https://web.archive.org/web/20171029092543/http://www.answermysearches.com/how-to-tell-if-a-bina
ry-number-is-divisible-by-three/70/
If the above two conditions are satisfied, the number is divisible by 6.
Solution for 2nd Question:- (Please correct if wrong)​(what’s the approach of choosing p and temp?, I
hope it’s clear now)
int main()
{
int x,y;
cin>>x>>y;
long ans=0;
for(int i=x;i<=y;i++)
{
int p=i-1;
ans += p*(p-1)/2;
// cout<<temp<< " ";
ans+=temp;
}
cout<<ans<<endl;
return 0;
}

// I think we have to sum up nC2 for all n from X-1 to Y-1 (Stars and Bars approach). If we solve this,
for every n, we need to add to our ans n*(n-1)/2. //I have updated above. Now, it should be easily
understandable.

SAP LABS

IITD
https://imgur.com/a/oT654TX

IITB

2 Questions 60 minutes , Different Sets


Few questions repeated from above
1) Weighted Job Scheduling
2) N Children with hi heights 1<=i<=n are given , a region of a student is
defined as maximum length of contiguous array including student himself
in which his height is maximum among all. Find sum of region of all
students (O(n) solution was required , use deque)

Sprinklr

IITG
3 coding questions, 90 minutes
Total marks: 325(150 + 75 + 100)

Q2.[75 pts]

65 points were being given for the brute force. Could be done easily using stack.
Q 3.[100 pts]
Hi
Approach: Only remove bars from the end points. Create another array for storing the differences
between consecutive
elements(will be of size n-1). Now the p
(Use deque with window size of n-k
i.e the number of bars to keep)
Q1.[150 pts] Question boiled down to that a graph is given, where value at each node is number of
nodes that are reachable from it. We have to remove exactly 3 edges such that total sum of values of
all nodes is maximized. Print the maximum score possible.
Are we given an array denoting the number of nodes reachable from that node? That’s it? edges
were not given?
We were given graph in form of edges as pair of vertices.
Constraints n<=100000; no. of vertices
m<=100000; no. of edges
Was graph directed or undirected ?
Directed or else all the nodes will be reachable from every other node.
Can anyone plz share the approach?? Not getting any idea+1
Was it mentioned that the graph doesn’t contain any loops or cycles?
Was anyone able to solve it?
was O(n square) time complexity working?
The graph must be undirected or the problem is unsolvable. Verified from icpc world finalists. (??)
How to solve even it it undirected?
Can be solved using dfs in O(n)
IITM
Same as IITG

IITB
Same as IITG

IITD
12th october
https://owncloud.iitd.ac.in/nextcloud/index.php/s/sN36Q9k5iEEEEA2
IIT D the rar file is corrupt
Code for bar graph question:
https://gist.github.com/chrchllkhangar1/20b8247e7af116de66f546487982a42
3 coding questions, 90 minutes
2 questions “string game” and “bar graph” exactly same as from IITG (refer main doc)
3rd question:

5​
Q3(150 marks)- You are given an array (length <= 10​ ) of 0's and 1’s. Is it possible to split array into
3 parts such that decimal value of all 3 parts is same? If possible, return the decimal value else
return -1.
Solution​ - Count number of 1s. If 0, return 0. If not divisible by 3, return -1. Else divide by 3 and find
the value: if you iterate from the back of given array, you can figure out the number of trailing zeros
in the last split, say tz. Now you know the required number of 1s in each split and the number of
trailing zeros as soon as you hit the last 1 of any split while scanning from left to right. Store the
splits in vectors and remove leading zeros and compare - v1 != v2 or v2 != v3 then return -1. Else you
already have the vector and you can report the desired value.
(please add the code if possible)

IITK
Same as IITRsap labs
IIT Roorkee
Axis Bank

​IITG
CV shortlisting (selected 100 candidates for test)
Aptitude Test - 4 assessment on shl site-
i) Round 1 - Verbal reasoning- English passage and comprehension
based(a statement about passage given and options were true, false or
cannot say)
ii) Round 2 - Figure completion and identification
iii) Round 3 - Data Interpretation (little different and difficult compared to
Pariksha)
iv) Round 4- Psychometric test - simple questions on yourself
What was the profile and CTC offered ? ​12.99 lpa and Manager (BIU)

Juniper

IITK
Time: 2 Hours, Platform: Hackerrank
3 Coding Questions and MCQs (mostly on aptitude and C code output):
Q1 Given an array A consisting of 'n' flask requirements and 'm' type of flasks where each
flask comes with multiple capacities. Eg requirement array A=[2, 3, 6, 8, 10] and 2 flasks: [ [3,
8, 12] , [4, 7] ]. Here 1st flask comes in 3 capacities and 2nd flask comes in 2 capacities. You
can choose only one type of flask to satisfy all the requirements in array A. Eg if you choose
1st flask then you have : '3' capacity flask for requirement 2 and 3, '8' capacity for 6 and 8
and 12 capacity for 10, so net wastage = 3 - 2 + 3 - 3 + 8 - 6 + 8 - 8 + 12 - 10 = 4. You can not
choose flask 2 in this case because it does not have any capacity to satisfy requirement '10'.
Return the type of flask with minimum possible wastage. // ​provide constraints for n and m.
Q2 You are given an array A of size n which can have duplicate elements. You can remove at
max 'm' elements from this array and the resulting array should have minimum possible
distinct elements. Eg A = [1 2 1 1 2 3] and m=2 so one can remove '2' and '3' and resulting
array will have only 2 ('1' and '2') distinct elements.
Q3 You are given an array A and 'q' queries where each query consist of two integers 'low'
and 'high'. You have to return the number of elements in array A that lie in [low, high] range
for each query.

Publicis Sapient

IITH (SDE)
Time : 1hr 15 min Platform : Hacker rank
Total number of questions: 2 coding
Q1. Given string s, positive integer k, and a string char_value which is of length 26 and denotes
whether the letter is special or not. special -> ‘1’
normal -> ‘0’. Find the maximum length of the substring which has at most k normal characters.
example of char_value 101011111111111111111111111 This denotes b and d are normal characters
as 0 is in 2nd and 4th position.
Similar to: (​https://www.geeksforgeeks.org/largest-substring-with-same-characters/​) {IITH people,
please verify!} ​can be done by sliding window?
Q2. Given integer array. Return the array in highest, smallest, second highest, second smallest, third
highest, third smallest…… order.
Array contains both positive as well as negative numbers.
( ​https://practice.geeksforgeeks.org/problems/-rearrange-array-alternately/0/​ )

IITK (SDE)
Platform : Hacker rank
(languages allowed : c,c++,python and others )
Q1. Sort array on the basis of number of 1’s in its binary representation.
[1,2,3,4] -> [1,2,4,3]
Q2. Given 2 strings ‘s’ and ‘t’, check if ‘t’ divides ‘s’ : “abxabx” divides “abxabxabxabx”, but
doesn’t divides “abxabxabx”
if it divides, return length of smallest substring that divides both ‘s’ and ‘t’ , len(abx)=3 in this
case

IITG (SDE)
Given a vector of strings operation ides and vector of int x, return a vector of int such
that it consists product of max element and min element after performing each
operation. operations vector consists of string ‘push’ and ‘pop’. ​Can you provide an
example test case??

https://leetcode.com/problems/beautiful-arrangement/

https://drive.google.com/file/d/1FWpV221DyiLB9YjRl5e192hmjfNCefAD/view​ (ML)
IITR (ASDE-II)
Platform : Hackerrank
Time : 75 min
Questions : 2 Coding

Same as EdgeVerve Question 3 Arbitrary Shopping asked in IIT BHU


Easy Two pointer question. Given scores of two teams in a football match, you had to
find the count of matches where Team A scored less than or equal to every match of
Team B. Return the array.
For Ex -
Team A = [ 2,3 ]
Team B = [ 1, 2, 3]
Return [ 0, 1, 2 ]

IITD (SDE)
https://www.geeksforgeeks.org/maximum-size-sub-matrix-with-all-1s-in-a-binary-matrix
/
Zauba

IITG
Pen paper test;
Write system design of any of the one below systems: (​what feature requirements were needed for
system design ?​)
Uber
Google Drive/ Dropbox
PUBG
Facebook
Air Bnb
Google Adsense
Google Maps
Kafka
IITM
same as in IITG

IIT BHU
same as in IITG + Swiggy/Competitive Coding Platform/Netflix/Github etc

IIT R
Same as in IITG + gmail/message queue

ExaWizards

IITK(which profile?)
Time: 60min 2 questions
Q2. ​https://leetcode.com/problems/word-search-ii/
There was a small modification in the test, you can move diagonally also.
Q1. Floyd warshall's
algorithm(​https://www.techiedelight.com/pairs-shortest-paths-floyd-warshall-algorith
m/​)
Given a list of airline tickets, each with a departure city, destination city, and price,
find the minimum cost of traveling from a city to another, using at most K tickets.
Your algorithm must be efficient.
The input is given via standard input.
The 1st line is the departure city.
The 2nd line is the destination city.
The 3rd line is the maximum number of tickets used for the flight, K.
The 4th line is the number of airline tickets given, N.
The 5th to 4+Nth lines give each ticket's departure city, destination city, and price
(comma-separated).
The output shall be given in 2 lines. The 1st line is the cost of the entire flight. The 2nd
line is a comma-separated list of the cities, in order, in the path of the flight. If the
flight is impossible, output "ERROR" instead.
Example Input :
Munich
Rome
2
4
Madrid,Rome,300
Rome,Munich,150
Munich,Madrid,200
Munich,Rome,600
Expected Output
500 Munich,Madrid,Rome
Solution: It can also be done using the bellman ford algorithm. Just replace V-1 by K
in standard bellman ford algorithm

IITH
Exactly the same questions of IITK. 75min. STL and numpy allowed. M.Tech allowed.

IITD
Exactly same as above.

IITR
Same as IITK.
HSBC

IITG
Platform : Cocubes, Eligible branches: All
2 questions, 30 mins test, STL not allowed (​STL was working in my case…​)
Questions are easy and basic like-
1.find the number of superior element(element bigger than all right of it ) in an array.
input =1,5,7,9,2 output= 2 (i.e 9,2)
2.

2D Array Sort
Given 2 numbers (num, m); find the number closest to num divisible by m; if there are
two such numbers, return the largest one.
e.g (67,8) -> 64 (two nearest numbers divisible by 8 : 64,72)
Factorial of a large number, return as a string
find the sum of even and odd position digits of a number and return odd sum when an
even number comes in a dice and even sum when
you get odd number in dice.

IITH
Same as IITG,STL not allowed.

Samsung Semiconductor

IITD
Someone had deleted questions. Please avoid such foolish behaviour​.

Mr. Kim has to deliver refrigerators to N customers. From the office, he is going to visit all the
customers and then return to his home. Each location of the office, his home, and the customers is
given in the form of integer coordinates (x,y) (0≤x≤100, 0≤y≤100) . The distance between two arbitrary
locations (x1, y1) and (x2, y2) is computed by |x1-x2| + |y1-y2|, where |x| denotes the absolute value
of x; for instance, |3|=|-3|=3. The locations of the office, his home, and the customers are all distinct.
You should plan an optimal way to visit all the N customers and return to his home among all the
possibilities.

You are given the locations of the office, Mr. Kim’s home, and the customers; the number of the
customers is in the range of 5 to 10. Write a program that, starting at the office, finds a (the) shortest
path visiting all the customers and returning to his home. Your program only have to report the
distance of a (the) shortest path.

Constraints
5≤N≤10. Each location (x,y) is in a bounded grid, 0≤x≤100, 0≤y≤100, and x, y are integers.
Input:​
You are given 10 test cases. Each test case consists of two lines; the first line has N, the number of the
customers, and the following line enumerates the locations of the office, Mr. Kim’s home, and the customers in
sequence. Each location consists of the coordinates (x,y), which is represented by ‘x y’.
Output:​
Output the 10 answers in 10 lines. Each line outputs the distance of a (the) shortest path. Each line looks like
‘#x answer’ where x is the index of a test case. ‘#x’ and ‘answer’ are separated by a space.
I/O Example :::: Input (20 lines in total. In the first test case, the locations of the office and the home are (0, 0)
and (100, 100) respectively, and the locations of the custom memory​ allocation on heap.
ers are (70, 40), (30, 10), (10, 5), (90, 70), (50, 20).)
5 Starting test case #1
0 0 100 100 70 40 30 10 10 5 90 70 50 20
6 Starting test case #2
88 81 85 80 19 22 31 15 27 29 30 10 20 26 5 14
10 Starting test case #3
39 9 97 61 35 93 62 64 96 39 36 36 9 59 59 96 61 7 64 43 43 58 1 36l
Output (10 lines in total)
#1 200
#2 304
#3 366

IITK
One coding question. Time given: 3hrs. Maximum Submissions allowed: 5.
Que: Given an undirected connected graph. Color the vertices of the graph with two colors, such that
adjacent vertices have different colors. Return the
number of vertices colored with 0. If coloring is not possible, return -1.
Solution: Color the first vertex with 0. Now perform BFS traversal on the graph starting from first
vertex. Color the adjacent vertices with different color,
If the vertex is already visited, check if it has a different color.
Note: Stack memory was very less, so do all
[ 1. May be Time complexity was not an issue, I implemented it in an awful way, still passed all 10 test
cases.
2. While coding in the environment, you can use notepad to keep temporary backup of your code.]

STANDARD CHARTERED

IITR
Include 5 rounds:-
Link provided by them for practice ​https://www.trytalentq.com/​ . Test includes same
pattern.
Strength Test which is not an elimination round
Logical Reasoning test which is an elimination round. 12 question of logical
apti. to fill pattern in matrix. CUTOFF : 40 percentile
Numerical round :- includes verbal and data interpretation (elimination round)
(can attempt only those who cleared logical round).
Coding round (in future).
3 sections :
(1st : 15 MCQ Questions where code was given and have to predict the
outcome,,15 ques in 20 mins - speed needed
2nd: 1 SQL query question, lots of table given and have to write a query, 15
mins
3rd : Coding round: 1 easy question link :
https://www.geeksforgeeks.org/remove-characters-from-the-first-string-which-a
re-present-in-the-second-string/​ )
GD and then PI (in future).

Adding few screenshots of the questions asked !


IIT BHU
Same pattern as IITR
Looks like the pattern (type of pattern) for everyone was same but the
boxes values and question mark was different.
Logical Round - ​https://photos.app.goo.gl/h1LJX2anH9vWCh2t8
Numerical Round - ​https://photos.app.goo.gl/RZU9htLPnx3Rrs4J7
Advice​ - There’s no webcam or any monitoring going on, so give your tests in groups
preferably one after another to increase chances of same questions. There are some
different sets of data values but overall the questions remain similar and multiple
people will easily get the same set, just look out which ppl among the group get the
same question set

Advice2​ - Judging by the percentile score we received in email, there was heavy
negative marking although not mentioned anywhere. So play safe, as these are just
elimination rounds, just do 5-6 questions correctly to stay above 50 percentile instead
of marking random answers.

the percentile distribution was like this - (7-8 randomly chosen = 20 percentile), (5
correct, 1-2 random = 60+ percentile), (9 correct, 3 skipped, i.e, no negative = 85
percentile)

Eligibility ??
Silverleaf Capital Services PVT LTD

(High-Frequency Trading Analyst)

IITK, IITD
(M. Tech Allowed)
Pen and Paper based Test. 2 hours(was extended by 30 minutes)
Please someone update the CPI criteria​ 7(IITD)
Although Minimum CGPA criteria in JNF was mentioned 7 but upon resume shortlist they
considered 8 or above.
(I don’t know for sure whether above criteria (resume shortlisting on 8 or above) was valid
for btech or not? (​IITD​))

The test consisted of 7 questions, where some questions had different parts. The test was
mainly based on probability and statistics. There were marks for writing the approach as
well. 2 marks were allotted for free if we wrote ‘Don’t consider this answer’ beside a question
:D
A game in which there is a probability of .9 for neither winning nor losing, a
probability of .09 for winning 10 dollars and a probability of .01 for winning 50
dollars. An individual pays 50 dollars at the beginning of the game and keeps
on playing until he loses all his money. Find the probability that he can play at
least 13 games.
Monty Hall Problem. Extension to Monty Hall problem- Suppose there is a
probability of p1, p2 and p3 to have a car in door 1, 2 or 3 respectively. We
choose door 1. The host opens door 3 and asks us if we would like to switch to
door 2. In which condition will it be better to switch to door 2?
There are N ropes kept in a box. Everytime, 2 free ends of any rope(s) are
picked and tied until there are no free ends left. Find the expected number of
loops.
​Solution on brainstellar
If the maximum number of an array is found by storing the current max value of
in a variable, while scanning the array from left to right, find the expected
number of updates in the variable assuming that all elements of the array are
distinct.
There are n buildings placed on integral positions on an integer line. m towers
have to be placed on that integer line at integral positions. Write a pseudocode
to find the minimum sum of distances from each building with its nearest tower.
Team A and B have a game of 7 rounds and the team winning the majority of the
matches in the series wins the series. A t-shirt manufacturer manufactures
t-shirts of team A and will have a profit of 80 million dollars if team A wins the
series by selling the t-shirts of team A. If team A loses, then the manufacturer
neither gains nor loses anything.
The manufacturer also bids on the outcome of a series (not on the
individual game). Show that it is possible to bid in a way such that he
takes a minimum amount irrespective of the outcome of the game. How
can this minimum amount be maximized?
The manufacturer bids the same amount separately on individual games.
Show that there is a minimum amount that the manufacturer can always
win. How can this minimum amount be maximized?
The manufacturer is allowed to bid different amounts on different games.
Show that there is a minimum amount that the manufacturer can win.
How can this minimum amount be maximized?
There is a game in which an individual chooses a real number in [1,2] called a
strike ‘k’. The host generates a number X between [1,2]. In order to play this
game, we pay a certain amount of premium at the beginning of the game. if X>k,
we earn X-k, else we don’t earn anything.
We strongly believe that X is a uniform distribution in [1,2]. What is the
maximum premium that we would like to pay?
This time, the settlement value is 1/X instead of X. (I don’t remember this
word and didn’t understand its meaning). This time what is the max
premium that we would like to pay?
The host thinks that it is better to choose our strike from a range of
options. So we get some options like [1, 1.5, 2](I don’t remember the
options). After playing so many games, we strongly believe that the host
thinks that 1/X is a normal distribution between [0.5,1]. We need to
choose a strike. If the host wants, he can deny playing the game after
knowing the strike. What is the max penalty that we can pay. (Please
someone verify part c, I think I am mixing up strike and penalty)

Samsung R&D Noida

IITG

1 coding question, 3hr. Other


details already mentioned in doc.
Graph Cycle :
https://drive.google.com/file/d/1ftOziYTPrsIKlQwSdKrZsOuZYITEDXZy/view?usp=shari
ng
IIT BHU @ 10/10/2019
Samsung Noida (SRIN) conducted the test on SC Software | STL Not Allowed | 1 Section | 180 min | 1
coding question | 50 test cases
Only those who pass all 50 cases pass the test generally.
Q1 - Rock Climbing : Given a map of Rock Climbing for Mr. K, you need to tell the biggest jump (or
difficulty) that he needs to make in his attempt to reach Goal.
Problem Statement : Mr. K wants to climb a rock from a starting point to the destination point. Given
a map of the rock mountain which N = height, M = width. In the map, character '-' is the possible foot
place spot (where he can climb). He can freely move up/down at vertical spots which '-' exists
sequentially. It's impossible to move horizontally in case '-' is not consecutive in the same height
level. The maximum height of moving from the starting point to the destination point is the level of
difficulty of rock climbing . The total distance of movement is not important. There is more than one
path from the starting point to the destination point.
Output: The minimum level of difficulty of all rock climbing paths level.
Hint: Start with difficulty level 0 and then keep increasing it one by one.
Problem Image :

Solution Code : ​Code for Rock Climbing Level-By-Level


Did this code pass all the 50 Test Cases? Shouldn’t the level be initialized to 0 because if S and G are
at the same level, answer should be 0.
Updated to start from zero ✓ Thanks
IITKGP
3 hours. 1 question. Airplane Game collect max coins.
Test cancelled. :P
https://imgur.com/a/i5vVEDn

IITR
Marathon
Mr. Choi has to do a marathon of D distance. He can run at 5 different paces, each pace will have its time
consumed per km and its energy consumption. He can only run till he had energy left. Find the minimum time
required for choi to complete marathon if he has H energy.

INPUT :
Input order :
Total test cases
Total Energy(10) Total Dist(5)
Next 5 lines - input for 5 different paces in min,sec and energy order

eg.
Total_energy Total_distance
Min(pace1) sec(pace1) engery_consumption(pace1)
Min(pace2) sec(pace2) engery_consumption(pace2)
Min(pace3) sec(pace3) engery_consumption(pace3)
Min(pace4) sec(pace4) engery_consumption(pace4)
Min(pace5) sec(pace5) engery_consumption(pace5)

Zomato

IIT G
Platform : Interviewbit, Test Duration : 1 hour, 8MCQs, 3 Coding question

MCQ: Q 4 of ​https://www.geeksforgeeks .org/practice-problems-on-hashing/

5 jobs given, find average delay using P. Shortest processing time scheduling (i don’t
remember P full form)
given a code-- is it runtime polymorphism, compile time polymorphism or both, and is
it abstraction
Coding Questions:
https://www.interviewbit.com/problems/anagrams/
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
Given an array A of length N, A[i] stores price of petrol on ith day. Tank can fill upto B
litre. 1litre petrol is spent in each day’s commute. If a person commutes for N days,
give the minimum amount in which he can manage the N litres of petrol.
Provide constraints for B and N and A[i]

IIT BHU
Zomato conducted test on Interviewbit | STL Allowed | 2 Sections | Total 60m | Section
Inter-switching Allowed | All questions same for All
Section 1 : Objective
8 Multiple Choice Questions : DS, Algo, OOPs, OS, Run-time vs Compile-time Polymorphism,
Constructor & Destructor, Capitalize function in JAVA
Two Integer/Decimal Answer type : Waiting time in SRTF Numerical, Insertion Sequences in Hashing
Numerical ​GFG
Section 2 : Coding
Q1 - Find the lexicographically smallest achievable string, given a string of digits 0 to 9, and two
numbers 'r' and 'a', and you can perform two operations on the string infinite no. of times:
Addition - Change character s[i] to (s[i]+a)%10 for all odd indexes
Rotation - Right rotate the string by r places ​https://ideone.com/vnnrUW​ (Soln)
Solution : Brute-force-based Solution ​Someone Please post the solution link for this question too
Q2. ​From Leetcode​. Find the decoded string given the rule is: k[encoded_string], where the
encoded_string inside the square brackets is being repeated exactly k times. Note that k is
guaranteed to be a positive integer.
s = "3[a]2[bc]", return "aaabcbc"
s = "3[a2[c]]", return "accaccacc"
s = "2[abc]3[cd]ef", return "abcabccdcdcdef"
Solution : Stack-based Solution ​Leetcode
Q3. ​From Leetcode​. Find the h-Index of a scientist given the no. of citations of each of his research
papers. A scientist has h-Index h if h of her N papers have at least h citations each, and the other N −
h papers have no more than h citations each.
Solution : Sorting-based Solution ​Leetcode
How to complete 3 coding questions and 8 MCQs in 1 hour ? Ridiculous
Why the answer for test case [1,2,3,4] is 2 as the problem suggests that there are h papers having at
least h citations each. If 2 is the answer then the number of papers having atleast h citations is 3 how
come WTF?​ ​if you take 3 citations then [2,3,4] set will have 2 as a citation which fails the criteria of
atleast 3,
But how is 2 justified if 2 is the answer then we must have exactly 2 papers with citations
atleast 2.
Ans: If we take 2 as citation then {3,4} satisfy the condition, also (n-h)
which in this case is also 2,so the remaining 2 elements {1,2} satisfy the condition where
maximum h index is 2 which is not more than 2.
If we take 2 as citation then {2,3,4} satisfy the condition right , then the exactly h condition is
not satisfied??

IIT Roorkee
Same as IIT BHU (Exactly Same)
Use this link to look at the questions:​ ​https://imgur.com/gallery/GoDG8L7

Adobe
IITKG
Given an array, Just remove adjacent pairs of duplicate elements and return
number of remaining elements.
Eg. A=[1,1,2,2,3] so answer is 1
If A=[1,1,2,2,1,3] so answer is 2. (3rd one will
if A=[1,2,2,1,3,3] so answer is 0.
Can be easiy solved using Deque,Stack or brute force. Any of these passed all test
cases.
2) Given a string s. Return substring of length 5 which occurs maximum times. If several
of them exists, then you know what to do.
Yes, return the lexicographicaly smallest one. 5<=N<=10^6.
Eg. s= “bbbbbaaaaabbabababa. So answer is “ababa”.
Eg. s=”heisagoodboy” So answer is “agood”.
Everyone got 11/12 cases passed and 1 TLE. (dont know why)
3) Given 2 strings, s1 and s2. Find a string s which is a concatenation of subsequence of
s1 and subsequence of s2 and is longest possible palindrome and return its length.
Eg. s1 = ban, s2=ana. So answer is 5 ( ‘anana’).
Eg. s1 = abc, s2=abc. So answer is 3 (‘aba’)
Soln:- Concat s1 and s2. Let s=s1+s2. t=reverse of s. Apply LCS on s and t, which is the
answer. All test cases passed.

IIT G
Platform: Hackerrank, Test Duration: 1.5 hr, 3 Coding questions
Given an undirected graph with n vertices. Edges were between i and (i+1)%n for 0 <= i
< n. We had to find the optimal maximum distance between any pair of vertices.

Soln: Apply Floyd-Warshall Algorithm and find max distance among all pairs. ​Did Floyd
Warshall Algo pass all the test cases ?
Don’t apply Floyd Warshall It takes N^3 . Can be Done in N^2. ​Did pass all the cases though.
how can we solve it in N^2? please elaborate approach
https://www.interviewbit.com/problems/intersecting-chords-in-a-circle/
Although there was a story involved, it asked to apply shortest path from a given
source s and then shortest path from all nodes to a destination d. Weight was
associated with each edge. We had to find the minimuExplanation 1:
If points are numbered 1 to 2 in clockwise direction, then different ways to draw
chords are:
{(1-2)} only.
So, we return 1.m of max time to reach from source -> any node -> destination.

​Soln: Apply dijsktra from source to all the nodes and then from destination to all the nodes with
edges reversed(which will be equivalent to
finding distance from all nodes to the destination). Answer will be the maximum of (distance
of source to node) + (distance of node to destination)

IITD
Find questions at the link below:
https://owncloud.iitd.ac.in/nextcloud/index.php/s/WfHeLASyEQS9pNG
Error while opening the .rar file
Unzipped file question added as image:
1st question ?
int
dist[V][V], i, j, k;
Was it graph one ? Reply asap - IITR has test today

IITR
https://www.geeksforgeeks.org/0-interview-experience-set-55-campus-full-time-
mts-profile/
all three questions were exactly same
question 3) 12 test cases , with brute force(On^2) 10-11 can be passed, all 12 passed using Z
algorithm(O(n)).can anyone tell how to implement Z algo in this question.
If s2 is aa*b, Use Z algorithm once for aa+$+s1, and once for b+$+s2. Then from z array see
which b’s are occurring after aa just keep adding the count.

IITB
3 Questions were asked
1) There are n garbage bags with weights in range 0<=wi<=3 , wi is float value e.g 1.5, 0.4
types. In one move , a man can carry garbage bags in such a way that at a time he can
carry upto 3 units of total weight. Find minimum number of moves required to clear all
of the bags. Constraints 1<=n<=10^5 (Greedy approach)
2) Roughly question boiled down to finding shortest path between 2 nodes in graph with
edges having same edge (BFS clears all test cases).
3) A string can have only 3 characters viz a,b and c. Find number of strings for a given
length N such that no 2 adjacent characters have same value. Constraint : 1<=n<=10^9
(Use Fast Exponentiation for evaluating 3*2^n-1)

Bizongo

IIT BHU
Which profile ? ​Designation - Software Engineer-I
Platform - AMCAT
Round 1 [60 minutes]​ - 60 MCQ, 20 English + 20 Reasoning/Aptitude + 20 Quant
Round 2 (45 minutes)​ - 2 coding questions. No constraints mentioned, mostly bruteforce was getting
accepted
Everyone got different questions. Some questions which i know are -
Find if two binary trees are identical
Subset sum (return 1 if any subset sums to a given sum, else return 0)
Given a regex type of string with symbols *, +, etc. return whether another string can be
formed/matched with this regex
Given a linked list, reverse left half and right half independently. If odd length, middle
element should remain as it is.
Eg Input = 1 -> 2 -> 3 -> 4 -> 5 -> 6
Output = 3 -> 2 -> 1 -> 6 -> 5 -> 4
Maximum consecutive number of ‘1’ in given binary string.
Knapsack with repetition allowed.

Alphonso

IITG (Technologist Profile)


3 coding and 10 mcq; 1.5 hr for coding and 0.5hr for mcq. total 2hr test.
Coding: ​https://drive.google.com/file/d/15kVIAfOawcKDcXqrd7VWAf9ocfTFHB6B/view?usp=sharing
MCQs: Related to DS, Algo, OS, DBMS
Solution to Building offices?

IITD (Technologist Profile)


3 coding and 10 MCQ. (SQL Query was also asked)
Same questions as IITG
MCQ: ​https://owncloud.iitd.ac.in/nextcloud/index.php/s/K5nmre7g9LxXWef
Building Offices Question Approach​: It reduces to finding the number of connected subgraphs with k
vertices in an undirected graph. Total number of subgraphs with k vertices will be nCk. Check
whether each of these subgraph is connected using BFS/DFS. Time complexity of the same would be
O(nCk * O(V+E)). Any better approach than this one?
Similar problem: ​https://www.codechef.com/COOK62/problems/SUBGRAPH/
I request someone with accepted solution or with maximum test cases passed to share their
approach.

IITK (Technologist Profile)


3 coding and 10 (MCQ + subjective)
Same questions as IITG

Jaguar Land Rover

IIT Delhi (Software Profile)


Section 1: 20 aptitude questions to be done in 40 minutes
Section 2: Coding (80 minutes, 3 questions)
a. Spiral Matrix(25 marks)
b. Coin Change(50 marks)
c. To find the number of paths in a matrix given some constraints (100 marks)
You start at the top left corner and the corner accessible to you depends upon the number stored in
that place in
the grid. If :
Number 1 then you can only go right
Number 2 then you can only go down
Number 3 then you can in both right and down direction
The question had two parts:
Tell the total number of paths from top left corner to bottom right corner and the
maximum sum path (defined by adding the grid’s number, if the path taken was
3-2-1-1-2 the the path sum will be 9 and you had to print the maximum sum of all the
paths possible)

IIT Hyderabad ( 3 profiles: Software, Power Electronics, Mechanical)


Platform: Firstnaukri.com (Total code should be written from scratch(including int main() ) ),
STL allowed.
PE profile
Section 1: Aptitude 20 ques in 40 mins, no negative marking
Section 2: Technical 20 ques in 40 mins, no negative marking
Section 3: Coding 3 ques in 80 mins
a. N eggs K floor building find minimum attempt to break.(100 marks)
b. t(50 marks)
Given a 2D matrix which contains either 1 or 2 or 3. which represent
1->can move right;
2->can move down;
3->can move in both directions;
You are at the top left corner and need to reach bottom right corner.
Find total no.of possible paths. And also term adventure is defined as the sum of all the
values in the path. You need to maximize the adventure and return “total no.of
paths%1e9+7 and adventure”.
c. Roman Numeral to integer(1 to 3999). (25 marks)
// Mech had same pattern, software had apti+coding only.
/​/what were the constraint for N and K in egg drop puzzle(Q.a)?? ​ N < 40, K < 50
//Technical MCQs were from which topics??IIT H Guys please
reply?​https://www.geeksforgeeks.org/m-coloring-problem-backtracking-5/
//CAN SOMEONE PLEASE TELL THE TOPICS OF TECHNICAL QUESTIONS FOR PE PROFILE
- PLEASE HELP

IIT Roorkee

(​( 3 profiles: Software, Power Electronics, Mechanical)


Platform: Firstnaukri.com (Total code should be written from scratch(including int main() ) ),
STL allowed.
Section 1: Aptitude 20 ques in 40 mins, no negative marking
Section 3: Coding 2 ques in 80 mins
Given a base.
Calculate the largest number(in base 10) less than 1500000 which is a factorion
number in base b.
e.g. base=11, 26 is a factorion because 26 in base 11 is 24 and 2! + 4! = 26.
Does anyone have solution of this question?? give answer??+1
Similar to hotel
scheduling(IB:​https://www.interviewbit.com/problems/hotel-bookings-possible/​)

IIT KANPUR ​(3 profiles: Software, Power Electronics, Mechanical)


Were allowed to choose any two of the above profiles for the test
Platform: Firstnaukri.com (C,C++,Python,Java allowed)
Mechanical Profile or Mechanical and Software Profile: Common test for both
Section 1: Aptitude: 20 questions 40 minutes no negative marking
Section 2: Technical: 20 questions 40 minutes no negative marking (Questions were from
solid mechanics, basics of design (Von-Mises and Tresca criterion), IC engines,etc)
Section 3: Coding: 2 questions 80 minutes
Given a year, find out whether it is a leap year or not.
Given an array of N elements. Print 1 if the array can be broken into K
non-empty sub-arrays ​subsets?+1​ such that sum of each sub-array should is
same otherwise print 0.
e.g. array = {1,2,4,5,6} and K=3
Output : 1
It can be broken into K non-empty sub-array with same sum i.e. {1,5} {2,4} {6}
​Will backtracking solution pass? ​No, Constraints were 1<=n,k,a[i]<=100
contiguous 
In the second question is it subset or subarray, please clarify?+2 
https://www.geeksforgeeks.org/number-of-ways-to-divide-an-array-into-k-equal-sum-sub-array
s/  
This gfg link involves COUNTING the ways, Here the question is WHETHER it can be broken into 
subarrays. Which one came in the test? 

IIT GUWAHATI ​(3 profiles: Software, Power Electronics, Mechanical)


Software Profile:
Section 1: Aptitude - 20 MCQs in 40 minutes(Each MCQ had different weightage from 2 - 5 marks, no
negative marking)
Section 2: Coding - 2 questions in 80 minutes
https://www.geeksforgeeks.org/check-string-substring-another/​(50 marks)
https://www.geeksforgeeks.org/m-coloring-problem-backtracking-5/​(100 marks)
//CAN SOMEONE PLEASE TELL THE TOPICS OF TECHNICAL QUESTIONS FOR PE PROFILE
- PLEASE HELP
MosFET, Control System(Check if given system is stable), Converters, Transformers

IIT (BHU) @ 20-10-2019


Jaguar LR conducted test on FirstNaukri | STL Allowed | 2 Sections | 40m+80m | Section
Inter-switching Not Allowed - Sequential Sections | Coding questions same for All
Section 1 : Objective
40 MCQs majorly on Aptitude, Quant, Probability, Reasoning.
Sequential questions : Going back to previous question not allowed.
All students had different sets.
Section 2 : Coding
Q1 - Given a stream of integers, find the first positive integer that does not appear in the stream. The
length of the stream would NOT be given.
Solution : Set-based solution ​GFG IDE
Solution : Vector-based solution ​GFG IDE
Q2 - Given the edges of an undirected graph and a number 'm', determine if the graph can be
coloured with at most 'm' colours such that no two adjacent nodes are coloured same.
Solution : Backtracking-based solution ​GFG

IIT MADRAS ​(3 profiles: Software, Power Electronics, Mechanical)


coding:
given 3 numbers 4,5,6 and their occurance x,y and z respectively. (50 marks)
EX: input : x = 1, y= 1,z=1 (x,y,z are no of times the number at most occurs)
then output should be
4+5+6+45+54+65+56+64+46+456+546+465+564+645+654 = 3675
given an array of length n, and it is divided into k subsets such that no subset has a
duplicate element. find the number of ways in which array can be divided into k
subsets. (100 marks)
ex: array = {1, 2, 2} k =1 { { 1, 2},2 } is valid and {1,{2,2 }} not valid so output is 1

Publicis Sapient (Data Science Profile)

IITG
20 MCQS : DBMS, Algo, ML, Probability Distribution
MCQs: {(Find 2nd, 3rd and 4th quartile of a series of numbers), (Joint Prob Density), (Time series
effect of non-stationary on ARIMA), (How to reduce underfitting), (Batch size given, training size,
epochs given, find execution time), …}
1 coding (in Python only)
2 ML out of which only 1 need to be done.​(were using libraries like numpy, pandas sklearn allowed?)
Yes

Was use of the Internet allowed for the ML section?


coding + ML Link:
https://drive.google.com/file/d/1FWpV221DyiLB9YjRl5e192hmjfNCefAD/view?usp=sharing
Was tab switching allowed?

IIT BHU
pattern same as IITG (Time 1.5 hrs)
coding(Python only) - Given a string return a special sort of the string. Special sort of the string is
defined as - take the lexicographically smallest letter as first letter of your answer then
lexicographically second smallest and so on. when you cannot find any the come back in the same
order find the lexicographically second largest (of remaining) and then third largest and so on repeat
the same steps while all the letters are not included in your final answer ​.Can anyone clarify the Qn...I
couldn’t understand
eg:- ababyz
ans:- abyzba
Explanation of above example:-
step 0:-ansString=”” ,givenString=”ababyz”
step 1:-ansString=”a”(lexicographically smallest remaining in the givenString) , givenString=”babyz”
step 3:- ansString=”ab”(b being lexicographically smallest after a) , givenString=”abyz”
step 4:-ansString =”aby” , givenString=”abz”
step 5:-ansString=”abyz”,givenString=”ab”
step 6:-ansString=”abyzb”(b being lexicographically largest after z),givenString=”a”
step 7:-ansString=”abyzba”,givenString=””
return ansString
eg:- abbabb
ans:-ababbb
2 simple ML questions were there out of which one has to be attempted
one was simple linear regression (don’t remember the other one)
use of numpy , Pandas , and sklearn allowed.
Any idea about second question of ML?
IIT Roorkee
same pattern as IITG (1.5 hours)
20 MCQ : SQL ( Use of LPAD Function, Difference between UNIQUE, DISTINCT AND DIFFERENT
Functions), Probability ( Calculate MLE, and a question on Normal distribution,), Algos ( Lasso
,Ridge, elastic net) ( ex : if the training data is 10GB and your computer ram is 4GB , how will you
train ?, ex: if features are too many and highly correlated, which algo you will you use ?)

Coding 1 question(PYTHON) : Concatenate 3 string in lexically increasing ordeR


2 ML Question : Q1 :
https://www.chegg.com/homework-help/questions-and-answers/given-humidity-data-days-spanning-
startdate-enddate-inclusive-predict-hourly-humidity-data-q34232880

JPMC (SDE)
what was the platform? ​HACKERRANK

IITG
1HR
Q1. Given a 2D matrix. of n rows and columns. Each cell(pixel) has a value from 0-255. The first n/3
rows represent colour red, next n/3 rows colour green and then n/3 row represent blue.
You have to output a single 1-d array containing 8bit binary value for each pixel.
Example: 1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
16 17 18
Here first 2 rows represent Red,THEN GREEN THEN BLUE
output= [1,7 ,13,2,8,14,3,9,15,4,10,16 and so on]
Not in output you have to give binary representation for each number for example for 1: 00000001 for
7:00000111
This just boils down to converting a decimal to binary right ?

Q2:
Given a list of transaction
GOOGL BUY 500 784
GOOGL SELL 200 540
AMZN SELL 300 200
Each row represents a transaction. The first column tells company name, second column tells type
{BUY,SELL} Third column quantity of stock to buy or sell and fourth column tells the price.
You have to execute the transactions.
A BUY transaction can only be matched with SELL transaction of the same company and vice versa
if price of BUY >= price of SELL
if there are multiple SELL transaction for BUY then choose the SELL transactions having minimum
price.
if there are multiple BUY transactions for SELL then choose the BUY transactions having maximum
price.
You need to find number of shares which were left after completing all transactions
GOOGL BUY 500 784
GOOGL SELL 200 540
GOOGL SELL 200 550
AMZN SELL 300 200
Here For GOOGL 1st transaction will be matched with 2nd.(not third)
after this
GOOGL BUY 300 784
GOOGL SELL 200 550
AMZN SELL 300 200
Now again match
GOOGL BUY 100 784
AMZN SELL 300 200

So ans is 300+100= 400


Approach: for every company make a min heap and a max heap.
insert all sell transaction in min heap and all buy transaction in max heap.
while (both heap not empty){
s=pop min heap
b=pop max heap
if(s.price> b.price){
break;
}
q= min(s.quantity, b.quantity)
s.quantity -= q
b.quantity -=q
if quantity is 0
discard
min_heap.push(a)
max_heap.push(b)
}

IITR

​Same Problems as in IITG


someone with screenshot of questions????

IIT KGP

2 questions in 1 hr

Link to answer
VISA
Platform and eligibility criteria? Hacker rank

IITK
Q1. Activity selection problem(start time and duration given. At any time only one activity can be
done. Select the most number of activities.)
Q2. You are given two strings s and t. |s|>=|t| You need to determine whether t can be concatenated
multiple times to obtain s. Also if this is possible to do then you need to output the smallest string x
such that both s and t can be obtained from x by some number of concatenations.
Sol. Can be done using KMP
Q3 You are given three types of moves of the form ‘./’ ‘../’ ‘x/’. These moves represent folder
transitions. You are given a sequence of such moves. You need to output the minimum steps you
need to take from the last location to reach the root.
Q4 You are given two numbers a and b. Determine the sum s for which maximum numbers between a
and b( inclusive) have their sum of digits equal to s and also the number of times this sum s occurs.
Brute force won't pass. a,b<=1e18
solution for Q4 =​ ​https://ide.geeksforgeeks.org/O3XN7ByK7J​(Digit DP)​// can you please tell how to
pass the input
IITG
Mtech allowed
Same as IITK

IIT KGP
Q.1 Array subset. Given an array, find a minimal subset of it such that the sum of its numbers is
greater than the sum of number in the remaining subarray. Easy Question
Q.2 Shopping Budget. Arrays of prices of jeans, skirts, shoes, etc were given, and the budget. Have
to figure out no. of ways in which we can buy all the items in given budget.Eg. a=[1,2,3] b=[2,3] c=[4]
d=[1,2,3] (Brute force did not pass 4/12 test cases) (Can be done using 4 sum. 2 loops for first 2
arrays and 3rd loop for rest 2 arrays. Passed all test cases.)
Is this similar to Subset sum problem​ Yes
Q3. Dodge the Ball. (Hard level question)////​can someone tell what the problem was about? (cant be
done in 1.5 hours)
Q4. Question on string where you had to first apply regex and then count number of allowed
substrings. (very lengthy also string size was 10^5 )

CURE.FIT
WHICH PROFILE???- ​SDE, IITD-Data science, App developer, Front end developer, SDE

IITK
1hr. Platform- Hackerearth. 2 coding questions
Q1. You have an array of size n, consisting of three types of characters ‘a’, ‘b’, ‘c’. You need to count
all the triplets of the form (p,q,r) where p is some index of ‘a’, q is some index of ‘b’, r is some index
of ‘c’ such that (p*r)=q*q. Indexing in array starts from 1.
Note: O(n^2) will only fetch 60/100
Solution to Question 1, anyone? Urgently required, we have a test at 8??? ​Did this question appear
again in your exam ?​No
O(n) was required or O(nlogn) will also do?
Will n^1.5 work?
This can be done in O(n*log(n)*log(n)).....​how?? cure
pls if anyone has the answer post it
Compute by sieve. It will run in O(n*log(n)*log(n)​.. can you please elaborate on you approach?
My Approach : (Correct me If I am wrong)
take three arrays : ar1,ar2,ar3
push all indices of ‘a’ in ar1
push all indices of ‘b’ in ar2
push all indices of ‘c’ in ar3
Note that ar1,ar2,ar3 will be sorted since we are traversing the string from left to right.
For every element in ar2, we will see if there exists an element in ar1 and ar3 such that p*r = q*q
using two pointers approach.
Time Complexity : O(N^2)
You can improve it to O(N*sqrt(N)) by finding the divisors for q​..i think we need to find divisors of
q^2?...that will eventually be O(n^2)
Q2. A graph of n vertices is given. A source vertex s is given. You need to find the shortest path from
starting from source s visiting all the other n-1 vertices and ending back at s.
1<=n<=12
Solution: dp with bitmask
Solution: backtracking passes all case
is the graph is undirected or directed ?.
Is it allowed to visit nodes multiple times??
Shouldn’t the answer always be 2*(n-1) in case the graph is undirected ;)
??? Any link to solutions for question 2
I think it is similar to this one: ​https://leetcode.com/problems/shortest-path-visiting-all-nodes/
Isn’t it TSP? ​Yes, It is,Yes
But in TSP every node is connected to every other node and you can visit a node once in the cycle.
Is this valid in this question?
Or the question is something like the above leetcode link?

IITR
1). A series of n bulbs are in a line out of which at least k+1 are fused. A man buys a set of bulbs
containing k red bulbs and a multicolour bulbs along with some white bulbs. He in to replace the
fused with k red, 1 multicolor and others with new white bulbs. How can he minimise the
distance between the farthest red bulb and multicolour bulb. A string of 0 and 1 is given, where 0
denotes fused and 1 denotes working.
Input: n=7 k=2
1110100
Output: 2

Any solutions to this questions ??? ??


Any concept please highlight it here????? using sliding window, if a window contain k+1
diffused bulb, explore around its median position
2). A cat named Minerva is playing a game in the coordinate plane. She starts at (1,1) and can
move by either doubling one of x, y or subtracting the greater one from the smaller { (4,1)->(3,1)}.
You're given a point (x, y). Will she be able to reach the point? Output YES or NO.
0<= x,y<=3000000000 ​Is this limit correct?? ​YES
input: (3,4)
Output: YES
Explanation: (1,1)->(2,1)->(4,1)->(3,1)->(3,2)->(3,4)
Please add solution to this question. ​ Can be solved using Euclid’s Algorithm
Can you explain more​IITD
Societe Generale

IITG
***If someone has photos or remembers more questions please add them***
Platform: HirePro
4 sections(Each section had a separate timer):
Logical reasoning and Aptitude - MCQs
English(Sentence correction and comprehension) - MCQs
Computer Science(DS, OOPs, Testing, Algorithms. Some topics I remember: Heap
Sort, Black and white box testing, hashing, linked list as queue, types of testing etc.) -
MCQs
Coding(2 questions - 40 minutes, had to write code from scratch, STL was allowed: int
main(), i/p and o/p as STDIN, STDOUT):
Given a 2D matrix first you had to make it a square matrix by adding 1’s. Then
you need to find the sum of all diagonal elements of this square matrix which
occur exactly K times as off diagonal elements(i.e. not in the main diagonal).
Example:
32
545231
1
Answer: 5
Input format:
First two elements tell size of 2D matrix (m, n).
Next m*n numbers are the respective elements.
last line has a single number which is the value of K.
Answer Explanation: First we make the matrix a square matrix as follows by filling the
rest of the matrix with 1’s:
545
231
111
Now, the diagonal elements are 5, 3 and 1. Since the value of K is 1, and 5, 3 and 1
occur 1, 0, 3 time(s) respectively as off diagonal elements, we only add 5 to our
answer. Hence, the answer is 5.
sol: ​https://ide.geeksforgeeks.org/nnBkWI5FiX​ (correct me if I’m wrong)
Initially all the doors are locked and each door needs a different key to be opened.
Sarah has all the required keys to open any of the door. Find the minimum number of
doors, Sarah needs to unlock to rescue Bob and Alice out of the building. Note: You
cannot cross walls. Once you open a door, you don’t need to open it again i.e. you
only need to unlock a door once and you can cross it as many times as you want.
Provide constraints on size of matrix.
Q1. Is the source given ?​The boundary of the matrix has doors or empty paths
marked through which you can enter.
Q2.(MORE Info on this)?

IITD
Platform - HirePro
4 sections, details same as above.

Coding 2 questions - (40 mins)


Q1. Given a stream of integers, insert it into a BST and find the path to the node at the maximum depth.
Q2. Given a matrix of size n x n, and an element x. If the row and column containing x is r and c. If r + c is odd
the print the sum of all odd elements of the matrix else print the sum of even elements of the matrix.

Morgan Stanley

IIT BHU @ 12/10/2019


AspiringMinds AMCAT | STL Allowed | 3 Sections | 20m+20m+60m | Section Inter-switching Not
Allowed - Sequential Sections | Section-C same for All
Section A : Debugging - 20m
7 questions with codes given in the compiler
Each had to be debugged so that they produce the right desired output
Total 7 Questions : Three points as input (structs of x and y coordinates), the code should return
boolean if they can be sides of a Right Triangle. 2) Three numbers as input, the code should return
an int as the product of the two larger numbers of the three. 3) A number as input, the code should
void print a particular pattern (Like two * in line 1, four * in line 2, so on till line n, the error in given
code was improper ‘for’ loop).
Section B : Aptitude - 20m
10 questions on Aptitude - Mixture of two liquids, Percentage, Time & Work, Probability etc.
8 were easy. 2 were difficult, had to infer from data given in Pie Chart / Bar Graph / Sales Table and
calculate.Given two arrays, you need to count sum of n1 and n2 where n1 = no. of elements in the
first array that don’t appear in second and n2 = no. of elements in the second array that don’t appear
in first.

Section C : Coding - 60m


Problem 1 : Find no. of Uncommon Elements in Two Sales Lists. 13 Test Cases out of which 11
Hidden.
Solution Approach : Make two sets to store elements from array1 and array2 and initialise answer as
len1+len2. Iterate for elements of array2 in set1 and array1 in set2 and accordingly decrease the
answer.
The approach worked fine with all test cases, but more space-optimized solution can be used.
Problem 2 : Based on Topological Sort.
https://leetcode.com/problems/course-schedule-ii/
Someone please update the complete problem statement
Solution Approach : Kahn’s Algorithm for Topological Sort ​GFG
Problem 3 : Advanced Knapsack Problem. Given ‘n’ products and their parameters : cost, wastage,
and profit. Using each product at most once find maximum profit if maximum allowable cost ‘maxc’
and maximum allowable wastage ‘maxw’ are given.
Approach : m-dimensional Knapsack Problem ​Wikipedia
Someone please update the solution+1

No one was able to pass all test cases using proper knapsack method. Some bogus method which
involved sorting and selecting the product greedily passed all test cases.

IIT Kharagpur
Open to all circuital (8+ CG) and non circuital (8.5+CG)

IITB

Amcat (Chutiya Platform)


Make sure if you are using vector<pair<int,int>> , write it as ‘vector< pair<int,int> >’ cause it was parsing ‘>>’
as right shift.
Same pattern as IIT BHU

Coding Questions :

1) There are n cabs and n user locations. Distance between cab and location is evaluated by doing
absolute difference of both. Any cab can be assigned to any user location at most once. Waiting time is
evaluated by finding maximum distance between cab and user location in particular assignment of cab
to user. Find minimum waiting time (Sort both arrays and find max difference)
2) There are N processes with each having bi as processing time and there are m processors. We are
also provided a digit d , 0<=d<8 . Scheduler prioritize scheduling of the process in such a way that
when we convert the burst time of a process in octal base, no of digits d in octal equivalent is max i.e
for example if burst times are 1,2,10,16,32 then 32,16 and 2 will have more priority. If 2 burst times tie
on basis of digit count then tie is broken by greater value. Find m processes which will get scheduled.
3) Same as IIT BHU’s 3rd question

Plutus Research Capital

IIT-Delhi
3 quant questions subjective and 4 coding questions in 1.5 hours
Quant
Find the smallest number which has 30 divisors. (30 marks)
let n be a 5-digit number with sum of digits being 41. What is the probability that the
number is divisible by 11. (60 marks)
https://www.geeksforgeeks.org/puzzle-16-100-doors/​ (60 marks)
Coding
Number of integer solutions to 3a+5b+10c = N.
This is similar to Coin Change problem
An array of size n given. We had to find max((j-i)*min(arr[i],arr[j])). Here i and j are array
indices
​https://practice.geeksforgeeks.org/problems/find-maximum-value/1
A pseudo code was given we had to code it. Something on bit operations.
Someone please add this question. I seem to forget it.
Disk of various size werebottom given on different days we have arrange them such
that maximum is at the .
Eligibility and CPI cutoff???

Codenation

IITK

https://owncloud.iitd.ac.in/nextcloud/index.php/s/zCk3agFHce4XxBs

IITG
3 Coding question 75 min.
Profile: ​Software Development Engineer 
Open for Mtech 
Coding Question:
​https://drive.google.com/file/d/1jInJLNeZyipRw2Te8q640_4psTJTY718/view?usp=sharing

Solution for No Distraction:

There can be only one “special word” starting at index i. Find all the words and then use Segment Tree to
process all the queries offline.

Service Now

IITG
please add MCQ questions IITG guys, we have test tomorrow.
Were there different sets or were they the same for everyone? ​Coding same for everyone, MCQs
were same for everyone but order was different
please add CTC and Branch/CPI cutoff . Branches - Circuital (CPI - 6.00)
same for everyone
Profile: ​Associate Software Engineer 
Open for MTech
Total 90 min test.
25 Mcqs: on aptitude, data structures, automata
1 Coding:
https://drive.google.com/file/d/1AR5mJjorQm7nclz1XnQMX9PwZknr1ZNh/view?usp=sharing
Was switching between sections allowed?? Yes

IIT BHU
Same Pattern as IITG,switching between sections was allowed.
25 MCQs : aptitude, probability, automata, OS
1 Coding : Same as IITG
IITG
I have chosen Masters signal Processing. The topics in the core part are Signal and Systems.
Mathematics and Communication Topics .
Mostly they concentrated on simple Signals and Systems such as fourier transform of t*exp(-t).
2. Finding the Nyquist Rate of linear combinatioN of two cos signals.
In Coding questions
1.Game winner from previous papers.
2.This is simple string manipulation based on 2 functions i.e, stoi and to_string
Input:a26b27c52a9c1d9a1b2
Output:a36b29c53d9
The link is provided here
https://github.com/manojyamasani/Placement/blob/master/stoi&to_string

IIT kgp
Jio Saavn

IITB
3 Questions 60 Minutes Interviewbit

Given a value N , find all valid parenthesis combination strings of length 2*N (Backtracking)
1) Coin Change Problem

IITR
Eligibility : ​B.Tech - CSE, EE, ECE
M.Tech - CSE, EE, ECE
​ IMSc Applied mathematics
Test duration : 60 Minutes
Platform : Interviewbit
https://www.interviewbit.com/problems/gas-station/
https://www.interviewbit.com/problems/max-product-subarray/
https://www.interviewbit.com/problems/rain-water-trapped/
Given two particles , their initial coordinates x1,y1 , x2 , y2 and their velocities vectors
in [ux , uy] , [vx ,vy]. return 1 if collision is possible else return 0.

IITD
Test duration: 1.5 hours
Platform: Interviewbit
1) https://www.geeksforgeeks.org/longest-increasing-subsequence-dp-3/
2) https://www.geeksforgeeks.org/detect-and-remove-loop-in-a-linked-list/
3) https://www.geeksforgeeks.org/first-negative-integer-every-window-size-k/
4) Given N, T, P. N->Length, T->time, P-> a constant. End points and 1 and N. At T = 1, end at pos =1
moves up and so on. At point P + 1, P+1 moves up but point 1 settles down. At time T = N + 1, N - P +
1​th​ point comes down and so on. Find the number of points that are up at any time T.
a) 1 <= N <= 10​9​, 1 <= T <= N + P, 1 <= P <= N.
i) Sol - if(T <= P) return T;
Else if(T <= N) return P;
else return P + N - T;

​Phonepe

IITR
Eligibility : ​JEE ALL
Test duration : 90 Minutes
Platform : DoSelect
Use this link to look at the questions: ​https://imgur.com/gallery/kZ4p560
https://leetcode.com/problems/maximum-subarray-sum-with-one-deletion/
Find Median of the sorted array formed after taking the sum of all the non-empty
subsets of the given Array.

Anybody knows solution of median problem?+1


https://atcoder.jp/contests/agc020/tasks/agc020_c
Given a string consisting of ‘A’, ‘B’ & ‘C’, you have to replace all occurrences of ‘ABC’
with ‘BCA’ and find the number of times it is possible to do the operation. For ex -
Given ‘ABCABC’ -> ‘BCAABC’ -> ‘BCABCA’ -> ‘BCBCAA’. 3 operations can be made.
Given a pyramid consisting of bricks numbered from 1 to N. Every level has bricks 1
more than the level above. Now if a brick is removed. We had to find the sum of all the
bricks that fill fall.
Ex -
1
2 3
4 5 6
7 8 9 10

If you remove brick 9, bricks 5,6,2,3,1 will fall. Ans is sum of 9+6+5+3+2+1 = 26.
​ hat is the input format? Just N?Constraints on N?​ Input was an integer denoting the brick
W
removed.
Squarepoint Capital

IITG
Profile: Graduate Software Engineer
Eligibility: All B.Tech.
Test Duration: 90 minutes
Test Platform: HackerRank
how many questions were there in one set?
2 MCQs (Questions were different for all) ​(From which topic?)
5 Coding Questions(Questions were different for all)
Given a binary string, count the number of substrings with the following constraints:`
All 1s and 0s are contiguous(Ex. 00011, 11000)
The string has equal number of 1s and 0s.
Ex. Input: “001101” Output: 4 (Explanation: “01”, “10”, “01” and “0011”)
You are given two numbers a and b. Determine the sum s for which maximum numbers
between a and b (inclusive) have their sum of digits equal to s and also the number of
times this sum s occurs. Note: Brute force won't pass. a,b<=1e18. h
(Hint: See ​https://www.geeksforgeeks.org/digit-dp-introduction/​)
(Solution : ​https://ide.geeksforgeeks.org/O3XN7ByK7J​) (Digit DP) //how to pass the input
Someone please provide the solution for this question, it has been asked twice or thrice+3
Find the minimum number of moves needed to sort an array such that all even
numbers occur before odd numbers. A move is defined as swapping of two elements of
the array.
Ex. Input: [3 5 4 6] Output: 2 (Explanation: Swap 3 and 6 and Swap 4 and 5). Note: Both [6 4 3
5], [4 6 5 3] etc. are acceptable.
https://www.geeksforgeeks.org/making-elements-distinct-sorted-array-minimum-incre
ments/
Given Prefix sum matrix, obtain the original matrix.
https://www.geeksforgeeks.org/prefix-sum-2d-array/

IITD
Same as IITG
All questions different for everybody
2 MCQs
5 Coding questions (Easy
to Medium Difficulty)

Someone has deleted this question. Hence adding it again.


n m ​e
IIT R
All questions different for everybody
2 MCQs
5 Coding questions
Most of the questions are same from the above bucket
Given string containing ‘l’ and ‘r’ and two values x and y; you have to find the number
of subsequences of given string to reach y from x; Here l means decrement by 1 in x
and r means increment; ​Constraints on length of string
Given two arrays A and B. x + y = A[i], x xor y = B[i]. Find minimum value of x for
every i.If no such x exist return 0. Length of array <= 50, A[i], B[i] <= 10^15.
https://leetcode.com/problems/special-binary-string/
https://www.geeksforgeeks.org/number-groups-formed-graph-friends/​ (Variation of this
question)
Implement a stack with the following operations:
push v - push v at top of stack
pop - pop element from top of stack
inc i v - increment bottom i elements of stack by v
Print the value at top of stack after every operation
https://www.careercup.com/question?id=6229105402970112

Trell

IIT Kanpur
(Not mine, i took this from the FB group and pasted it here. Possibly that guy doesn’t have edit
access to this doc)

IIT BHU
Duration : 1 Hour for SDE, 20 Questions
Platform : Google Doc
For SDE Profile Data Science exam is compulsory
Same as IIT Kanpur : SDE Profile

Oracle
Did anyone do screen recording?

IITG
Pattern same as that at IITD.

IITD
It was visiting for Server Technology (Bangalore, Hyderabad, Noida) and OFSS (Pune, Kochi) Profile.
There were different sections which had questions from DBMS concepts and OS concepts. There
was aptitude section, logical reasoning, english comprehension and many more such questions
which are part of CAT syllabus. ​No coding questions.​ Every section was timed and no negative
marking was there. You can skip a lengthy question which you can re-attempt at last if you have time
for that section after visiting each and every question. There were multiple sets.
Were there any coding questions or only MCQs?​ ​Read the above paragraph carefully ONLY MCQs!!!

IITK
45 min aptitude test ( 3 section , Time was divided in 3 part then again subparts) CGPA>=7.0
(Exceptions can exist)

1)Same test for both profiles (​Applications Engineer – Applications Development and Member 
Technical Staff – Server Technology)
2) No Coding question
3) back option was not available
4) questions were like given an algorithms fill blanks in it’s pseudo code. Once
understand algo next 4-5 questions were on same algo (so don’t skip questions. Remember
you can’t come back)
5) Given array representation of BST find leftmost node , rightmost node, post order ,
pre order , inorder , level order.
Suggestion: Don’t skip question just looking at too long. You can spend half of your
allotted time in single question rest will follow.

Bounce ​What was the resume shortlisting


criteria? Branch? Cgp?

IIT BHU
Hackerrank. 20 MCQs + 2 coding in 1 hour. Switching sections allowed.
MCQs:
Lot of questions from DBMS theory - transactions( commit, rollback), Normal forms,
Functional dependency simplification, No. of Primary keys
OS - which one shows Belady anomaly - (FCFS or LRU), Thrashing, Bankers algo,
Deadlock prevention, deadlock avoidance
Quicksort worst case time complexity when a pivot is chosen such that both left and
right subarrays have at least 1/5th elements
Options 1. T(n) <= T(n/5) + T(4n/5) + n 2. T(n) <= 2 T(n/5) + n 3. T(n) <= 2 T(4n/5)
+n
Java OOPS, try, catch, finally block.
Coding1​: You have a set of flasks with certain markings at different levels and you have a set of
requirements by customers telling you how much quantity they need. Since the markings are not
continuous, you need to fill the container upto the equal or next highest marking, i.e, the
container/flask must be filled to a level greater than or equal to the requirement. Every flask has
different markings. You need to return the flask which will lead to minimum loss. (filling it higher
than the requirement results in loss). In case of tie, return the flask with least serial number.
Example- Requirement = [2,4,7]
Flasks - 4, Markings = [ [0, 2], [0,4], [0, 8], ………….flask 0 marking pairs
[1, 2], [1,5], [1, 9], ……….flask 1
[2, 5], [2,6], ………….flask 2
[3,7] ] ……….flask 3
Example solution - Flask 0 = (2-2) + (4-4) + (8-7) = 1 loss
Flask 1 = (2-2) + (5-4) + (9-7) = 2 loss
Flask 2 = <cannot be used to satisfy third requirement>
Flask 3 = (7-2) + (7-4) + (7-7) = 8 loss
Thus the answer would be flask 0
Coding2​: Predators problem(JUNGLE BOOK - NFRENCE LABS IIT M) (repeat from somewhere in the
doc) ​http://prochal.com/2019/06/the-jungle-book/

Intel

IIT KGP
Platform: HirePro
For Software Profile: 45 Gate Level Questions in 35 Mins, 1(around 15 questions) Aptitude Section
for 25 Mins, 1 coding question for 30 mins
Switching between sections is not allowed.
Coding question was of Hard Level, difficult to do in 30 mins.
Question: There is a rectangular classroom and students are sitting in it. Some students are
interested in playing chess. 0 denotes students interested in playing chess, 1 denotes students not
interested in playing chess. A student can only play chess with its neighbours. Neighbour of a
student{i,j} are students who are at locations {(i+1, j), (i, j+1), (i-1,j), (i,j-1)}.You have to find maximum
number of pairs that can play chess.
Example:
n=3,m=3
Maximized formation:( 3 pairs)
(​0​ ​0 0​)
(​0​ 1 1)
(1 ​0 0​)
Not maximized formation:(2 pairs )
(​0 0​ ​0)
(0 1 1)
(1​ 0 0-​)
constraints: ​1<=n,m<=500
If anyone finds any solution or approach please share. (Brute force DFS will give TLE)
It was most difficult question for 30 minutes**
Maximum Bipartite Matching? Seems So “yes”
Can someone please provide the solution?

OLA (SDE and RE)

IIT D
2 hours Test-4 Coding Questions (Java,C/C++,Python allowed,other languages were also allowed)
given a string, count the occurences of the distinct characters in it and form another
string in relative order these distinct characters appeared. E.g: “occurrences” will give
“o1c3u1r2e2n1s1”
Any constraints on the size of string?​10^5
Count The number of nodes in the subtree. Input was an array formed by dfs
Algorithm for forming the array (Given in Question)(Using this array you had to
count the number of nodes in the subtree of any node) :
void generate(node x){
insert x in the array
visited[x]=true
for child in adj_list of node:
if (child not visited)
generate(child)
insert x in array
Laxman DBMS:
The Table was of form ID | Username | Rides
Implement a DBMS which should be able to perform given set of instructions:
SELECT* Should return all entries in the table Sorted by ID
SELECT* from Rides such that Rides>555 : Should Print all the entries with
number of Rides greater than 555
INSERT (ID,Username,Rides) : Can be a new entry of update of existing ID
Other Functions were also to be implemented (Pretty much like standard SQL
queries) Can be done using self-balancing Trees
You just had to write SQL queries or the functions implementing them on your own?
implement this function
How to do this ? ​Make self balanced trees that have log(N) update and log(N) insertion
time or use hashing with collision resolve to have O(1) insertion and removal​Did your
test cases pass?
LOG FILE:
Ad-hoc questions. Read given lines every pair of line is like
STARTED operation1 -----some details----
COMPLETED response message execution time----other details
You have to tell:
i) Total number of operations executed
ii) Busiest Hour (Hour of request was given in started line,24 Hour format)
iii) Le​a​st responsive operations (with highest average execution time)
iv) Number of Distinct Operation carried out
v) Number of Distinct Response messages received
WHAT IS THIS ABOVE QUESTION ? ??? CAN SOMEONE PLEASE EXPLAIN THIS? ​+1
We had some lines of code of the form:
STARTED GET’\ride’ for https://…… 13:10:10
COMPLETED OK in 246ms -----some other useless details----
(and so on we will get input from console)
Now each operation is STARTED-COMPLETED pair..so you had to count how many operations you
executed
Next GET’\ride’ is a type of operation so you had to count how many such distinct types of operation
you encountered
OK is the response message similarly there were other response messages and you had to count all
distinct response messages
246 ms is the response time for GET’\ride’ operation and hence you had to output the operation
having highest response time among all operations
This operation was executed at 13:10:10 o’clock and hence you had to output the busiest hour (Just
the hour like if ans was [10-11) you’d output 10 like that
What about APM profile? ​ APM Test will be held at a later date.
Were the questions same for both Research and SDE profile? ​YES

IIT M
Difficulty: Moderate
3 questions. (1.30 hrs)
BFS
Sliding window in an array to find min distance between k contiguous elements.
lexicographic sort of 3 given strings
simple string compare function with sort() works!
Harness

IITD
1 hr Coding test on Hackerrank
2 Coding Ques. and 10 MCQs on OS/Networks
Eligibility???????+1
Coding Ques:
Easy Ad-hoc Problem ​que​??
https://imgur.com/a/7aL2Ggx
This is solvable using simple bipartite checking right??.
NO. Need to find vertex cover using dp.
Can somebody please provide approach to solve it?+1

Eligibility ?

IITR somebody
All problems same as IITD

IITG
Mtech Allowed
CPI: 7.0
1 hr Coding test on Hackerrank
2 Coding Ques. and 10 MCQs on OS/Networks
Coding ques: ​https://drive.google.com/open?id=10RZSpvUTdlfVte8BnCZ8ZFscM7fD2cei

APT Portfolio

IIT Delhi
Eligibility???

Uber
IIT B
3 Questions 90 minutes

1) Weighted Job Scheduling Problem


2) Filtering String Problem from other IITs
3) Bob and Maze problem from other IITs

IITD
Uber shortlists more female candidates.
(Open for M.Tech ?) ​Yes
Q1. ​https://leetcode.com/problems/cherry-pickup/​ (Constraints were different: n<=100)
Q2. ​https://leetcode.com/discuss/interview-question/202553/Traveling-is-Fun/
R

please give constraints of Q3 ​(size of the array <= 10^5)


Solution anyone?? Look comment->

IIT Roorkee

Q2.) Find the largest square sub-grid from a square grid of size n such that no square sub grid of this
size has sum more than given maxSum. Constraints : n < 1550 & A[i] <= 1e9

Trexquant
IIT KGP - Open for all branches (same questions as IITD & IITM)
IIT Delhi - Open for all branches
Total 36 questions. 3 coding questions out of which 1 has to be done in python, while the other two
could be attempted in any language. I would suggest to do all the questions in python, as their input
was in such a way that it was easier to code in python.

IIT Madras
Two 2-D arrays were given of size numDays * numStocks. Let the two arrays be
industry and ret. industry[i][j] gave the sector to which stock j belonged to on day i,
while ret[i][j] was the return on stock j on day i. We had to output a 2-D of same
dimension such that ans[i][j] is the average return for the sector to which stock j
belongs on day i, on day i. Eg. industry = [[1,2]],[2,2]], ret=[[0.5,0.6],[0.7,0.8]]. On first
day stock 1 belongs to sector 1 and stock 2 belongs to sector 2, therefore average
return remains same as individual returns. On day 2 both the stocks belongs to sector
2, therefore average return for sector 2 on day 2 is (0.6+0.8)/2. Therefore answer will be,
ans=[[0.5,0.7],[0.7,0.7]]
A 2-D array was given and a function was given which takes in the stock prices of last
three days. Return a 2-D matrix with applied function on each stock on each day. ​Was
library like Numpy or Pandas allowed?- Why would u want them?
A python code had to be debugged, (had to add only a single line).
Then there was a paragraph, about 700 words. We had to count the number of instances of ‘th’, ‘ve’,
‘ou’ and ‘gh ​essay link
After this 30 questions were based on news. News headlines were given and we had to predict
whether the stock of the given company in the headline would move up or down due to this.
35. List any number of factors which might affect the price of the stock.
36. Choose the best quality which describes yourself.
IIT Madras
Same as IITD

Sandvine

IIT BHU
Section 1: 15 Aptitude MCQs (20 minutes)
Section 2: 25 Technical MCQs (40 minutes)
Section 3: 4 Coding questions (30 minutes)
Code has to be written on simple text editor.

IIT (ISM) Dhanbad


Same as above.

RazorPay

IIT Mandi :
Coding 3 questions. Time: 1:30 min. Platform : HackerRank. CPI was 7 and above
10 MCQs : Mainly based upon tree traversals and pointers
Did the mcq include topics like os , networks, dbms??
Coding questions

Sort the Roman names : ​https://www.careercup.com/question?id=5665093766348800


Find Original 2D array from prefix sum 2D array.
Just opposite of this problem : ​https://www.geeksforgeeks.org/prefix-sum-2d-array/
You are given a string s i.e. “asdfgh” , and an integer array A[] = { 1, 2, 4 } here each
entry in A is referring to an index in string s. Now for all values
A[i] you have to increase the characters occurring till the A[i]th index by 1.
In our example, the answer would be : “dvfghh”

IIT BHU:
Pattern same as in IIT Mandi
Coding:-
1. (Repeated from doc Service-now question)
final discounted price

2. https://www.geeksforgeeks.org/find-the-first-maximum-length-even-word-from-a-string/
3. Find the number of decreasing subsequences of length 3 in an array
(similar to ​https://www.geeksforgeeks.org/count-number-increasing-subsequences-size-k/
With k=3 and decreasing instead of increasing)

IITR:
Pattern same as in IIT Mandi
Coding:-

Link to other coding questions: ​https://imgur.com/a/k8t34ot

Enphase Energy
IIT BHU
Embedded Hardware Engineer - Eligibility - Electrical, Electronics - BTech, IDD, MTech - CGPA>=8.00
Mettl Platform
2 Sections - 1. Cognitive - Aptitude - 30 MCQs (Consists Quant, LR, DI, Verbal)
2. Domain - Technical - 20 MCQs (Questions on Computer architecture, 8086
Microprocessor, Digital)
Most of the questions are repeated across campuses
Total Time Duration - 55min
Difficulty level - Moderate
Link for questions asked in IIT Madras -
https://drive.google.com/open?id=1SlVnZvLOYTZmiNyFADUBsJZZFC0c-qKf

Oppo
There were 3 coding questions
Q-1 You have lower case characters ‘a’ to ‘z’ and you are given a number N which is the
length of string. Now for a given value of N, you have to tell how many unique palindromes
can be formed using lower case characters. The range of N was 1<=N<= 10^18. Ans was to
be returned by taking modulo.
Sol - We have 26 characters. Now if value of N is odd, Then to make palindrome string we
need to fill
(N/2) + 1 places. For each place there are 26 options. Similarly if N is even, then we need to
fill N/2 places. So the problem boils down to finding pow(26, N/2 +1) or pow(26, N/2) which
can be done in O(logn) using divide and conquer.
Q-3

Please post answer of 3rd question if someone solves.


(ctc of OPPO ?) Ans - 28 LPA
Have a solution in O(N*K*M) not sure if it will pass. Can you tell your approach?

Dunzo

IIT Madras :
Coding 2 questions. Time: 1:20 min. Platform : HackerRank. CPI was 7.5 above
Counting no of inversions in array. ( Inversion is, for given arr and index i,j such that
i<j and arr[i]>arr[j]. Question was framed slightly different way but they were asking for
merge sort only. ​https://www.hackerrank.com/challenges/ctci-merge-sort/problem
Given array of strings of same length and a target string find number of ways to make
the target string such that index used for making the string is in strictly increasing
order.

Ex: Strings :1: “valya”, 2: “lyglb”, 3: “vldoh” . Target string: “val”


Ans: 4.
How: If i number above strings as 1-2-3 then
Can someone explain what the question is saying?

Can be done through dp. Passes all test cases.


Can you share the DP approach

IITD :
- String Q of IIT Madras.
- One
- operation is replacing A[i] with A[A[i]] for all i can the given array be sorted using such operations if yes
then how many operations needed.
- Pair of ID’s and their candy preference were given. We have to build a graph for each candy. In these
graphs find the largest connected component and return the maximum of product of largest two ID’s in
those connected components.

Bidgely

IITR :
4 problems , 90 minutes , Hacker Rank.
Eligibility​: B.Tech/IDD: CSE, EE, ECE (With a ​7.0​ CGPA cut-off)
Knapsack problem with changed language (​https://atcoder.jp/contests/dp/tasks/dp_d​)
Given a binary string of length 2*N ,you can apply N operation and In one operation you
can choose any two index(i , j ).Invert the bits in between (i , j inclusive). Find the
number of ways of setting all the bits to 1.Each pair of index can be selected at most
once.
eg . N = 2 , s = 0110 (ans = 4) , N = 5 , s = 1111111111 ( ans = 5!)
Given a matrix with values either 0 , 1 , 2 .Each cell denotes a cubicle in office 0
denotes empty , 1 denotes employee is non - diseased , 2 denotes employee is
diseased. If an employee is diseased , it can infect the employees surrounding him
({i+1,j} , {i -1 ,j} , { i , j +1} ,{i , j-1}) on a single day. Find minimum days in which ,all
employees will be infected. Return -1 if all won't be infected. eg . {{0 ,1 }, {1 , 0}} ans =
-1.
Solution :Take an auxiliary matrix for storing number of days it will take for the cell to be
infected , apply dfs from all the points where arr[i][j] == 2 ,pass a day variable in the function ,
minimize the number of days in every dfs call for every cell it can reach.
. ​https://www.interviewbit.com/problems/simplify-directory-path/

Published by ​Google Drive​–​Report Abuse​–Updated automatically every 5


minutes

Exxon Mobil:- IITk (open for MSE and Civil)


30min 25 question based on VARC 3 paragraph and 12 questions on grammar
30 min Technical:- for MSE they asked 25 questions based on basic metallurgy
thermodynamics, different form carbon steel etc.

COMMVAULT
IIT (ISM) Dhanbad
Time- 50min, 5 ques. (Platform??geeekd.com,the servers were too bad, were
getting disconnected.) ​only C,C++ allowed
1) Sum of values on the direct path between node ‘u’ and node ‘v’ of binary search
tree.
2) Josephus problem.
3) https://www.geeksforgeeks.org/segregate-even-and-odd-elements-in-a-linked-list
/
4) Print all permutations of a given number which are greater than that number
(input in the form of char array)
a) Array question, with some constraints which ended up to be, sum of
minimum number on the left hand side of for each value on the given array.

IITD
1) Maximum value of a node on the direct path between node u and v of BST.
a) Sol: Find LCA and using LCA as root, find the maximum of path
2) Find Smallest integer greater than K which does not have any consecutive ones
in binary form.
a) (Only Log(K) solution accepted​)
3) Same as 3rd above.
4) Find the number of pairs of integer which does not belong to the same
component.
a) Sol: Simple Union Find works
5)
6) .. (number with trailing 0’s are also counted).

AlphaGrep Securities
IITKGP
No CPI Cutoff, departments allowed : CSE, EE, ECE, MNC(Maths and Computing)
Open for MTechs too!

Test paper had only 5 coding questions, 90 mins. All primary languages were allowed.
Q1 - 100 marks, Q2 - 125 marks, Q3, 4, 5 - 75 marks each

Q1) Image Matching:


Given two matrices of the same size, each element is either a 1 or 0. Two 1’s are adjacent if they one is
directly below, to the left, to the right or above the other. A connected component in matrix is formed by a set of
ones which are adjacent to each other, such that no other adjacent 1 can be added to it. Need to find number
of matchings.
A matching is defined when any connected component of two matrices exactly overlap.
Soln : Use BFS on each one to get connected components, and then check for perfect overlap
Q2) Palindromic graph
Given a tree of n nodes and n-1 edges, in which each edge has a character assigned to it. For any two
vertex, a string is formed by characters of all the edges of minimum path between both of them. If characters of
that string can be readjusted to get a palindrome string, a valid string is found!
Need to find the number of valid strings in the given tree.
Q3) The Number Game
Given a list of numbers(numbers can be repeated), you can only select 3 numbers at a time from the
list. Max and minimum of those three numbers will be deleted from the list.
For a given list of numbers, find maximum length of list with distinct elements remaining after performing any
number of selections.
Ex : If list is [1, 2, 3, 3, 2] then answer will be 3, by selection (2, 2, 3) one time and then stop.
Soln : Just remove repeated numbers first until every number is repeated at most 2 times. Now
consider numbers repeating 2 times. Take any of that number two times and third number as one of those
numbers. Keep eliminating repeatedness this way and get the ans.
Q4) Text Formatting:
Didn’t remember.
Q5) Meetup Schedule:
Given a list of (arrival, departure) date for n number of investors, find the maximum number of investors
you can meet, if you can meet at most one investor per day.
Soln : Sort by arrival times. If arrival times match, sort by departure times. Meet investors in the order of
sorted order.
Won’t this solution fail if the arrival, departure times are :
(0,4)(0,0)(1,1)(2,2)(3,3). So, even though he can meet 5 investors, using above algo he would
only be able to meet 4. Assuming here that the investors arrive in the morning
and depart in the evening.

SALESFORCE

IIT DHANBAD, 29 OCT


Duration - 60min.
2 coding questions and 15 mcqs(topics- ml, dbms, tcp)
What was the coding platform ?​ Hackerrank ​STL Allowed ? ​Yes

1) Given 2 strings and find if we can add character on str1 and


not remove any character from it to make it equal to str2.
Eg. str1 =”butfl”, str2 = “beautiful” (output== yes)
Explanation - add character btw ‘b’ and ‘u’ and we can add between ‘t’ and ‘f’ and
then between ‘f’ and ‘l’.
Note- sequence must be same (like if str1= “utflb” and str2 = “beautiful” output ==no,
as the sequence of character appearing in str1 is not same as str2).
2) Smallest length of substring containing all characters of
another string. With string being circular.
Subsequence or String? ​Based on the example below, it is substring...not sure
though ​Subsequence. Question is unclear. Can someone elaborate please?

eg . str1 =”melody” str2 =”ldym” length == 5

IITH
Duration - 65min.
2 coding questions and 15 mcqs(topics- ml, dbms, tcp)
Q1- String Manipulation, List of bulleted strings is given and task was to remove
bullets and extra spaces and remove duplicates after converting everything to
lowercase.

Q2- ​https://imgur.com/gallery/AR4xlm4

IIT KGP ​guys, please upload some questions of Bajaj Auto (for Materials Science &
Engineering dept) and Electrical Department also:)

CLOUDERA

IIT (BHU)
29 Oct Test
2 hr duration 5 Questions
Platform: Hackerrank

https://www.geeksforgeeks.org/cloudera-interview-experience/

Exactly same pattern and questions as on gfg

IIT(Delhi)
05-11-2019
Same as IIT BHU
-Histogram question was replaced by prison question in this link

https://www.geeksforgeeks.org/cloudera-inc-interview-experience-software-engineer-in
ternship-full-time-on-campus

Oneplus
Campus:IIT Bombay

Test: Coding(2 questions 1hr)


Shortlisting criteria: Open for all branches and programmes(B.Tech,M.tech,...) No CGPA requirement as such.
Platform : hackerearth(can use Libraries)
Full screen is must(cannot change the tab while attempting exam)
Test case has a time limit of 2 secs.(Brute force not accepted)

Different people get different questions in one plus


https://docs.google.com/forms/d/e/1FAIpQLSdnJLCICMufNc2M3dylYYlv3L57fkxVSE6sAKoGw44Pu7A7pA/vie
wform?usp=sf_link
Solution
Google

IIT Roorkee

Eligibility​: B.Tech.-EE, ECE, Engineerng Physics


IDD-EE, ECE
M.Tech.-EE, ECE, Physics
Profile: Hardware

The selected options may not be correct. I’ll t ry to upload with options as well
Questions
gol

(strawberry 2019 google iitr)(for which profile?)


-For google hardware. Google software not yet updated.
MASTERCARD
IIT BHU
10 quant 10 LRDI 10 English
Quant
1. No of steps visible in elevator. Ans 56
2. No of 4 digit no. possible. Ans 235
3. Rate of interest. Ans 12.5%
4. Hours required by C to fill the tank. Ans 14
5. Probability of rod. Ans ⅔
6. Different possible pair of R & K. Ans. 15
7. No of AP possible. Ans 7
8. Time n work question. Ans 10.5
9. Ratio of 4th term in two APs. Ans 3/2
10. Coins to son and daughters. Ans 63 or 67. Check the constraint on minimum no of coins
Paypal
IITR
1.) Shared Interests (​https://imgur.com/a/qMMllgr​, 2nd question in this)
2.) Max sum path in n- ary tree. Parent array given, value associated with each node given.
3.)

Veritas Questios @ roorkee

Jungle book
https://leetcode.com/problems/coin-change/​ (language change , code same)
20 MCQ

1.

You might also like