Swing tarzan-like over it! Or build a bridge. Or ride in a safe boat (preferably metal) and bat any alligators over the head that attack you.
How would you value Groupon or any other social network?
Glassdoor has 191 interview questions and reports from Intern interviews. Prepare for your interview. Get hired. Love your job.
I did not prepare for this. It is easy to find a job if your major in IT. But I guess this reason is not very good.
How do you fit an elephant into a refrigerator?
template class Q private Stack S1,S2; public Q(); ~Q(); void enQ(item *); item* dQ(); int empty(); void Q::enQ(item * i) if(S1.empty~S2.empty) while(~S2.empty) S1.push(S2.pop()); S1.push(i); return; item Q::dQ() if(S2.empty~S1.empty) while(~S1.empty) S2.push(S1.pop()); return S2.empty?0:S2.pop; int Q::empty() return S1.empty()S2.empty; Q::Q() S1=new Stack; S2=new Stack; Q::~Q() delete S1; delete S2;
Discuss how climate change might affect our business?
I guess theyre expecting to measure how you can manage memory in your code. I would use pointers such that I can free up the memory (by deleting) when Im done. clock_t* start = clock(); program code clock_t* end = clock(); clock_t ExecutionTime = end – start; delete start; delete end;
Valuation impact, increase in cost of capital.
Not prepared again. This is focusing on your responsibility I guess. If you did something wrong, you should be responsible and try your best to fix it.
Please tell me do you have any experience in your life or study, that you did not do it well, or badly, then what happened?
Enqueue : Push elements to stack1. Dequeue : If stack2 is not empty, pop elements from stack2. Otherwise, pop elements from stack1 and push them to stack2 first. Then, pop elements from stack2. For explanation, example and code
Queue should implement FIFO. Lets have a group of task 1 -10 to be performed //declare two stacks Stack S1, S2; //feed stack S1 with the tasks 1 – 10 for(int i=1; i=10;i++) S1.push(i); //Now S1 contains 10,9,8,7,6,5,4,3,2,1 where the top is 10 //Transfer all from S1 to S2 while(!S1.isEmpty()) S2.push(S1.pop()); //Now S2 contains 1,2,3,4,5,6,7,8,9,10 where the top is 1 You can now pop tasks from S2. Task 1 will be the first to pop and so on… Therefore, you just simulated FIFO using two stacks
Calculating the max execution time of a program that had to fit into a certain size of memory on an embedded device.
Declare two stacks called in and out. sert() calls in.push() queue.remove() if (out.notEmpty) out.pop() else while(in.notEmpty) out.push(in.pop) Dont get how this would be two questions.
Intern interview questions shared by candidates
blakdoggs answer is efficient, and has amortized time O(n). The trick here is that when you enqueue an element, you only push into one stack. Only move element when dequeue. Otherwise, running time will be more than O(n). Details are in CLRS amortized analysis.
What do you think about the chance to travel internationally in this industry?
I think it depends on processing speed of a Processor or Controller or it depends on MIPS of the system. Finally, MIPS will be used to measure the time for executing total number of assembly level instructions of the given code.
Build a refrigerator big enough to fit it!
Glassdoor will not work properly unless browser cookie support is enabled.Learn how to enable cookies.
Please check my videos that explain How to implement a queue from two stacks? Part 1 – Part 2 – Part 3 –
Because that is the simple implementation, pretty much the exact same answer I gave them, there apparently is a more efficient way of modelling it.
They do not offer much chance to travel in Perth technical roles so this was something of a misleading question.
How do you cross a river infested with alligators?
How to implement a queue simply using two stacks and how to implement a highly efficient queue using two stacks.