abcd_win
BAN USER- 0of 0 votes
AnswersFind all the calendar events which are overlapping.
- abcd_win in India
Suppose there is event A: 10-15 Oct, B : 12-14 Oct , C:15-24 Oct, D: 23-34 Oct, E: 4-5 Oct
All events except E should be marked as overlapping as they overlap with some other event.| Report Duplicate | Flag | PURGE
Toppr Software Engineer / Developer Algorithm - 0of 0 votes
AnswersFind all the calender events which are overlapping.
- abcd_win in India
Suppose there is event A: 10-15 Oct, B : 12-14 Oct , C:15-24 Oct, D: 23-34 Oct, E: 4-5 Oct
All events except E should be marked as overlapping as they overlap with some other event.| Report Duplicate | Flag | PURGE
Toppr Software Engineer / Developer Algorithm - 1of 1 vote
AnswersWe are given a pre order traversal of a tree, contruct back the tree using that pre order Array.
- abcd_win in United States| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test - 0of 0 votes
AnswersBitwise operator.
- abcd_win in United States
Add/Multiply two numbers using bit operation.| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test - 0of 0 votes
AnswersProgram to write merge sort and explain the complexity.
- abcd_win in United States| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test - 0of 0 votes
AnswersCheck whether the no. is multiple of 7 or not in best possible way.
- abcd_win in United States| Report Duplicate | Flag | PURGE
Expedia Software Engineer in Test
Obviously things could be must easlier if you do this using iteration, but sometimes interviewer doesn't want easy solution, they want to test your skills, and believe me if it not that easy using recursion.
Requires some time of yours and it is when interviewer check your approach to some triky problems. And that is the whole idea of taking interviews. :)
First solution is to create a hash table of Integer size. 0- 2pow 32 and initialize it by 0, whenever you get any no. check the value at that position, if it is 0, it is only the first time we have encountered that no. increment it and proceed.
This would have the Time Complexity as O(1) but has space contraints.
Implement a better way to make it Space efficient as well.
Take two arrays a[2] and b[3]
Traverse the list and check for each element if it is >0 then call Max(b) else Min(a), these functions would internally check for elements in the array and sorts them in the array.
finally when all the processing is done, just multiply max element of b with all the elements of a and all the elements of b, whichever is greater is the solution. :)
Ohh... I missed this.
- abcd_win September 28, 2012I mean you would be fed an stream of numbers(which goes in million) and with every no. you get you have to print if the no. is actually a duplicate.
Sorry My Bad.