0
$\begingroup$

A colleague of mine recently interviewed for a software engineering job, and he was given a problem regarding unique identifier creation and testing for validation.

So, the problem is: if a generated unique-identifier, let's say an order id provided online by an ecommerce site, is provided to a customer, and when the customer attempts to lookup the order, they have inadvertently transposed two characters, how to quickly test that the id is invalid, and how to create an id such that the transposition of two characters does not represent another valid id.

I want to know what class of problem is this (not in the complexity sense but categorically) and what are general methods that attempt to solve it. Looking for variations on the theme of unique identifier and invalidation on google has not produced interesting results. I am hoping someone here might lead me in the right direction to learn more about this kind of problem.

I hope I have found the right forum for posing the question, and apologies if I have not.

$\endgroup$
2
  • $\begingroup$ What are the goals or requirements? Are you trying to minimize the length of the identifier? Can you store a list of all valid identifiers in a database on the site? There are many possible solutions; can you provide any evaluation criteria to help narrow this down? What have you considered? Have you looked at various checksum mechanisms and schemes for introducing check digits? Are you familiar with error-correcting codes? $\endgroup$
    – D.W.
    May 10, 2014 at 1:30
  • $\begingroup$ There are no explicit goals or requirements, I was more interested in gathering some search terms and keywords that cover this general kind of problem. As described in the original post it was posed as an interview question and thus was as open ended as is presented. Essentially, if I wanted to answer this question for real, what would I have to know about. $\endgroup$ May 13, 2014 at 22:26

1 Answer 1

0
$\begingroup$

Looks like some Data integrity check stuff. For example adding something like CRC16 (4hex digits) will allow filter ID with typos

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.