@Mast In real life you often get poor specifications — you'd much rather have one that was long-winded and badly written (but correct) than one that was terse but ambiguous
I was asked to do a technical test with the following specification, but my solution was rejected and I was not selected for the available position (Junior to "normal" level, with 4 days of time to finish the test). Could you point out which areas need improvement in my solution?
In software ...
Last Friday I was hit with a sorting interview question that I never really had to deal with.
Develop a your own sorting algorithm.
It cannot use any other Classes for help.
It needs to be able to sort an array of millions of integers in size.
It needs to be as fast as possibl...
After learning a bit about tail recursion, this is what I came up with.
let factorial n =
let rec loop num mul =
if mul - 1I = 0I then num
else loop (num * (mul - 1I)) (mul - 1I)
loop n n
Is there a way to improve this?
@skiwi There are several subtleties, for example handling engineers who change status while in the queue, or recognizing that the exponential distribution is needed
Imagine you have a method builder-like chain like a(1).b(2).c(3), how can you make sure that the chain actually is terminated? (or do something if it is not) What if only a(1) is called, but it's .c(3) that actually does something?
@skiwi That's not the point. The point is the specification is always wrong. The hard part is fixing the specification to match what the customer wants.
I'm currently working on a Python assignment and having trouble getting my function to work correctly.
The assignment is to write a Python 3 program that reads a text file or web page named by the user, and prints a neat table showing the counts of all of the different characters it reads with ...
@skiwi It's not really a matter of the client having opinions and changing them. Typically the client has a business problem that they want to solve, and hasn't really thought it through about how the software is going to solve that problem.
@GarethRees Perhaps I'm just used to the Agile way (as I'm doing a big project on university right now that uses it), but how can such situation ever work if the programmers don't even know what they are actually implementing?
@skiwi Yes, if you're modelling time in unit steps, then that would be the way to implement it. But my simulation doesn't work in unit steps
@skiwi Typically the client asks for software X. Some work goes into preparing a specification and implementing it. You deliver X and discover that this wasn't want the client needed.
The reason this happens is that designing software is hard and there is no reason to expect the client to be any good at it
I mean if the client would fully write the specification, then there's less reason to belief it's correct as it is now, but even now it is not correct enough
How does it relate to the interview questions though? I find their specifications to be solid
Given this context a simulator is probably some system you can start/stop/reset and advance by x time units, and supply input data to and read current data out of
I took it to mean computer simulation in the sense of the Wikipedia article — something that you could use to model, investigate and predict the behaviour of the system
Does anyone have a good book about use strict by the way? I'm trying to prevent callback-hell and I got a feeling strict has it's own way of solving that problem.
I wrote a PHP connector that will allow me to communicate with a REST API.
The class was little over 1500 lines of code and it was hard to manage it. It was a nightmare to even look at it as you can probably imaging. My intention was to to make be better where I can later share it on GitHub and...
I have implemented a couple of functions in python as part of an online course. Although the functions seem to work fine I feel that the code is inefficient with a lot of nested loops. Are there any improvements I can make? I am new to the language so any advice is welcome.
Here is the code and ...