Have you copied the question correctly? Those two instructions are mutually contradictory.Jameson Locke wrote:. . . Write a method that returns index i where the condition above is met. If there is no such index the driver is not awarded a break and the method returns null. . . .
Junilu Lacar wrote:
As an evaluator, I would look for programmers with good development habits
Nathan Milota wrote:I have to ask, is this a typical Java interview question? If so, I'm way off from being ready for the first interview, because I don't even know what this question is asking.
Instructions wrote:[1]You are given an array on integers n length n for a driver. [2]The integer at index i symbolizes the time allocated to her or his i'th task in minutes. [3]The optimal time for a break s between two tasks i and i+1, [4]when the sum of all tasks from 0 to i equals the sum i+1 to n .
[5]Write a method that returns index i where the condition above is met. If there is no such index the driver is not awarded a break and the method returns null.
Junilu Lacar wrote:It's a fairly simple problem that I would expect someone applying for even a junior developer position should at least be able to create a working solution for. Otherwise, that person will need more basic training if you decide to bring them on. If you can't even wrap your head around the question then no, you're probably not ready for that first interview.
What part of the problem do you not understand or do you not understand it at all?
By the way, I was giving some training earlier this week at a client and used a variation of this problem as an exercise. Don't feel too bad about not being able to fully comprehend the problem because even the folks I was training had a lot of questions. Feel free to ask about your own doubts.
Liutauras Vilda wrote:
Is it clearer?
Nathan Milota wrote:I just don't really know what is meant by the word driver here. Is it supposed to mean anything specific?
Campbell Ritchie wrote:Yes, I think that would be a working solution; somebody else has already suggested it.
Nathan Milota wrote:
Campbell Ritchie wrote:Yes, I think that would be a working solution; somebody else has already suggested it.
I didn't read it. I was just making sure I understood it myself. The problem wasn't my lack of skills then. It was just not understanding what the problem was asking.
The word driver threw me off, because I was thinking installing drivers on your computer.
Paul Clapham wrote:There's this book I read when I was young, now it's summarized in Wikipedia: How to Solve It.
Junilu Lacar wrote:There are many other books you can refer to for good advice on programming. Don't look to books that focus on teaching you language syntax though. Look at this article for a list books that I recommend: https://www.linkedin.com/pulse/effective-tdd-10-books-get-you-started-junilu-lacar?trk=portfolio_article-card_title
Don't get me started about those stupid light bulbs. |