## Recent Interview Questions

- 0of 0 votes
I want to start seo for my Website www.couponseller.in so could you halp me how to chose best seo services

- 0of 0 votes
The topic is to design a data structure to store employee relationships.

For example, A is B's direct manager, there is an operation is "" set_manager "," A "," B ">.

For example, B is a colleague of C <"set_peer", "B", "C">

At this point, we do this with <query_manager "," A "," B "> and we get True, which means that A is B's manager (either direct or indirect).

This is true if we have <"query_manager", "A", "C">, because C is a coworker for B, so A is also C's manager. That is, there is a transitive relationship between colleagues.

Follow up, such as query <"query_manager", "A", "D"> (D this person has not been initialized), what to do. Conflict how to do

For example, A is a direct manager of B, E is a direct manager of C, which is set_peer (B, C), there will be conflicts, B and C direct manager should be the same person,

E and A are two people, there are contradictions here.

- 0of 0 votes
given a dictionary, output the longest List <String>. The result of a String is the previous String add a character at any position.

example: {i, in, ing, sing, sting, string}

- 0of 0 votes
Find a “local minimum” in a binary tree

a local min is a node whose value is smaller than that of any other nodes that are connected to it

- 0of 0 votes
1. merge intervals with value

PD: there are a series of continuous intervals, and each interval has a value. Initially, the ith

interval is (i - 1, i - 1), merge these intervals and return the result.

Merge Rule:

a. We can only merge the ith interval with i-1 th or i + 1 interval. The value of new interval is the

mean of these two original intervals.

b. Define cost as absolute difference of two neighboring intervals,

every time merge two intervals with the smallest cost.

c. If the smallest cost exceeds a threshold t, then stop.

d. There may be multiple valid result, just return one.

for example:

value: 3 7 6 5 1

intervals: (0,0) (1,1) (2,2) (3,3) (4,4)

threshold: t = 2

first iteration:

min cost = |7 - 6| = 1, notice that |6 - 5| is also okay.

after merging:

value: 3 6.5 5 1

intervals: (0,0) (1,2) (3,3) (4,4)

second iteration:

min cost = |6.5 - 5| = 0.5

after merging:

value: 3 5.75 1

intervals: (0,0) (1,3) (4,4)

second iteration:

min cost = |3 - 5.75| = 2.75 > t = 2, stop

return [(0,0), (1,3), (4,4)]

- 0of 0 votes
Well design a master controller/scheduler which should be configurable and capable of running multiple processors at a same time

Scheduler Operation :-

scheduler process should be able to perform various operations below are the examples

1. execute sql queries and stored procedures in the database

2 should be able to send emails with given set of arguments and attachment to business

3 should be able to send ftp files based on input arguments

4 should be able to execute batch files

process should have below capabilities

Process Operation :-

1 Remotely start/stop a child process

2 Raise alerts when any above process fails

3 Automatically restart the process if it fails

4Remotely kill a child process that breaches a pre set timeout limit

so for scheduler and processor I have to come to design with

1 High level design

2 Class level diagram

3 Design should be flexible t incorporate more operations

4 any design pattern you think we can use

- 0of 0 votes
You have to implement the following function:

int MinColoring(int k, char* str);int MinColoring(int k, char* str);static int MinColoring(int k, String str) {}static int MinColoring(int k, string str) {}

The function takes a string 'str' of size 'n' and an integer 'k' as its arguments and returns the minimum no. of paint operation required to achieve the final colored sequence as represented by 'str'.

A paint operation is defined as coloring exactly 'k' consecutive balls out of 'n' balls with a single color.

Assumptions:

n > 0

0 < k <= n

Note:

Paint operation always starts from the ball at index 0

Any ball can be repainted any no. of times

Each character in 'str', represented by small letter alphabets, denotes the final coloring of the ball at that index

If the colored sequence cannot be obtained by any no. of paint operations, return -1

Paint operation can not be performed for less than 'k' balls

Example:

Input:

k: 3

str: rrggg

Output:

2

Explanation:

Since we can color 3 balls at a time, we can first color the balls {0, 1, 2} with color "r". Next, we can color the balls {2, 3, 4} with color "g". As a result, color sequence of the ball will be rrggg. And this was achieved in 2 paint operations.

- 1of 1 vote
Give all n cities the distance between them, and then you have to follow all the cities in the order of small to large index of the city, which means you must visit the cities in ascending order, and now you can choose not to visit k cities (k < n), ask choose not to go to which k cities can make the path shortest? Return the shortest journey.

int findShortestPath(int[][] matrix, int k){

}

- 0of 0 votes
3. Complete the following function-

Node * alternateReverse( Node* head1, Node*head2){

// code goes here

}

Where ‘Node’ is the structure of a linked list node defined as:

