# Logic problem for HR recruiting at a big software company

## 4 posts in this topic

Posted (edited) · Report post

Find xxxxx from :

6 → 1; 32 → 01; 53 → 00; 172 → 101; 276 → 101; 314793 → 110011; 52735 → xxxxx

Unfortunatelly i do not know the correct answer ; it's obvious is something from "0" and "1" .

Edited by catcher_silviu
0

##### Share on other sites

Posted · Report post

first we analyze the cases:

a) 6 → 1;
b) 32 → 01;
c) 53 → 00;
d) 172 → 101;
e) 276 → 101;
f) 314793 → 110011;
g) 52735 → xxxxx

encodings are below and reference the case(s) above which encodes the digit
digit 1 -> 1 (d)
digit 2 -> 1, 1, 1 (b,d,e)
digit 3 -> 0, 0, 1+1* (b,c,f*)
digit 4 -> 0 (f)
digit 6 -> 1, 1 (a,e)
digit 7 -> 0, 0, 0 (d,e,f)
digit 8 -> none
digit 9 -> 1 (f)

*Only 3 has a strange encoding
3 occurs twice in the number
3 is the first and last digit of the number

So using the basic encoding for each digit:

digit 2 -> 1, 1, 1 (b,d,e)
digit 7 -> 0, 0, 0 (d,e,f)
digit 3 -> 0, 0, 1+1* (b,c,f*)

52735 -> 01000

But then 5 may have to be "flipped" like 3 was in f) because
5 occurs twice in the number
5 is the first and last digit of the number

So:
52735 -> 11001
0

##### Share on other sites

Posted · Report post

Are you sure the conversion for the 6 digit number is correct?

For the reasoning that I find compatible for all the numbers (except this one), it should be 100011

The last digit is 1 if it is even or if there is an even occurrence of an odd number; otherwise 0.

The next digits to the left are 0 if the digit to the immediate right is smaller and 1 if it is larger. This logic gets inverted if the last digit is odd and occurs even number of times (the 6 digit number case)
0

##### Share on other sites

Posted · Report post

Thank you !

mrgabe

It seems to be the correct answer

0

## Create an account

Register a new account