Intern Interview Questions
- 1of 1 vote
AnswersWrite a sql parser to properly parse queries for a particular table. The input will consist of several lines: the first line is of two values, N and M, separated by a comma. The next line has the names of the columns of the table. The next N lines will contain N rows of the table (each column delimited by a comma). After that, the next M lines will contain where clause of sql query which you are supposed to execute and return their output (one in each line).
- holdnet September 17, 2015 in India
Table input will be in the following format:
“ID”,”Name”,”Date” 1,”Narendra Moody”,”2014-10-23 12:21″ . . . 100,”Rahul Pandey”,”2013-11-02 13:01″
Query input will be given in following format: ID > 99 and Name = “Rahul Pandely”
You are supposed to evaluate query and print the number of rows that come under the criteria. For example solution for above query will be 1.
Sample Input (Plaintext Link)
6, 1
“ID”,”Name”,”Date”,”Score”
1,”Aditya Moody”,”2014-10-23 11:55″,20
2,”Utsav Moody”,”2014-10-24 15:18″,21
3,”Jon Doe”,”2014-10-23 02:51″,62
4,”Foo Bar”,”2014-10-23 12:00″,98
5,”Rahul Moody”,”2014-10-23 12:31″,61
6,”Umang JarJar”,”2014-10-23 11:21″,33
Date > “2014-10-23 12:00″
Sample Output (Plaintext Link)
2| Report Duplicate | Flag | PURGE
Intern parsing - 0of 0 votes
AnswersMinimum number of jumps required to climb stairs
- utsav0goyal August 06, 2015 in India
Its basically like, you have 2 parallel staircases and both the staircases have n steps. You start from the bottom and you may move upwards on either of the staircases. Each step on the staircase has a penalty attached to it. You can also move across both the staircases with some other penalty.
I had to find the minimum penalty that will be imposed for reaching the top.
I tried writing a recurrence relation but I couldn't write anything because of so many variables.
I recently read about dynamic programming and I think this question is related to that.
With some googling, I found that this question is the same as
https://www.hackerrank.com/contests/frost-byte-final/challenges/stairway
Can you please give a solution or an approach for this problem ?| Report Duplicate | Flag | PURGE
Microsoft Intern Algorithm - 0of 0 votes
AnswersWhat is sister delegation and how is it implemented ?
- Anand Barnwal June 18, 2015 in India| Report Duplicate | Flag | PURGE
Adobe Intern C++ - 0of 0 votes
AnswersHow to design a LRU cache using heap(priority queue) ?
- Anand Barnwal June 13, 2015 in India| Report Duplicate | Flag | PURGE
Amazon Intern design - 0of 0 votes
AnswersGiven a set of 'n' intervals S = {(starti, endi) | 1<= i <= n}
- Anand Barnwal June 10, 2015 in India
Find a maximum subset of S such that no pair of intervals in S' overlaps ?| Report Duplicate | Flag | PURGE
Microsoft Intern Algorithm - 0of 0 votes
AnswerGiven two strings, how to find the longest common substring ?
- Anand Barnwal June 09, 2015 in India
Can it be implemented using suffix tree ? If then elaborate with an example.| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 0of 0 votes
AnswersIs there a difference between the terms "sibling" and "cousin" of a specified node in a Binary Tree/ Binary Search Tree? If yes, then what?
- rash_coder June 07, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Intern Data Structures - 2of 2 votes
AnswersYou are given a bag with N balls (where the value of N is unknown). Each ball in the bag is uniquely numbered with a value between 1 to N (inclusive) i.e. for each number between 1 and N, there is only one ball with that number. Now you pick a ball from the bag and see its number. You repeat this experiment K times. What is the best possible estimate of the value of N (the number of balls in the bag) you can make from the above experiment (of taking out a ball from the bag K times) in the following cases
- dush.dhyani May 20, 2015 in India
a) With replacement
b) Without replacement.| Report Duplicate | Flag | PURGE
Microsoft Intern Math & Computation - 2of 4 votes
AnswersYou are standing before two doors.One door leads to the heaven and the other leads to Hell but you don't know what hides behind the doors. There are two gatekeepers. You know one of them always tells the truth and the other always lies, but you don't know who is the honest one and who is the liar.
- Anand Barnwal April 30, 2015 in India
You can only ask one question to one of them in order to find the way to heaven. What is the question?| Report Duplicate | Flag | PURGE
Intuit Intern Puzzle - 0of 0 votes
AnswerIs there any limit on the size of array (both static and dynamic) creation in C?
- Anand Barnwal April 16, 2015 in India| Report Duplicate | Flag | PURGE
Intern - 0of 0 votes
AnswersWrite a program that deletes every 5th byte from a file, but without using a temporary file or allocating a buffer in the memory. For adjusting the size of the file you may use the truncate function.
- Anand Barnwal April 07, 2015 in India| Report Duplicate | Flag | PURGE
Morgan Stanley Intern Algorithm - 1of 1 vote
AnswersFind the second most repeating number in an array without using extra storage. (I had given solution using a hash table)
- xyz_coder April 02, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
AnswersImplement a stack that supports push, pop and median (the one from statistics) operation in the most efficient way
- xyz_coder April 02, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Intern - 1of 1 vote
AnswersImplement a stack that supports push, pop and mode(the one from statistics) operation in the most efficient way
- xyz_coder April 02, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
AnswersWORD PROBLEM:
- bradb83 March 27, 2015 in United States
Tara has already spent 6 minutes on the telephone and she expects to spend 9 more minutes with every phone call she routes. In all, how many phone calls does Tara have to route to spend a total of 14400 seconds on the phone?
Print the result.| Report Duplicate | Flag | PURGE
Intern Puzzle - -3of 3 votes
AnswersWhat does Innoplexus ask about in the personal interview round for Technical Summer Interns?
- novicedhunnu March 27, 2015 in India| Report Duplicate | Flag | PURGE
N/A Intern - 2of 2 votes
AnswersYou are given a function: List<TimeSlot> getTimeSlots (String friend)
- h3ssam March 15, 2015 in United States
Assume getTimeSlots() returns available times for a friend, sorted in order, with no overlap.
Assume TimeSlot has comparable function
You want to schedule a meeting among all of your friends, such that all can attend.
Implement a function to get the first 3 common TimeSlots among all your friends:
List<TimeSlot> get3CommonTimeSlots (List<String> friends)
user1 1-2pm, 3-4pm, 7-8pm
user2 1-2pm, 5-6pm| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 2of 2 votes
AnswersYou have a function rand5(). This function returns numbers between 1 and 5 randomly with equal probability. Implement a function rand7() which makes use of rand5 to return a number between 1 and 7 randomly with equal probability.
- reddygokul.i7 February 27, 2015 in India| Report Duplicate | Flag | PURGE
Intern Algorithm Arrays Java Python - 0of 0 votes
AnswersIn a single pass, find Nth node from last in a Linked List.
- Sunny February 24, 2015 in United States for java
{ N can be any value. }| Report Duplicate | Flag | PURGE
Student Intern Algorithm Java - 0of 0 votes
AnswersDescribe in terms of computer architecture, how would you optimize running a search on a large database? Assume a PC with regular specs and database size of several terabytes.
- shane February 09, 2015 in United States| Report Duplicate | Flag | PURGE
Microsoft Intern - -1of 1 vote
AnswersFrom a list of integer intervals, write a function to minimize the number of overlapping or consecutive ones.
- chudir-vai February 08, 2015 in United States
Test Input: [4, 8], [3, 5], [-1 2], [10, 12]
Test ouput: [-1, 8], [10,12]| Report Duplicate | Flag | PURGE
Google Intern Algorithm - 0of 0 votes
AnswersGiven a list of email list, find all email addresses that are in all the email list.
- 00101011 February 04, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 4of 4 votes
AnswersYou are given a set of unique characters and a string.
- francisvm February 04, 2015 in United States
Find the smallest substring of the string containing all the characters in the set.
ex:
Set : [a, b, c]
String : "abbcbcba"
Result: "cba"| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm - 0of 0 votes
AnswersHow would you implement an algorithm for Decision Tree Algorithm - Machine Learning? How would you store records for a feature. Mention all the data structure you would use to make your work easy.
- Rao N January 26, 2015 in United States| Report Duplicate | Flag | PURGE
Amazon Intern - 1of 1 vote
AnswersYou are given an organization hierarchy tree (n-ary tree). Every employee (node) has some value (can be -ve or +ve). You have to host a party and have to invite employees such that the total value (summation of each node value) of all the employees is maximum.
- Rocky January 22, 2015 in United States
there is a rule: no one likes to see their bosses in the party. So you cant invite an employee's immediate boss or subordinate.
You can skip more than 1 level if it gives you maximum value.| Report Duplicate | Flag | PURGE
Bloomberg LP Intern - 0of 0 votes
AnswersYou are given a series like this:
- amusing January 16, 2015 in United States
(1,2)
(2,3)
(5,6)
(2,9)
Every element in this series is a pair(u,v) which means that there is a connection between (u,v).
Output group of elements:
For instance, if you look at the above series, the output will be:
[1,2,9], [5,6]| Report Duplicate | Flag | PURGE
Amazon Intern Algorithm - 1of 1 vote
AnswersYou are given a file which contains 3 values - start time, end time, amount of water flowing between the start time and end time for one day
- arsragavan December 23, 2014 in United States
The start time and end time may overlap and are inclusive. The times are not in a sorted order
Example:
0,10,100
10,15,300
16,20,400
5,15,200
Find the max flow of water at any instant of time.
In the above example, the answer is 600 ( at instant 10)| Report Duplicate | Flag | PURGE
A9 Intern Algorithm - 0of 0 votes
AnswersSuppose you are a stock trader and you can do as many trades but if you stop you can't do another trade. You can start with any trade. Given an array of profits/loss of trades and find the maximum profit you can make.
Input:
Number of trades
Profit/loss in each trade
Output:
Max Profit
Ex:
Input:7 1 2 3 4 -2 -3 1
Output:
10
Explaination: Trade of [1,2,3,4]
Input:5 -2 -3 -4 1 2
Output:
3
P.S: Any solution than Brute-Force.
- mohit December 17, 2014 in India| Report Duplicate | Flag | PURGE
Nagarro Intern - -1of 1 vote
AnswersThere is a code with a runtime error. We add printf to display the value of a variable and we don't get the runtime error anymore. explain what the reason can be.
- maya December 15, 2014 in United States| Report Duplicate | Flag | PURGE
Google Intern Testing