Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Root797677yOptimization questions.
Data structure questions.
And difficult questions with no great solution.
http://thecodelesscode.com/case/83 -
aritzh7527y@htlr just curious, is it even possible? (Maybe some preprocessor or some character escaping, maybe?)
-
Root797677y@Wack I would move Archer and Horseman abilities to shared modules and include that functionality into the respective Archer/Horseman and Flying Rain subclasses, likely with wrappers to future-proof against divergence.
The choice I made here is to whitelist which classes the Flying Rain can mimic, rather than blacklist from the Soldier superclass. The disjoining of abilities adds some complication as well, and future debt as the complexity grows and the classes diverge. Overall it's a little dirty and makes development more complicated, but the cleanest and easiest to learn/maintain approach I can think of.
Thoughts?
Note: I don't know how this (very Ruby) approach translates to Java. -
@Wack there are many ways to architect that.
I think the point of the article is rather to say that since requirements come from the real world and the real world is already fucked up, it's not possible to design a program modelled on the real world, in a perfect, elegant way.
The point is also that it is the effort that counts, which applies for an interview.
Good story @Root -
Sagi021337yBtw if you don't want any bad surprises, avoid adding: xor prevents overflow.
int a = something;
int b = something_else;
a = a ^ b;
b = a ^ b;
a = a ^ b; -
It's a neat little hack, but that's the problem: it's hacky and shouldn't be used in reality, but on the other hand it's to easy to test problem solving skills.
-
matste6416yBtw, this is a terrible question. It only check if the candidate has read this riddle somewhere.
I once was asked to detect a cycle in a linked list using only constant size memory. This is easy once you know the solution, but you need to remember that humankind needed like 10 years to invent Floyd’s algorithm. -
matste6416yBasic, but not trivial programming exercise for graduates is for a given interface, implement a decorator doing something simple on it. You don’t frame it in the language of the design patterns („decorator”), but rather describe it in your own words. For example, for an interface taking an int and returning an int, your wrapper should return the absolute value of the original result.
You will be surprised, how many people just don’t get the concept of decorator (object oriented programming) or higher order function(functional programming). But this is what programmers do all the time in their jobs.
Related Rants
-
walaboi5Interviewer: What is your native language? Me: Lisp Interviewer: The programming language? Me: Yeth
-
terminalterror57Interviewed a dev for a junior role earlier this week...my first question: const numbers = [0.1, 0.2, 0.3]; ...
-
johnny-cache9I recently interviewed for a job at company where I had 20 minutes to code a solution in python (whose standar...
One of my interview question for fresh graduates was to switch 2 variable values without adding a new variable.
I was expecting something like
a= readline()
b= readline()
a+= b
b= a - b
a-= b
And some kid answered:
a= readline()
b= readline()
print("a=" + b)
print("b=" + a)
I ain't even mad
Can y'all share some good programming questions for interviewing fresh graduates?
rant
interview question