Computer Scientist Interview Questions
- 1of 1 vote
AnswersYou are driving a bus along a highway, full of rowdy, hyper, thirsty students and a soda fountain machine. Each minute that a student is on your bus, that student drinks one ounce of soda. Your goal is to drop the students off quickly, so that the total amount of soda consumed by all students is as small as possible.You know how many students will get off of the bus at each exit. Your bus begins somewhere along the highway (probably not at either end) and moves at a constant speed of 37.4 miles per hour. You must drive the bus along the highway; however, you may drive forward to one exit then backward to an exit in the opposite direction, switching as often as you like. (You can stop the bus, drop off students, and turn around instantaneously.)Describe an efficient algorithm to drop the students off so that they drink as little soda as possible. Your input consists of the bus route (a list of the exits, together with the travel time between successive exits), the number of students you will drop off at each exit, and the current location of your bus (which you may assume is an exit). How would you approach this problem
- DaveCS September 25, 2020 in United States| Report Duplicate | Flag | PURGE
Computer Scientist - 0of 0 votes
AnswersExamples:
- kamal suthar August 26, 2020 in India
(((abc))) --> abc
(ab(c)) --> ab(c)
(abc09%(c)) --> abc09%(c)
ab(c) --> ab(c)
(ab)c --> (ab)c
abc(c)) → INVALID
(abc)(def) --> (abc)(def)
(abc)typ(def) --> (abc)typ(def)
((abc)(def)) --> (abc)(def)| Report Duplicate | Flag | PURGE
Amazon Computer Scientist Algorithm - 0of 0 votes
AnswerDesign a hit counter which counts the number of hits received in the past 5 minutes.
- Nits April 08, 2019 in India| Report Duplicate | Flag | PURGE
Adobe Computer Scientist - 0of 0 votes
AnswerYou have been given a string and a number. You need to find the longest common suffix between string and substring(0 to number)
- sandeepmnit35 July 10, 2018 in United States
Example : String = "ababa"
Number is 3
Take a substring from 0 to 2 which is aba
now find the longest matching suffix between "ababa" and "aba"| Report Duplicate | Flag | PURGE
Computer Scientist Algorithm - 0of 0 votes
AnswersThere are some professors, some courses, and some students.
- neer.1304 August 30, 2017 in United States
Each professor can teach only a single course.
Each course has a fixed duration(Eg. 10 weeks).
For each professor, you are given time availability schedule(assume week wise).
Each student has a list of courses he wants to learn.
There can be only 1:1 classes, i.e., 1 professor can teach only a single student.
A student can attend only one course at a time.
A professor has to finish teaching a course in a one go.
Your aim is to prepare a schedule so that all courses are taught in the least time.| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 0of 0 votes
AnswersGiven a stream of numbers which contains n numbers, each number is positioned at max k positions away from its actual position. Sort the array in the most optimized way.
- neer.1304 August 30, 2017 in United States| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - -2of 2 votes
AnswersGet Online Yahoo Technical support number 1800 – 360 – 519: Yahoo is one of the prime assets to open any website very smoothly. Due to some technical difficulty, some person has to face cracking issue and fixing this issue is not under the control of other person. So, it is advised that you should have to end your query at our third party technical support team destination because we have perfect knowledge to chase the problem in the correct manner. Our professional will help to you as you dial Yahoo Technical support number speak out all problems at our toll free number. To know more information: http://www.customercarenumber.co.nz/yahoo-customer-care-number
- johnsheena717 March 30, 2017 in United States for Technical Support| Report Duplicate | Flag | PURGE
Internet Question Computer Scientist Call Yahoo Customer Support Number in Newzealand - 0of 0 votes
AnswerYou have a cycled doubly linked list (meaning there is a cycle and each node has prev() and next() method).
- Patrick February 21, 2017 in United States
You can set/check the value of each node in the list to be 0/1 (method setValue(0/1) getValue())
Find how many elements there are in the list.
You start from the some node and you don’t know the status of the nodes value, could be any combination of 1’s and 0’s)..| Report Duplicate | Flag | PURGE
AMD Computer Scientist 24x7 Google chrome technical support number 1-888-201-2039 - 0of 0 votes
AnswersFind out the number of ways in which two queens can be placed in a 8*8 chessboard.
- AlgoBaba November 26, 2016 in United States| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 0of 0 votes
AnswerFind the possible (x,y) coordinates in a given 2-D chess board which are safe from the attack of a queen.
- AlgoBaba November 26, 2016 in United States| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - -1of 1 vote
AnswersConsider a string, s = "abc". An alphabetically-ordered sequence of substrings of s would be {"a", "ab", "abc", "b", "bc", "c"}. If we reduce this sequence to only those substrings that start with a vowel and end with a consonant, we're left with {"ab", "abc"}. The alphabetically first element in this reduced list is "ab", and the alphabetically last element is "abc". As a reminder:
- guptasunny158 June 12, 2016 in India
Vowels: a, e, i, o, and u.
Consonants: b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, and z.
Complete the findSubstrings function in your editor. It has 1 parameter: a string, s, consisting of lowercase English letters (a − z). The function must find the substrings of s that start with a vowel and end with a consonant, then print the alphabetically first and alphabetically last of these substrings.
Input Format
The locked stub code in your editor reads a single string, s, from stdin and passes it to your function.
Constraints
3 ≤ length of s ≤ 5 × 105
Output Format
Your function must print two lines of output denoting the alphabetically first and last substrings of s that start with a vowel and end with a consonant. Print the alphabetically first qualifying substring on the first line, and the alphabetically last qualifying substring on the second line.
Sample Input 1
aba
Sample Output 1
ab
ab
Explanation 1
"ab" is the only possible substring which starts with a vowel (a) and ends with a consonant (b). Because we only have 1 qualifying substring, "ab" is both the alphabetically first and last qualifying substring and we print it as our first and second lines of output.
Sample Input 2
aab
Sample Output 2
aab
ab
Explanation 2
There are 2 possible substrings which start with a vowel and end with a consonant: "aab" and "ab". When ordered alphabetically, "aab" comes before "ab". This means that we print "aab" (the alphabetically first qualifying substring) as our first line of output, and we print "ab" (the alphabetically last qualifying substring) as our second line of output.
Sample Input 3
rejhiuecumovsutyrulqaeuouiecodjlmjeaummaoqkexylwaaopnfvlbiiiidyckzfhe
Sample Output 3
aaop
utyrulqaeuouiecodjlmjeaummaoqkexylwaaopnfvlbiiiidyckzfh
Explanation 3
There are 4830 substrings of s, but only 676 of them start with a vowel and end with a consonant. When ordered alphabetically, the first substring is "aaop" and the last substring is "utyrulqaeuouiecodjlmjeaummaoqkexylwaaopnfvlbiiiidyckzfh".| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 1of 1 vote
AnswersGiven a binary tree, whose leaf nodes are connected,
- guptasunny158 May 24, 2016 in India
1
/ \
2 3
/ \ /
4 5 6
Now 4,5,6 are leaf nodes in the above BT, 4->5->6
4's left is pointing to 6 and 6's right is pointing to 4. We have a circular DLL of leaf nodes.
We need to find the height of this tree?| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 0of 0 votes
AnswersU have given a undirected weighted graph. U have to create Spanning tree (not MST). The Property is the difference between the min and max edge weight of Spanning edges should be min.
- yogi May 15, 2016 in India| Report Duplicate | Flag | PURGE
Intel Computer Scientist Algorithm - -1of 1 vote
AnswersInput: set of coordinates = [P1,P2,...,Pi,.....Pj,....Pn]
- prince May 13, 2016 in India
P denote Point(x,y)
Start point is any of set of coordinates like Pi
simily end point is also any of set of coordinates like Pj.
Find the shortest path with set of points between start and end points.
Let us have a simple example
Set of coordinates :
P4 P5 P6
P1 P2 P3 P7 P8 P9 P11 P12 P13
P10
Start Point: P2
End Points: p12
Output: P2,P3, P7,P8,P9,P11,P12| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 0of 0 votes
AnswersGiven a number (200), compare it to four variables (E.G A,B,C,D) and return true if they are all equal to the given number.
- J@sper January 09, 2016 in United States
Do this in the most efficient way, and if possible without if statements.| Report Duplicate | Flag | PURGE
Amazon Computer Scientist C - 2of 2 votes
AnswersGiven an array of positive integers(>0) , you have to insert '+','*','(',')' signs basically plus multiply and brackets such that value of resultant expression becomes maximum.
- smarthbehl August 25, 2015 in United States
Hint: Consider case of continuous ones
You have to print the resulting expression| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 0of 0 votes
AnswerGiven N natural numbers A1, A2, A3 . . . AN, you have process Q queries of following two types:
- sunilkanaujia.manit August 14, 2015 in India
1 i j: Perform the operation Ai = j.
2 L R: Print the LCM of the elements AL, AL+1, AL+2 . . . AR.
Here LCM stands for lowest common multiple. Please help Shil to open the lock.
Input
First line will contain integer N.
Second line will contain N natural numbers denoting array A.
Third line will contain number of queries Q.
Then next Q lines will contain either query of Type 1 or 2.
Output
For each query of Type 2 output the required answer. Since LCM can be very large output it modulus 109+7.| Report Duplicate | Flag | PURGE
Akamai Computer Scientist - 3of 3 votes
AnswersGiven an array A with n integers.
- smarthbehl August 01, 2015 in United States
Rearrange array such that
A[0]<=A[1]>=A[2]<=A[3]>=A[4]<=A[5] and so on
Edit: Array is not sorted
You have to do it in linear time O(N)| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 1of 1 vote
AnswersThere is a tournament among n teams. and we have a function which takes two team and tells which team is the winner (suppose function takes constant time),then print the result sequence array. There may be number of result sequences so print anyone.Result sequence array will contain the teams in the following manner :
- kri1311 May 22, 2015 in India
Team1 has won against team 3 , team 3 has won against team 4,team 4 has won against team 2.
and ofcourse output sequence must contain all the teams and no team should get repeated.
E.g. there are 3 teams.
T1, T2, T3
match (T1,T2) = T1
match(T2,T3) = T3
match (T1,T3)= T1
Output Sequence = T1 -> T3- > T2| Report Duplicate | Flag | PURGE
Adobe Computer Scientist - 0of 0 votes
AnswersThe task have two goals:
- sen.deba May 07, 2015 in India
1. A method to estimate the noise level of bio-medical signals.
2. Quality quantification of detection algorithms.
In particular you will be focused on heart rate measurement signals and detection algorithms.
Both of these involves a research about the biological aspects of the signal sources, noise sources, digital processing and mathematical/physical model of these.| Report Duplicate | Flag | PURGE
GE (General Electric) Computer Scientist - 0of 0 votes
AnswersImplement recursion function " wildmatch" that matches the string to the pattern, where the symbol ? may represent any symbol and symbol* may represent any string f.e
- emcho.coh April 15, 2015 in United States
wildmatch (agcbc, a*ba)=1
P.S. I not understood this question , do you have any ideas how to solve it?| Report Duplicate | Flag | PURGE
Adobe Computer Scientist - 0of 0 votes
Answershow to design a relation functionality. similar to facebook , how to hold friends objects for a user profile , so that that is easily searchable . how to use cache for this?
- gopi.komanduri December 30, 2014 in India| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm Coding Data Structures - 0of 0 votes
AnswersHow to classify 3 classes using each MICD and MED classifiers using Matlab ?
- Eng.joumana December 02, 2014 in United States| Report Duplicate | Flag | PURGE
Computer Scientist Matlab - 0of 0 votes
Answersyou have numbers between 1 to n. a set of number i.e. (4,5) means that person number 4 is connected to person number 5. find all the ways the a group of n pepole can be connected. i.e. for 0 and 1 there is the empty set, for 2 there is 2 ways, empty set and {1,2} only for 3 there are 4 ways: {}, {(1,2)} {(2,3)}, {(3,1)} for 4 there are 10 ways ({},{(1,2)}, {(1,2),(3,4)},.......
- Patrick November 28, 2014 in United States
you can do it by factorial and cobination but there is another way that state that:
T(n)=T(n-1) + (n-1)*T(n-2)
(while T(n) is the function that computes the number of ways..
Can someone explain why this equation is true?| Report Duplicate | Flag | PURGE
Abs india pvt. ltd. Computer Scientist Algorithm - 0of 0 votes
Answersyou have a numbers between 1 to n. a set of number i.e. (4,5) means that person number 4 is connected to person number 5. find all the ways the a group of n pepole can be connected. i.e. for 0 and 1 there is the empty set, for 2 there is 2 ways, empty set and {1,2} only for 3 there are 4 ways: {}, {(1,2)} {(2,3)}, {(3,1)}
- Patrick November 28, 2014 in United States
for 4 there are 10 ways ({},{(1,2)}, {(1,2),(3,4)},.......
you can do it by factorial and cobination but there is another way that state that:
T(n)=T(n-1) + (n-1)*T(n-2)
(while T(n) is the function that computes the number of ways..
can someone explain why this equation is true?
Thanks...| Report Duplicate | Flag | PURGE
abc Computer Scientist Algorithm - 0of 0 votes
AnswerHow does map-reduce work? Explain with diagram.
- anisha@uci.edu November 01, 2014 in United States for Big Data| Report Duplicate | Flag | PURGE
Adobe Computer Scientist - 0of 0 votes
AnswersDifference Between Call by Value and Call by Ref.
- anisha@uci.edu November 01, 2014 in United States for Big Data| Report Duplicate | Flag | PURGE
Adobe Computer Scientist - 0of 0 votes
Answerwhat is virtual function?
- anisha@uci.edu November 01, 2014 in United States for Big Data
Give an example scenario of use.| Report Duplicate | Flag | PURGE
Adobe Computer Scientist - 1of 1 vote
AnswerDesign & Implement your own Json parser. It should handle all cases. And it should also JUnit testable.
- varunGE October 16, 2014 in India| Report Duplicate | Flag | PURGE
Adobe Computer Scientist Algorithm - 0of 0 votes
Answers1st Face to face
- mathura September 30, 2014 in India
--------------------
Find if any string has repetitions or not.
Ababababab - true
Abcabcabcx - false
Abcdabce - false
Abaaabaaabaa - true
Virtual functions?
2nd facte to face
----------------------
Create a strategy for testing flipkart.com (any e-com site)
Suppose it is under development.
- I started with UI testing but he said that UI is developed in end
- What all positive scenarios to be tested? Negative scenarios to be tested?
- How you will ensure integration
What all type of testing should be done?
Explain observer design pattern.
Write a code in which the client registers some method on Registrar and the registrar calls that method in case some event happens.
- I created a hash table for events and function pointers but he was more worried about my testing knowledge.| Report Duplicate | Flag | PURGE
Trilogy Computer Scientist Algorithm