## Forum Posts

- 0 Answers
**Greedy & dynamic approach**I was recently asked this question in aptitute test:

- pratz2961 March 24, 2016

Write a code to maximize the given expresion having +,- using greedy approach in O(n) and dynamic approach in O(n3).

For dynamic approach i thought we can make use of matrix chain multiplication.

I would like to know if any one has a better approach or code to solve this.| Flag | PURGE - 0 Answers
**I want to run a function that does that automatically for me until the condition is complete (condition is some update statement)**if i have 2000 records and exit when condition should be counter<500;

- sona4144 February 11, 2016

so if i have 2000 records so counter will be 2000/500 =4

loop will execute for 4 times

update statement should consist of

update tablename set counter=1 where rownum<500

this process continues until the update condition is met| Flag | PURGE - 0 Answers
**Maximum number in array after M operations**Given an array numbered from 1 to N, you need to perform M operations. Each operation is described by 3 values a, b and k. Now, k is added for the range of values starting from index 'a' and ending at index 'b' in the given array. Now, After M operations, you have to calculate the maximum of the values in the array.

- apurohit.in January 19, 2016

Initialize the array to '0' before starting to perform M operations.

Consider the number of elements (N) = 5

Number of operations to perform (M) = 4

When M=1,

a=1, b=2, k=100

When M=2,

a=2, b=5, k=100

When M=3,

a=3, b=4, k=100

Initially the array is 0 0 0 0 0

First operation 100 100 0 0 0

Second operation 100 200 100 100 100

Third operation 100 200 200 200 100

ANS 200| Flag | PURGE - 0 Answers
**What can I expect on AWS Cloud Support Associate phone interview?**Hi Everyone.

- qin.wenfng January 15, 2016

I got a one hour technical phone screen (w/ hiring manager) scheduled for Cloud Support Associate position (for AWS support team) at Amazon. I’ve pasted the excerpt from the recruiter’s email:

Basic qualifications

· Monitoring and/or Troubleshooting of:

o OS Administration (Windows or Linux)

o Network Essentials (TCP/IP)

· Knowledge of Internet Fundamentals

Preferred qualifications

· Knowledge of Cloud Computing concepts

· Experience with AWS

· Experience in a service desk or network operations environment

· Experience with scripting / programing

· Experience with database administration

Do we have anyone who has already taken this interview?

What questions can I expect?

Any advice is greatly appreciated.

-Qin| Flag | PURGE - 0 Answers
**Design ticket reservation system in Java**- Basically would like to understand the design for ticket reservation system, for ex : movie tickets

- jaava4me January 03, 2016

- What are the different ways that we can avoid if multiple users trying to book the same ticket.

- What java collections can be used for the above usecase.

Consider the below usecase

- User A logged into the system at 10:00 AM

- User B also logged into the system at 10:00 AM

- Only one ticket is available

- Which java collection to use so that only one user gets the ticket.

- Is it required to use synchronization, without synchronization can't we achieve this by using only java collections.| Flag | PURGE - 0 Answers
**INTERVIEW AT MICROSOFT!?!**Hey guys,

- qiangyuzeng December 29, 2015

I had a 30 minute phone screen interview with Microsoft on 12/15/2015, the week before Winter break. It was a Tuesday. I still haven't heard back from the recruiter, although I have sent a follow up email.

Do you think they have not responded yet simply because it is the holidays? They were interviewing all the way to 12/18/2015.

Thanks

Michael| Flag | PURGE - 0 Answers
**Cloud Support Engineer Interview : Amazon Web Services**Hi,

- learner December 25, 2015

I am having an interview coming soon for "Cloud Support Engineer Interview" with Amazon Web Services. I am having background working with Big Data technology stack like Hadoop and its ecosystem. I am not having hands on with networking or linux administrative side.

Has anyone recently given interview for the same or similar position with Amazon. What kind of question do they generally ask over phone. Any feedback or guidance will be appreciated.

Thanks in advance| Flag | PURGE - 6 Answers
**How to Solve This Type of Problem..**There is a room where boxes are stacked. If the room is rotated 90 degrees to the

