1. Right reflection (crack coding interview 1.8)
2. Eliminate all vowels from a string
#3 Should be Gray Code.
You can choose one of C, C++ and Java. Youcan compile and run but only show first two naïve cases of several cases(about 20 in total). Thereis no time consumption metrics shown. I just check each signatured function, some points in details:
If you choose C++, the input string will belike(char* string). All the input and return value will be just a C-stylestring. The instruction shows hint to use strlen(string) to get the length of astring. When I test my code, I found parts of STL works, such as std::string,iterator. However, the std::<algorithm> is not included. I am not sure about other container like <set>. Be careful of theinput name(char* string) if you want to use std::<string>. You may uses.c_str() to return a char*. It seems there is no memory leaks checking in thetest cases.
For C, everything shows almost the same asC++
For the Java, the input is String. Also youcan use methods like indexOf()
The reasoning part: 35mins 24 problems
Prepare a character to number chart. That’suseful for first four problems.
Some number problems, like progression
For the direction problems, be carefulabout the starting point. Also need to know some operations like “About-turn”.
For the recruiting problems, consider theDate and years. I met a DOB problems and not sure whether it is “insufficientdata”.
For factory problems, take care of the global assumptions andlocal assumptions.
Thanks all the farmers!
Good Luck Everyone!