I recently got interviewed at a company for a new grad SDE position where I was asked to develop an algorithm that will generate unique numbers for strings. I was confused on how should I do that. How should I approach this question?
-
-
Answer:
SHA-512 for example, not strictly unique though. Better yet, suppose that base of the system is |Alphabet|+1, now calculate number based on string, numeric representation of a string. For example, abb and alphabet a-z, |alphabet| = 26 => base = 27. abb = 1 + 2 * 27 + 2 * 27 * 27 => here is your number.
Roman Dzhabarov at Quora Visit the source
Related Q & A:
- How to talk to a company as a prospective contractor vs. employee?Best solution by Freelancing
- How do I create a new Yahoo screen name if I already have one?Best solution by Yahoo! Answers
- How do you find out if a company is a legal business entity in Spain?Best solution by Yahoo! Answers
- How do I sell my design to a company?Best solution by Yahoo! Answers
- What is the best way to negotiate a salary for a new position?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.