Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!

Tom Joe

Ranch Hand
+ Follow
since Aug 26, 2018
Tom likes ...
IntelliJ IDE Eclipse IDE Java
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tom Joe

I do software test automation/QA and I don't have a CS degree. But, I do have some working knowledge of data structures and algorithms which has been enough for me to do my job thus far. I left my job about 6 months ago to get a break and look for new opportunities.

I took a vacation for about one month and started preparing for interviews after vacation. A large part of my preparation consists of mostly practicing for coding interviews (only started a month ago), taking courses and sometimes building small projects (but nothing spectacular), and also revising concepts related to work. A few months into my preparation, the corona virus pandemic happened. After the pandemic, it appears that there are fewer opportunities for my role.

I have applied to many companies in the past few months. But, I hardly get any interviews or I don't make it to final rounds. In some (not all) interviews my weak point is the data structures & algorithms coding interview. I am working on getting better at that and it takes up most of my time. But, the gap in employment has come up in a few interviews. For all I know, some of my job applications might be rejected mainly because of the gap.

I wonder if I would have been at least considered for more jobs if I did not have a big gap. How do I explain this gap to employers and improve my chances of at least getting interviews ?
2 months ago
@ben luk, i.e the OP of this post.

Could you please post an overview of the problem and your solution ? It is really hard to figure out what you are doing. The more hard you make it for others to understand you, the less likely people will help you or hire you. The main problems I noticed at quick glance - No unit tests for your code, no comments and no overview of the code. Those are big red flags to begin with.
2 months ago
Apparently, they are bad because JOINS are not really set operations, but are actually a cartesian product -
IMO, that might be technically correct. But, to me, the venn diagrams are easier to understand and remember compared to cross product diagrams. I don't know why venn feels easier though. Maybe because venn is the first thing I learned and got used to it, or maybe it is really easy because the diagrams are simple. IMO, what matters is whether something helps you to understand things easily and correctly. Does not matter if it is "technically incorrect".

What do you think ?

After getting a computer programming job, a guys asks "When are we going to get tickets/features for reversing strings, finding palindromes etc. " ?

PS - Many job interviews ask interviewees to solve such programming exercises, even though the job will actually be somewhat "simple" and won't involve developing new data structures or algorithms.
2 months ago

Mike Simmons wrote:Well, probably I would use

Thanks. I have never used that code before. But, I did manage to cobble together some working code from the internet. How does it look ?

I wonder if this code is still verbose due to my mistake, or if Java continues to be a verbose language even with all those new Files, Paths utilities.
3 months ago
Here is some Java code to rename all the files in a directory with sub-directories by replacing dashes in file names with spaces. I cobbled together that code from the internet. The code is not important, but I see that File is actually a general name for "file" and "folder"/"directory". Hence, a File can either have file or folders. This structure reminds me of the Composite iterator pattern which can iterate over tree like structures.

I know that File already has a listFiles() method that returns an array of File-s which can be iterated with a index loop or for each. But I was thinking if we should make a Composite iterator for File. Is this a good idea ? If yes, then I wonder why it is not already provided by Java. I don't want to keep writing recursive functions every time I want to do something with some/all the files in a folder.

3 months ago
Consider the use of the if block like this :

I think the use of not operator in this case just makes the if-condition a *little* bit harder to understand. Most coders are smart enough to understand it easily, but why make them think harder ? Why not put a simpler condition like this :

Does this make sense ? Assume that you have tests which check this if block.

3 months ago
Instructions to use :

Keeps the virus and ladies away.

PS - I don't know what any of that text in the image means. German ?
3 months ago
Updates again :

>>> Updates in other code :

SearchFilterWebPageAsJavaCode :

MainMethod :

Junilu Lacar wrote:
Ok, I think I see what you're trying to do and yes, the semantics are closer to what I would think of as a Command rather than a Predicate/Filter. However, the approach you show is totally backwards from what I would do. To tie this in to the other thread you started about TDD, this would be a perfect example of how TDD and the kind of thinking it develops coulda/woulda led you to a much better solution. If you're up for it, I can show you how I would do it, TDD style.

Thanks, but can we do it next week when you have time ? Right now, I have some stuff coming up which will take most of my time. Actually, I should not even be working on this post now, but I could not resist.

I sort of used TDD here. I wrote what the interface should look like and built the code accordingly. I wonder if it would be better to pick a new problem instead of this one for TDD, since I have a (ok ?) solution and hindsight might mess the TDD approach.

Junilu Lacar wrote:First of all, if you really going to target Selenium, then learn about the Page Object pattern in Selenium. This will save you a lot of time and effort (and pain) if you start using this pattern in your tests.

Yes, I am actually using Page objects in the actual code. I have not shown it in this code so that those who don't know Selenium can still understand the code and help. Plus, we don't get bogged down with selenium and the slow browser runs.
Updates again to previous code.

Main method :

Output :

Support :

Does it help if we replace Procedure with

and then replace mentions of Procedure in the main method with Procedure<SearchFilterWebPageAsJavaCode> ?
Here are the updates to my code. I think a "Procedure" makes more sense here instead of Function, Predicate or such. It is just like a Command with execute method. Maybe we should call it that instead of Procedure.

Procedure :

Main method :

Output :

NOTE - We'd like to have a "set" of filters to reuse in our code. The next step is to make that possible by moving the filter storage logic out of the Page class.
Thanks for the detailed reply Junilu. I think I oversimplified my code example for brevity. I apologize for any confusion this created in understanding the problem. Here is a better representation of how it works. Meanwhile, I am trying to see if and how I could apply predicates to the below code.

Main method :

Output :

Supporting code :

Stephan van Hulst wrote:If Junilu's attempts to teach people TDD on these boards can't be called dedicated, then I don't know what can.

Maybe you mean live, in person coaching?

I did not know that he was dedicated to helping people out with TDD here. Yes, I meant live, but remote coaching (regardless of covid).
3 months ago