d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Java - Iso Interview Prep/advanced Tutor > Fg Here.. What Is Your Price?
12Next
Add Reply New Topic New Poll
Member
Posts: 1,754
Joined: Feb 27 2009
Gold: 485.00
Feb 26 2015 02:45pm
Hello, I have taken only 2-3 quarters of Java programming. I have learned your basic console interface/scanner/print stuff. I know a bit about object oriented design. I have practiced some collections/traversals/manipulations using: maps, sets, trees, linkedlists, etc but would like some real questions you will likely see in an interview. Looking for someone who is more advanced and can basically grill me technically in preparation for upcoming interviews.

-If you can chat with me via google docs about what SQL servers are, how you would typically implement or use them in a program.
-If you have experience in object oriented design, and insights on sorting algorithms, tricky programming questions etc.
-If you have a general understanding of APIs and how to use them
-Anything else I may be missing

Basically I'm going in this blindly having only taken 2-3 quarters of java and need a CS major preferably with industry experience to help me out for an interview (im not sure what to expect).

Thanks,

This post was edited by SAJ on Feb 26 2015 02:58pm
Member
Posts: 21,211
Joined: May 22 2009
Gold: 9,036.90
Member
Posts: 1,754
Joined: Feb 27 2009
Gold: 485.00
Feb 26 2015 06:38pm
for (int i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 == 0) {
System.out.print(“FizzBuzz”);
} else if (i % 3 == 0) {
System.out.print(“Fizz”);
} else if (i % 5 == 0) {
System.out.print(“Buzz”);
} else {
System.out.print(i);
}
}

Does this work?
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Feb 26 2015 09:09pm
Quote (SAJ @ Feb 26 2015 07:38pm)
for (int i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 == 0) {
System.out.print(“FizzBuzz”);
} else if (i % 3 == 0) {
System.out.print(“Fizz”);
} else if (i % 5 == 0) {
System.out.print(“Buzz”);
} else {
System.out.print(i);
}
}

Does this work?


use code tags

Code
for (int i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 == 0) {
System.out.print(“FizzBuzz”);
} else if (i % 3 == 0) {
System.out.print(“Fizz”);
} else if (i % 5 == 0) {
System.out.print(“Buzz”);
} else {
System.out.print(i);
}
}
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Feb 26 2015 10:29pm
Quote (Minkomonster @ Feb 26 2015 10:21pm)


IS THAT YOU MINKO!?
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Feb 26 2015 10:42pm
Quote (Eep @ Feb 26 2015 11:29pm)
IS THAT YOU MINKO!?


No, but its the inspiration for a lot of the shit I do on this board.
Member
Posts: 17,598
Joined: Mar 13 2009
Gold: 0.00
Apr 15 2015 07:44pm
@ SAJ

No that code did not compile. I received quite a few error messages.
Member
Posts: 22
Joined: Apr 23 2014
Gold: 85.00
Apr 20 2015 06:46am
Quote (SAJ @ 27 Feb 2015 02:38)
for (int i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 == 0) {
System.out.print(“FizzBuzz”);
} else if (i % 3 == 0) {
System.out.print(“Fizz”);
} else if (i % 5 == 0) {
System.out.print(“Buzz”);
} else {
System.out.print(i);
}
}

Does this work?



Yes, that works. Only thing is that the quotes got replaced by "Smart Quotes" somehow.
Member
Posts: 5,167
Joined: Nov 23 2006
Gold: 11.01
Apr 24 2015 01:17pm
Quote (SAJ @ Feb 26 2015 07:38pm)
for (int i = 1; i <= 100; i++) {
if (i % 3 == 0 && i % 5 == 0) {
System.out.print(“FizzBuzz”);
} else if (i % 3 == 0) {
System.out.print(“Fizz”);
} else if (i % 5 == 0) {
System.out.print(“Buzz”);
} else {
System.out.print(i);
}
}

Does this work?


Go above and beyond with this. You need to WOW them into thinking you're smarter than they are even on this simple project.

i % 3 && i % 5 pretty much mean if it's divisible by 3 and divisible by 5 with no remainder then print fizzbuzz

What else could you do in this situation? Instead of using && there is something more simplistic. This goes beyond the realm of straight programming and shows that you're very logical.

i % 3 && i % 5 is the same thing as i % 15.

A number divisible by 3 and 5 means it must be divisible by the least common multiple. Using this and explaining why you chose this over && will give you a little bit of a leg up on the competition who do it the way you just did it.
Go Back To Programming & Development Topic List
12Next
Add Reply New Topic New Poll