struct Node{

int data;

struct Node *next;

};

alternateReverse() must remove the even number nodes from the linked list and append them to the end in reverse order. No extra space was allowed. It was for 5 marks.

Example:

Input-1->2->3->4->5->6

Output-1->3->5->6->4->2

Input-1->2->3->4->5->6->7->8->9

Output-1->3->5->7->9->8->6->4->2

- 0of 0 votes
We were given an array. Values of the array were memory sizes and the memory that is required by the system can only be represented in powers of We had to return the size of the memory required by the system.

Ex: – arr = {2,1,4,5}

Total = 12

So, memory required =16

- 0of 0 votes
Given an array arr[], find the maximum j – i such that arr[ j ] > arr[ i ]

- 0of 0 votes
Given two arrays find the min in first array and max in the second array and return the product of the two elements

- 0of 0 votes
Third question was to find length of longest AP in given set of numbers.

- 0of 0 votes
Find the nth number that contains the digit k or is divisible by k. (2 <= k <= 9)

Example –

if n = 15 & k = 3

Answer : 33

(3, 6, 9, 12, 13, 15, 18, 21, 23, 24, 27, 30, 31, 32, 33)

- 0of 0 votes
Given 2 numbers m and n , find if the sum m+n has the same number of digits as n . If true then print m+n otherwise print n.

- 0of 0 votes
The question which has been asked is : how to share a variable across two unrelated process in Linux without using IPC.

- 0of 0 votes
The question which has been asked to me is : Print right angle triangle with stars(*) without nested loops. Implement in C programming language.

- 0of 0 votes
How two compare two database using entity framework.

- 0of 0 votes
Generate a random MxN starting board. It cannot have 3 or more pieces in a

row (horizontally or vertically) of the same color. K colors.

- 0of 0 votes
Implement a rate limiter attribute/decoration/annotation on top of an API endpoint. caps to N requests per minute with a rolling window (implement from scratch / test / compiling + working code. Was made to write the code in front of a computer.

- 0of 0 votes
Design a task execution service, which accepts tasks from clients and runs them and returns result. Following is how the

Client Registration (client name, callback method)

Submit Job to service

Once executed service will return the result to client

Lets assume that 20k jobs are getting submitted per second, you need to scale it in such a way that we are able to process as much jobs per second as possible.

Further questions:

So the components are going to be a load balancer, workstations, cache, task runner and DB. How will you make sure that data is consistent among them, mimimal duplication of data and every job is ran only once.

If any machine is down, say DB, workstation etc. how that is going to be handled.

- 0of 0 votes
find the longest substring with at most k repeating characters,

to make it more clear, at most k repeating characters means in the substring, the max count(frequency) of one or more chars is k

- 0of 0 votes
Robot walked from the upper left to the lower right, can only go down and to the right, the number of each grid is height,

If the next cell height is higher than the current, we must pay the difference cost, otherwise no cost,

Find the minimum cost to reach the lower right corner,

Follow up 1, print the minimum cost path;

- 0of 0 votes
Description : Develop an application that transfer data from the test database to live database after showing comparison and user selection.

Precondition: database and schema information provided and list of tables.

Condition Of Acceptance:

1. Application should select the source and destination databases and be capable of showing comparisons.

2. It should be capable transferring data from source to destination database/deleting the selected data from destination.

Technologies: C#, Sql server, entity framework, object oriented design principle.

- 0of 0 votes
give a list of cities a to city b the price of air tickets for example

a b 100 $

b c 200 $

e f 200 $

...

Now let you from city x to city y, you cannot transfer more than twice between the two city, find the cheap flight from x to y, follow up print out the flight

- 0of 0 votes
Gas station problem, give you a starting point A and End B. An array of oil prices at each gas station index represents the location of each gas station. MPG = V, find the minimum cost of gas from A to B

- 1of 1 vote
given a string, and integer k, check if this string contain all the binary string of length k

For example, k is 2, then 00,10,01,11.

Followup 1, find a string that can contain all binary string of length k.

Followup 2, find a shortest string that can contain all binary string of length k.

- 0of 0 votes
Expression evolution

expr :: = int | '(' op expr + ')'

op :: = '+' | '*'

Cite a few examples:

"3" -> 3

"(+ 1 2)" -> 3

"(+ 3 4 5)" -> 12

"(+7 (* 8 12) (* 2 (+ 9 4) 7) 3)" -> ...

Public int getValue(String s){

}

- 3of 3 votes
Given a list of daily temperatures, produce a list that, for each day in the input, tells you how many days you would have to wait until a warmer temperature.

[73, 74, 75, 71, 70, 76, 72] -> [1, 1, 3, 2, 1, nothing, nothing]

- 0of 0 votes
Given an array which is in ascending order till some point and then descending order till end. find peak element