Timeline for Union, Intersection and Diff of two sorted arrays in C#
Current License: CC BY-SA 4.0
17 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 25, 2019 at 12:13 | vote | accept | Gilad | ||
Jul 5, 2019 at 19:15 | answer | added | Pieter Witvoet | timeline score: 5 | |
Jul 5, 2019 at 11:18 | comment | added | Gilad | @t3chbot I am not sure there is right or wrong here. Some of the code reviews gave me wonderful insights of things I was not even aware of. Some technical and some sruff like you are looking at the problem from a wrong point of view. I think it is very hard to pin point what can be done in 45 minutes. All the reviews you and many others give me definitely raise the bar. Remember the goal for me is to get better in any type of coding. So please continue to review I learn from each review. | |
Jul 5, 2019 at 10:16 | comment | added | t3chb0t | If one of your primary goals is to write working code within 45 minutes without paying attention to any coventions or clean-code rules, or in other words simply quick-n-dirty, then IMO you only have one question: Can this code be improved in terms of language features? or Can this code be technically done better? - anything else would go beyond what you are trying to achieve here. I think this is your only question in this series, am I right? | |
Jul 4, 2019 at 22:15 | comment | added | Gilad | @t3chb0t I also try to tackle more complex interview questions like so codereview.stackexchange.com/questions/223218/… | |
Jul 4, 2019 at 22:04 | comment | added | Gilad | I have noticed that Google, Amazon, Microsoft, Facebook and Apple and many other companies have very high demands on job interviews. I am trying to get to that level of solving and written good code for those interviews. I already got job offers from some of them and failed some of them. So I keep practicing. I think we do not use stuff like max heap and Trie trees on our day to day job. | |
Jul 4, 2019 at 22:00 | comment | added | Gilad | Now forget everything and take 3 questions put a clock to 45 minutes and solve. | |
Jul 4, 2019 at 22:00 | comment | added | Gilad | @t3chbot thanks for the comment. I have been working for Intel for more than 7 years as a software developer. What you say is absolutely correct. But that has almost no meaning in jobs interviews. So I practice both. At Intel of course my peer code review and design review everything with me. Stuff like S. O. L. I. D principles and design patterns and maintable well written code is a must. | |
Jul 4, 2019 at 19:11 | comment | added | t3chb0t | I see you are practicing various algorithms but writing working code is a no-brainer. Doing it in a way that can be maintained, tested and easily understood, with intuitive API is much much harder and on higher levels this is what counts most. Currently you just write something to solve the task avoiding to implement additional types to encapsulate the logic in proper modules. If you want to improve your skills you should try to write more professional code with proper types, names etc. I would still classify this code as beginner. | |
Jul 4, 2019 at 12:50 | comment | added | Gilad | @AlanT, I am not sure, but I will do one with duplicates, thanks for noticing | |
Jul 4, 2019 at 8:44 | comment | added | AlanT |
It looks like both Union() and Intersection() are the basic implementation of the algorithms which do not handle duplicates (Union of { 1, 2, 2, 2, 3 } and { 2, 3, 4, 5 }) gives {1, 2, 2, 2, 3, 4, 5} not {1, 2, 3, 4, 5} and Intersection of { 2,5,5,6,6} and {4,6,6,8,10} gives {6,6} not {6}) is this intended?
|
|
Jul 4, 2019 at 6:36 | comment | added | Gilad | @dfhwze I started doing it. because for some reason you find it very annoying.. and I appreciate the code reviews. | |
Jul 4, 2019 at 6:34 | comment | added | dfhwze | I get what you mean, but still it would be a very small effort to extract the algorithm to a separate class and call that class in the unit tests. | |
Jul 4, 2019 at 6:26 | comment | added | Gilad | @dfhwze I mean to say that please disregard why it is not separate class for test and for the rest of the code. | |
Jul 4, 2019 at 4:37 | history | edited | dfhwze | CC BY-SA 4.0 |
title + spelling
|
Jul 4, 2019 at 4:33 | comment | added | dfhwze | It is just faster for me like this to get to the point of the exercise. If you code really fast, would you also expect a fast review? | |
Jul 3, 2019 at 21:35 | history | asked | Gilad | CC BY-SA 4.0 |