Intern Interview Questions
- 0of 0 votes
AnswersWhat are virtual constructors and virtual destructors?
- navya910209 September 27, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Intern General Questions and Comments - 0of 0 votes
AnswersIn code there is a breakpoint at the first line of main function. The program is executed but it crashes without touching the breakpoint. Is there any code that is executed before main itself
- navya910209 September 27, 2013 in United States| Report Duplicate | Flag | PURGE
Bloomberg LP Intern General Questions and Comments - 0of 0 votes
AnswersL = { <M> | there is at least one input string on which the Turing machine M does not halt}
- anshul221 September 26, 2013 in United States
Here, for a Turing machine M, the notation <M> denotes an encoding, oversome alphabet, of the code of the Turing machine.to
which of the following language classes does L belong:
(1) Regular.
(2) Context-free but not Regular.
(3) Recursive but not Context-free.
(4) Recursively enumerable but not recursive.
(5) Not recursively enumerable.| Report Duplicate | Flag | PURGE
Adobe Intern Automata - 4of 4 votes
AnswersWe are given a set of integers with repeated occurences of elements. For Example, S={1,2,2}.
- sc.shobhit September 14, 2013 in India
We need to print the power set of S ensuring that the repeated elements of the power set are printed only once.
For the above S, the power set will be {NULL, {1}, {2}, {2}, {1,2}, {1,2}, {2,2}, {1,2,2}}. So, as per the question requirements, we need to print {NULL, {1}, {2}, {1,2}, {2,2}, {1,2,2}}| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm Coding Trees and Graphs - 0of 0 votes
AnswersYou are given an integer K, and a sorted array as an input which has been rotated about an unknown pivot. For example, 4 5 6 7 8 9 1 2 3.
- sc.shobhit September 14, 2013 in United States
We need to write a function which should return the index of K in the array, if K is present, else return -1.| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm - 1of 1 vote
AnswersWrite a function which returns the square root of a given number upto a precision of 0.0001. Only arithematic operations like addition, subtraction, division and multiplication are allowed.
- sc.shobhit September 14, 2013 in India| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm Coding - 0of 0 votes
AnswersRockets are launched until the first successful launching
- anshul221 September 14, 2013 in United States
has taken place.if this does not occur within 5 attempts,the
experiment is halted and the equipment inspected.suppose that
there is a constant probability of 0.8 of having a successful
launching and that successive attempts are independent.Assume
that the cost of the first launching is K dollars while subsequent
launching cost K/3 dollars.whenever a successful launching take place,a certain amount of information
is obtained which may be expressed as financial gain of,say 'C' dollars.if 'T' is the net cost of this
experiment,find the probability distribution of T?| Report Duplicate | Flag | PURGE
Goldman Sachs Intern Probability - 5of 5 votes
AnswersThere are n bombs in a big circle,and each bomb has a value and a 'effect range'.If you detonated a bomb,you will get this bomb's value,but a bomb can have effect on the neighbors which the distance(difference between index) between them is smaller than the 'effect range'.It's say that the neighbor bomb will be destoryed and you could not get their values.
- lxfuhuo September 13, 2013 in CHINA
You will given each bomb's value and the 'effect range',and you need calculate the max value you can get.
eg. n=3 index 0's bomb' v is 2,range is 0(will not effect others).and v[1]=1,r[1]=1,v[2]=3,r[2]=1;
this case's max value is 5.(detonate the 0's and than the 2's).
HELP ME.
ps: It's a interval DP.| Report Duplicate | Flag | PURGE
Google Intern Algorithm - 33of 35 votes
AnswersA k-palindrome is a string which transforms into a palindrome on removing at most k characters.
- sc.shobhit August 28, 2013 in India
Given a string S, and an interger K, print "YES" if S is a k-palindrome; otherwise print "NO".
Constraints:
S has at most 20,000 characters.
0<=k<=30
Sample Test Case#1:
Input - abxa 1
Output - YES
Sample Test Case#2:
Input - abdxa 1
Output - No| Report Duplicate | Flag | PURGE
Facebook Intern Algorithm - -2of 2 votes
AnswersIn the given sorted array, find the number of positions of the number that are not in sorted order
- saran August 24, 2013 in India| Report Duplicate | Flag | PURGE
Chronus Intern Arrays - 21of 39 votes
AnswersGive you an array which has n integers,it has both positive and negative integers.Now you need sort this array in a special way.After that,the negative integers should in the front,and the positive integers should in the back.Also the relative position should not be changed.
- lxfuhuo August 23, 2013 in CHINA
eg. -1 1 3 -2 2 ans: -1 -2 1 3 2.
o(n)time complexity and o(1) space complexity is perfect.| Report Duplicate | Flag | PURGE
Google Intern Algorithm - -1of 1 vote
AnswersDelete the repeated elements in a singly linked list in O(n) time complexity without using extra space. Linked list contains elements in unsorted order
- Saurabh Singhal August 22, 2013 in India
P.S. - Sorting is not allowed| Report Duplicate | Flag | PURGE
VMWare Inc Intern Coding Data Structures Linked Lists - 1of 1 vote
AnswersA user creates a file test.sh on a linux system. He wishes to give another user on the same system the permission to execute that file. What permissions should he give to the file?
- Saurabh Singhal August 22, 2013 in India| Report Duplicate | Flag | PURGE
VMWare Inc Intern Unix - 3of 3 votes
AnswersA standard chess knight (it moves in its standard way i.e. L shaped OR 2.5 moves) is sitting at the position a1 on an N x N chess board. What is the minimum number of moves it will take to reach the diagonally opposite corner?
- Saurabh Singhal August 17, 2013 in India
P.S. - If it were a 8 x 8 chess board, the final destination for the knight would be h8| Report Duplicate | Flag | PURGE
Goldman Sachs Intern Algorithm Coding Data Structures Trees and Graphs - 1of 1 vote
AnswersA young girl counted in the following way on the fingers of her left hand. She started calling the thumb 1, the index finger 2, the middle finger 3, the ring finger 4, the little finger 5, then reversed direction calling the ring finger 6, the middle finger 7, the index finger 8, the thumb 9 then back to the index finger for 10, the middle finger for 11, and so on. She counted up to n (to be input by the user). She ended on her which finger?
- Saurabh Singhal August 17, 2013 in India| Report Duplicate | Flag | PURGE
Goldman Sachs Intern Problem Solving - 1of 1 vote
AnswersGiven a BST convert it into new Data Structure that satisfies following conditions:
- saran August 13, 2013 in India
1. every leaf node's left ptr point to its parent and right ptr points to the next leaf
2. every non leaf node's left ptr points to its parent and right ptr is NULL
3. return the head and print the new DS
example:
7
/ \
5 9
/ \ \
4 6 10
output:
head->4->5->7
|
->6->5->7
|
->10->9-7
with optimal time and space complexity| Report Duplicate | Flag | PURGE
Groupon Intern Trees and Graphs - 0of 0 votes
AnswersGiven an array, return true, if it can be partitioned into two subarrays whose sum of elements are same, else return false
- saran August 13, 2013 in India
Example:
Input: {5,1,5,11}
Output: true (as it can be divided into {5,1,5} {11} where 5+1+5=11)| Report Duplicate | Flag | PURGE
Groupon Intern Arrays - 2of 2 votes
Answersc program to find square root of an interger without using in built functions
- saran August 12, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Intern C - 1of 1 vote
Answerscreate the mirror tree for the given BST, provided with the root node of the tree
- saran August 10, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Trees and Graphs - 0of 0 votes
Answersreverse the doubly linked list without using extra space
- saran August 10, 2013 in United States| Report Duplicate | Flag | PURGE
Amazon Intern Linked Lists - 2of 4 votes
AnswersC program to Delete a node from SLL, in which the last node points to the middle node( in case of even no of nodes, it points to the first middle node) and update the SLL.
- saran August 06, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft Program Manager Intern Linked Lists - 0of 0 votes
AnswersDifference between virtual memory and main memory?
- 3139a1m August 02, 2013 in India
How virtual memory works??| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
AnswersWhat is the difference between a process and a thread?
- 3139a1m August 02, 2013 in India
After this-> why can you run multiple threads but not multiple processes| Report Duplicate | Flag | PURGE
Amazon Intern - 1of 1 vote
AnswersWAP to find the number of 2s between o and n
- 3139a1m August 01, 2013 in India
e.g
Input = 10
Output = 1
Input = 20
Output = 3| Report Duplicate | Flag | PURGE
Amazon Intern - 2of 2 votes
AnswersOutput the leftmost element of each level of a tree
- 3139a1m August 01, 2013 in India| Report Duplicate | Flag | PURGE
Amazon Intern - 0of 0 votes
AnswersDesign a parking meter.
- coder July 29, 2013 in India| Report Duplicate | Flag | PURGE
Microsoft Intern Application / UI Design