In a coding/technical interview, your interviewer may ask you to write an algorithm -- for example, one that efficiently can return "longest possible increasing order" from a stream of numbers.
Will it be really bad if I choose to write my own algorithm instead of choosing any pre-defined algorithm? Both I and the interviewer know that a predefined algorithm may give a better result in terms of complexity and efficiency.
If you previously understood some predefined algorithm and use it in the interview you are doing the same thing as you understood before, you are not trying! Maybe it was possible to achieve better complexity if you could follow any predefined algorithm, but it is generalized! it can be possible anywhere, anytime.