- dhakadkush December 16, 2015

right, boxes will fall, affected by gravity. Finds out a box which will have the longest ‘fall distance’, and

output the value of the longest ‘fall distance.

like there are 26 boxes in total (7 + 4 + 2 + 6 + 7 = 26). After rotating, gravity

affects all boxes and final state becomes like the room on the right. Among these 26 boxes, a ‘fall

distance’ of box A is the longest as 7, therefore, return 7.

For reference, a ‘fall distance’ of box B is 6, and a ‘fall distance’ of box C is 1. Gravity begins to apply after rotation is finished.

Boxes are stacked being adjacent to one side of the wall, thus all boxes are located in a two

dimensional plane. There is no box which is stacked apart from the wall. The width of the wall is always 100, and the height of the wall is always 100.

Input

First line contains t, the number of test cases.

t test cases follow. Each test case has 2 lines. First line of each test case is n, the width of the

room.

Next line contains n space separated integers representing the number of boxes in each stack.

1<=t<=10

1<=n<=100

Output

The program should give output in separate line, for each test case

Sample Input

1

9

7 4 2 0 0 6 0 7 0

Sample Output

7| Flag | PURGE - 0 Answers
**Given a set and a pairwise xor set, find the second set?**We take 2 sets of integers to generate a third set with contains the xor of every element in the first set with every element in the second set.

- suyash93 November 23, 2015

Now as a problem we have been given the first set and the third set i.e. the set with xors, and we need to generate the second set.| Flag | PURGE - 0 Answers
**Flipkart Interview Questions- Offcampus**You have been given of stream of integer find out the 1st non repeated integer.

- taniyaag November 22, 2015

example 21235 :here 1st integer would be 1,

123452134 : here the 1st non repeated integer would be 5.

Please let me know the solution to above question.| Flag | PURGE - 0 Answers
**Need Help with recursive time complexities**I am getting a bit confused with verbal (& fast) calculation of time complexities of recursive functions.

- tanmay.ashok.patil November 18, 2015

The substitution method & recursion tree method takes a lot of time and during interviews are not feasible options.

So I need help with fast and verbal calculation of recursive functions.

For eg.

The below method is called recursively.

Inside the method a for loop runs from 1 to n. And for each iteration the recursion is called twice.

How should the Big-Oh should be calculated?

compute(){

if(){

// some base case which terminates the recursion

} else {

for(1 -> n){

compute();

compute();

}

}

}

Thanks For Reading| Flag | PURGE - 1 Answer
**Reverse an array of integers**Is there a better way to reverse an array of integers than the one below. Will using a stack perform better

- Megha Maheshwari November 18, 2015

int [] array = {2,5,7,8,9,10}

int startindex = 0;

int endindex = array.Length -1;

while(startindex < endindex)

{

int temp = array[startindex];

array[startindex] = array[endindex];

array[emdindex] = temp;

startindex++;

endindx--

}

Complexity : O(n/2)| Flag | PURGE - 0 Answers
**Negotiating a Google vs Facebook offer**I am in the lucky position to will be receiving an offer both from Goog and Fb. The companies know about each other. Goog apparently decided not to extend an offer if I don't tell them what's Fb offer first. My other option was to tell them what total compensation I would need to shut the door with Fb without hearing their offer at all. I took time and have not talked to FB yet. What's the rational behind Goog's (questionable) move? What's the best course of actions for me at this point?

- gevhar November 14, 2015| Flag | PURGE - 0 Answers
**How to get callbacks after a long employment gap**I have a BS and MS in Computer Science and due to illness I have been out of work for 5 years. I seem to be on the upswing and have been submitting resumes with no luck.

- lilgeekboy November 05, 2015

I do programming projects when I can as well as pick up new languages(learning elixir right now) to keep in practice. I also work on coding interview and programming contest questions.

The big problem is that my health took a nose dive as I was completing my MS and I only have small internship work and a non-programming consulting gig as work history.

Is there any hope for actually getting an interview and hired or is my degree wasted?| Flag | PURGE

**CareerCup**is the world's biggest and best source for software engineering interview preparation. See all our resources.

Open Chat in New Window