Myntra.com Interview Report
- 1of 1 vote
AnswersQ: How would you print 1000 factorial(1000!). The hint he gave was 70! = 1.19785717 × 10 **100 which does not fit in any data type.
- sriniatiisc February 04, 2012 in India
A: Given that we just have to compute the factorial and print the value, loop over from 1000 to 1 and keep on accumulating the product. But pretty soon, the intermediate product wont fit in any data type and data truncation happens.
The trick is to represent the intermediate product as linked lists and then keep multiplying the numbers in a loop from 1000 to 1
Lets say the intermediate product you obtained is 125 and you want to multiply with 3. Represent the product as
5->2->1
And multiply the product with 3.
He agreed to this answer. He did not ask me to code this.| Report Duplicate | Flag | PURGE
Myntra.com Software Engineer / Developer Data Structures - 0of 0 votes
AnswersQ: Given a collection of records which have fields like first name, last name, describe how would you store them in a hash table. Each object passed is to be stored in the hash table and the key has to be returned for subsequent retrieval.
- sriniatiisc February 04, 2012 in India
A: Explained about how hash tables work, hash function, what should be the table size (prime number), organization of the hash tables(whether each location in the table stores set of values or single value), from there moved on to collision, collision resolution techniques like open addressing, linear chaining etc.| Report Duplicate | Flag | PURGE
Myntra.com Software Engineer / Developer Hash Table - 0of 0 votes
AnswersQ:Given an input array of unsorted elements, sort the array using binary search technique.
- sriniatiisc February 04, 2012 in India
A: Build a bst out of the unsorted array by looping over the array and inserting each element to the tree.
Once you have the bst do inorder traversal.| Report Duplicate | Flag | PURGE
Myntra.com Software Engineer / Developer Arrays