Given an array with duplicate elements give an algorithm to get the count of distinct elements in the array
Senior Interview Questions
340,968 senior interview questions shared by candidates
2. /** * A tournament tree is a binary tree * where the parent is the minimum of the two children. * Given a tournament tree find the second minimum value in the tree. * A node in the tree will always have 2 or 0 children. * Also all leaves will have distinct and unique values. * 2 * / \ * 2 3 * / \ | \ * 4 2 5 3 * * In this given tree the answer is 3. */ class Node { Integer value; Node left, right; Node(Integer value, Node left, Node right) { this.value = value; this.left = left; this.right = right; } } class Solution { /** * This should return the second minimum * int value in the given tournament tree */ public static Integer secondMin(Node root) { } }
Will you work in OK until something in AR is available?
1.How to find the nearest parent of any two nodes in a given tree. Tree has mother and father nodes.
All the basic questions on my subject
Do company tagged leetcode questions.
Lotteries are typically run by government agencies. Governments often use the funds for public school education, etc. 1. Why might people buy a lottery ticket? The lottery has 3 prize levels and when you buy a ticket you are put in contention for all 3 prize levels Odds: 1st : 1 in 10 million, the prize is 1 million 2nd :1 in 1000, the prize is 200 3rd :1 in 10, the prize is 5 dollars 2 million tickets are sold Tickets cost 2 dollars to buy 4 million in revenue from ticket sales 2. On average, how much should an individual expect to win from the lottery? 3. Is buying the lottery ticket a good deal for consumers? 4. How can the lottery attempt to sell more tickets? Let’s say, the lottery modifies its prize structure They decide to add an additional 4 million in prize money, split between the 2nd and 3rd options. This money is split collectively between all winners 1st :1 in 10 million, the prize is 1 million 2nd :1 in 1000, the prize is 200. There is also a 2 million prize which will be split collectively between the winners 3rd :1 in 10, the prize is 5 dollars. There is also a 2 million prize which will be split collectively between the winners 5. What is the collective value of a ticket now? 6. How many additional tickets does the lottery have to sell to break even on the money they put toward the new prizes? Assume, they’ve already broken even on the cost of the other lottery prizes. 7. Is it viable to sell that amount of additional tickets?
1. Given the sample: id, status 1, active 2, active 3, active 4, pending 5, expired 6, expired 7, expired 8, pending Pull the unique statuses that show up consecutively 3 times, e.g. from the sample, the output would be 'active', 'expired'. 2. Given the sample: employee, in_out, time A, IN, 6:00 B, IN, 7:00 A, OUT, 8:00 C, IN, 9:30 A, IN, 9:00 A, OUT, 10:00 B, OUT, 11:00 C, OUT, 10:00 Determine which employees are in the building at 10:30.
Describing a full redundant, resilient, multi region servers (no point of failure, live 24/7) dns, load balancers, firewalls, applications servers, and Databases.
Tell me about a time when you gave a simple solution to a complex problem.
Viewing 271 - 280 interview questions