Monthly Archives: February 2013

Analytical writing – 6 (Argument)

Discussing religion has always been sentimental. On a quick reflection on past religious gatherings reveals how prone these are to harassment by other communities. The author, hereby, pleads for security for upcoming religious gathering at Hunter Pavilion. At first blush author’s argument seems legitimate, but more analyzation weakens the implications.

In the above argument, author pleads for deploying security personals based on past experiences of religious gatherings, where his gathering was harassed by people who do not agree with his message. However, author does not provide enough details regarding the harassment his community faced. What if, its only his assumption that the people who are harassing the masses in gathering due to religious intolerance? What if, the messages being circulated in the gathering is hurting to many people who are invited? The messages might be demeaning to another community or might even be against the nation. They must reveal the agenda behind the gathering.

The harassment that gathering faces, might also be due to personal enmity. What if, a group of people loath the speaker or chairman of the group and do not hold any grudge against the community as a whole. The author must come up with evidence that proves that gathering is being harassed by people against their message and not on personal basis.

The author must also site examples that might convince that the executed harassment is not planned. What if, the disturbance is pre-planned by a group of people who want downfall of the community. Same people, who create the disturbance, can be caught by Police and further gatherings might become peaceful. This would not require any deployment of security staff. Furthermore, the problem would be uprooted.

Although author has quoted his past experience well, yet he should come up with more examples and evidences to prove his aforementioned argument.

Advertisements

Leave a comment

Filed under GRE Prep

Analytical writing – 5 (Issue)

Many people believe hard-work is the only way to achieve their goals. To accomplish an ardous task it is definitly important to keep on working hard continuosuly. However, alone hard-work would not help in achieving the dreams. Keeping yourself focussed and having a positive thinking cannot be overlooked. Let us take few examples that will eventually prove that we need to maintain a balance between hard work, confidence and optimism.

Taking Sachin Tendulkar, a great Indian cricketer, as the first example. It was shere confidence that made him choose cricket as his career, in a community where parents prefer their children to take up engineering or doctory as their profession. It was optimism, that he will definitly follow his interest and prove himself that he achieved his dream. Finally, it was sixteen years of hard work that took him up in the ladder and made him “master blaster”.

These three mantras of success are not only apt in modern times but also held an important position in past too. How else, could we imagine Alexander the great win plethora amount of battles and ruling the amount of area no one else had ever ruled. It was achievable only when he had a balance of confidence, that he can lead a massive army, optimism, that he can win the whole world and hard work, that was needed to train his army and drive all battle strategies.

Based on the topic, a good example can also be quoted about the story of rabbit and tortoise where rabbit challenges the tortoise for a race but eventually looses the race due to its over-confidence. Rabbit did all hard work and was optimistic too for the race but, in the end, his over confidence led him down. The example reveals how important it is to maintain a balance between hard work, confidence and optimism.

If we go deeper into the subject, let us discuss a case where a person has done enormous hard work but lacks confidence and optimism. Eventually during the day of examination his performance will effect due to nervousness. What if, he has enormous confidence but doesn’t work hard enough to achieve his goal. In no way he can think of achieving it.

So, with all the aforementioned examples we can conclude that not only all three traits but also a balance among all of them is important for achieveing one’s goals.

Leave a comment

Filed under GRE Prep

GsFGs important questions

Recursion:

1. Reverse stack using only push(), pop() and isempty(): http://www.geeksforgeeks.org/reverse-a-stack-using-recursion/

2. Backtracking: Tug of war: http://www.geeksforgeeks.org/tug-of-war/

3. Permutations of a string: http://www.geeksforgeeks.org/write-a-c-program-to-print-all-permutations-of-a-given-string/

Linked Lists:

1. 3 sum problem (from 3 diff linked lists): http://www.geeksforgeeks.org/find-a-triplet-from-three-linked-lists-with-sum-equal-to-a-given-number/

Trees:

1. Find a pair with given sum in BST: http://www.geeksforgeeks.org/find-a-pair-with-given-sum-in-bst/

2. Morris Traversal: http://www.geeksforgeeks.org/morris-traversal-for-preorder/

Explained: http://stackoverflow.com/questions/5502916/explain-morris-inorder-tree-traversal-without-using-stacks-or-recursion

3. BST from preorder: http://www.geeksforgeeks.org/construct-bst-from-given-preorder-traversal-set-2/

4. Boundary traversal Binary Tree: http://www.geeksforgeeks.org/boundary-traversal-of-binary-tree/

5. Parallel inorder search: http://www.geeksforgeeks.org/merge-two-bsts-with-limited-extra-space/

6. Find largest BST in a tree:

a. http://www.geeksforgeeks.org/find-the-largest-subtree-in-a-tree-that-is-also-a-bst/

b. http://leetcode.com/2010/11/largest-binary-search-tree-bst-in_22.html [Prefer]

7.Check if a binary tree is sum tree: http://www.geeksforgeeks.org/check-if-a-given-binary-tree-is-sumtree/

8. Print BST keys in a given range: http://www.geeksforgeeks.org/print-bst-keys-in-the-given-range/

9. Get the level of a node: http://www.geeksforgeeks.org/get-level-of-a-node-in-a-binary-tree/ (Important, also used in printing all nodes at a distance k from root)

10. Sorted order printing of an array: http://www.geeksforgeeks.org/sorted-order-printing-of-an-array-that-represents-a-bst/

11. Root to leaf path sum equal to a given number: http://www.geeksforgeeks.org/root-to-leaf-path-sum-equal-to-a-given-number/ (important to know how to return bool)

12. Level order in spiral (using recursion, complexity is O(n^2)) http://www.geeksforgeeks.org/level-order-traversal-in-spiral-form/

Leave a comment

Filed under Algorithms

Amazon attempts

1st Amazon attempt (Cape Town):

  • Kadane’s Algorithm
  • Implementation of HashTables
  • Difference between new and malloc

2nd Amazon attempt:

Online test questions:

  • LCA
  • Delete duplicate nodes in Linked List

1st telephonic:

  • Generate excel column names (A, B,… , Z, AA, BB,… , ZZ, AAA,…)
  • Find square root of a number without using sqrt()

2nd telephonic:

  •  Print if there exists a path with sum equal to K
    • Print the path
    • Return only True or False

1st onsite:

  • isBST
  • Circular linked list
    • Number of nodes in the loop
    • First node that is circularly linked
  • Rope puzzle

2nd onsite:

  • In a BST find two numbers with sum K
  • Array return index of number from where left and right sum are same

Amazon third attempt:

Onsite written test:

  • Find if a given LinkedList is palindrome or not
  • Given an ‘ascending sorted’ and rotated array find the index of the given number
  • Next largest number in a BST when a node is given

1st onsite:

  • Distance between given two nodes in a binary tree (Upon hearing about LCA, wanted a solution for finding it in O(n) time and O(1) space)
  • Kadane’s Algorithm
  • In an array, delete a number if there exists greater number than it, on its right side

2nd onsite:

  • Delete duplicate elements in a string
    • Do this in O(1) space and O(n^2) time complexities
    • Do this when resulting string can be in any given order (O(n) time and O(1) space)

3rd onsite:

  • Data structure that supports insertion, deletion and searching in O(log n) time
  • Vertical sum in a binary tree
  • In a gven 2 D array with sorted rows, sort the whole matrix

* * * * *

Leave a comment

Filed under Interviews