↳
Solve by recursively entering lists within lists: void printLevel(List l){ int level = 0; System.out.println(recurse(l, level)); } int recurse(List l, int level){ int sum = 1; for(int i = 0; i < list.length; i++){ if( isInteger(list.get(i))){ int val = list.get(i) * level; sum = sum + val; }else{ // recurse and increment depth level sum = sum + recurse(l.get(i), level+1); } } return sum; } I typed this up fast so will have to go back through and check for errors. Minder
↳
void printLevel(List l){ int level = 1; System.out.println(recurse(l, level)); } int recurse(List l, int level){ int sum = 0; for(int i = 0; i < list.length; i++){ if( isInteger(list.get(i))){ int val = list.get(i) * level; sum = sum + val; }else{ // recurse and increment depth level sum = sum + recurse(l.get(i), level+1); } } return sum; } whoops meant to swap level and sum. Sum should 0 and level should start at 1. Minder
↳
public class SumOfNestedLists { public static int getSum(List list) { int sum = 0; for(Object o : list) { if(o.getClass() == Integer.class) sum += (int)o; else if(o.getClass() == LinkedList.class) sum += getNestedSum(o, 2); } return sum; } private static int getNestedSum(Object o, int level) { if(o.getClass() != LinkedList.class) return -1; List list = (List)o; int tempSum = 0; for(Object io : list) { if(io.getClass() == Integer.class) tempSum += (level*(int)io); else if(io.getClass() == LinkedList.class) tempSum += getNestedSum(io, level+1); } return tempSum; } public static void main(String[] args) { // TODO Auto-generated method stub List l3 = new LinkedList(); l3.add(6); List l2 = new LinkedList(); l2.add(4); l2.add(l3); List l1 = new LinkedList(); l1.add(1); l1.add(l2); System.out.println(SumOfNestedLists.getSum(l1)); List l6 = new LinkedList(); l6.add(1); l6.add(1); List l5 = new LinkedList(); l5.add(l6); l5.add(2); l5.add(l6); System.out.println(SumOfNestedLists.getSum(l5)); } } Minder
↳
I would not feel bad I would just say I do not know the answer to that but if you would give me a few minutes to find out I do not mind checking for you Minder
↳
Depending on the circumstances of the question and if I have been properly trained to handle it or not Minder
↳
I would refer them to a supervisor
↳
Would 25 also be a power number? 5^2
↳
Can y=1?
↳
This is the actual series 4, 8, 9, 25, 27, 32, 36. Here x, y > 1, so the smallest power number will be 2^2 i.e. 4 Minder
↳
Safety, Caring, Integrity Fun, and Passion
↳
Don't even think of interviewing at JetBlue without being able to list these values. They attach a lot of importance. I know several people who were in the midst of interviews at JetBlue that they believed were going really well but were suddenly shut down when they were unable to name these values. Minder
↳
How long did it take for you to get a response from your phone interview?
↳
how long did it take to hear back from the virtual interview? It's been over a week for me ;( Minder
↳
It was probably 3-4 weeks. They were really slow getting back to me
↳
thanks for replying. i guess i still have some hope haha. its been 2.5 weeks!
↳
You split the balls in 3 groups - 3, 3, 2. 1st weigh. On each side of the scale place 3 balls. - If he groups are equal in weight, then w)eigh the 2 balls from the 3rd group => you'll have your answer in 2 steps (2nd weigh) - If the 3-ball groups are not equal in weight, pick the heaviest. 2nd weigh: on each side of the scale place one ball from the previously chosen group of 3. - if the balls are equal, the heaviest is the one that is left -otherwise, the scale will tell you which ball is heavier. Thus, you use the scale only 2 times. This is the minimum number of operations that has to be done. Minder
↳
Split into 3,3,2 say a3,b3,c2 take a3,b3 [1st weigh] Now there are 2 possibilities: 1) if equal then goto c2 and weigh those 2 to know the heavier one [2nd weigh] 2) say a3 is heavier now weigh 2 (say x and y)out of the 3 (say x,y,z)of them [2nd weigh] Now again 2 possibilities -if equal the 3rd left one ie z is the heaviest -if one say x is heavier than y, then that is the heaviest one! HENCE we need to weigh 2 times. Minder
↳
split the 8 balls into 2 groups of 4. weight each group on each side of the scale. Discard the lighter side. Take the heavier group and split into 2 groups of 2. Discard the lighter side. Take the heavier group and split into 2 groups of 1. the heavier side is the heaviest ball. Minder
↳
Could you tell me what is the programming test?
↳
Programming test consisted of implementation of some functions of string.
↳
JUnit is something new that I was not informed as a necessity for the test...
↳
Hashtables, how they work, how I used them in my project.
↳
As a college student, you can organize your answer in 3 parts: 1. academic overview (major, year); 2. professional experience (describe your related experience in 2-3 sentences; if you dont have any, part-time jobs counts as well, but make sure you mention the transferrable skills you use. if you dont have any jobs either, talk about your career goals); 3. extracurricular (preferably leadership experience) Minder
↳
The best answer/s to this interview "question" is to be honest, but only talk about your professional self. However, Gulfstream is a highly family oriented organization, so a small sample of your personal life is acceptable in this case. Minder
↳
"I'm looking to continue pursuing a career in security."
↳
As a former employee, I'm so not surprised by the review of the interview, by the person who felt he was low balled. That he received no replies to his follow up attempts to his interviewers. When it comes to money, Top Guard is not about anything but a profit for the company. For the owners. The word " raise" is not in their vocabulary. Don't look for or expect one.If you've got work experience, not looking for a huge pay checks working just 40 hrs, know how to play the game by coming to work when scheduled& on time, stay outta the office, do the job? You'll make it at Top Guard. Minder