## Student Interview Questions

- 1of 3 votes
(Q2)what is output and explain why?

struct abc

{

double d;

char c;

int b;

}st;

int main()

{

int i=sizeof(st);

printf("%d",i);

}

- -2of 2 votes
please help me ...i am confused

(Q1)what is output and explain why?

struct abc

{

char c;

double d;

int b;

}st;

int main()

{

int i=sizeof(st);

printf("%d",i);

}

......................................................................................................................................................................................................

- 0of 0 votes
Given an array with +ve and -ve integer, find the maximum sum such that you are not allowed to skip 2 contiguous elements ( i.e you have to select at least one of them to move forward).

Test Cases:

10 , 20 , 30, -10 , -50 , 40 , -50, -1, -3

Output : 10+20+30-10+40-1 = 89

-1,-2,-3,-4,-5

Output: -2-4=-6

- 0of 0 votes
Problem Statement

Jane's two little cousins are visiting her for the holidays. As you may know, children love candy, so Jane has bought several boxes of sweets for them. Each box contained an assorted collection of candy of different types.

At some point Jane realized that giving each child some of the boxes is not a good idea: if they receive different candies, it will certainly cause a quarrel. Therefore, Jane decided to open all the boxes, take out all the sweets and distribute them evenly into two plastic bags.

Of course, distributing a pile of assorted candies evenly may not always be possible. Sometimes it happens that the number of pieces of some particular type of candy is odd. In that case Jane will eat one of those sweets and only then will she distribute the rest of them evenly into the bags.

You are given the String[] boxes. Each element of boxes describes the contents of one of the boxes Jane bought. Each character in each element of boxes represents one piece of candy. Equal characters are candies of the same type: e.g., all 'B's are identical bonbons and all 'L's are identical lollipops.

Compute and return the number of candies each child will receive.

Definition

Class: JanesCandyBags

Method: getSize

Parameters: String[]

Returns: int

Method signature: int getSize(String[] packets)

(be sure your method is public)

Constraints

- boxes will contain between 1 and 50 elements, inclusive.

- Each element of boxes will contain between 1 and 50 characters, inclusive.

- Each character in boxes will be an uppercase letter of the English alphabet ('A'-'Z').

Examples / Test cases

0)

{"FOO", "BAR", "BAZ", "TOPCODER"}

Returns: 5

In this case Jane will eat the 7 candies that only occur once in the entire collection. The remaining 10 candies can be split evenly: each bag will contain two 'O's, one 'A', one 'B', and one 'R'. Thus, each child will receive 5 candies.

1)

{"X"}

Returns: 0

Jane will eat the only piece of candy. Then she will give each child an empty bag.

2)

{"GIVING", "CANDY", "TO", "CHILDREN", "CANNOT", "BE", "CHALLENGING", "RIGHT"}

Returns: 17

The candies in each bag here are: ACCDEGGHIILNNNORT

3)

{"WITHOUT", "IT", "IM", "JUST", "ESPR"}

Returns: 5

4)

{"PHQGHUMEAYLNLFDXFIRCVSCXGGBWKFNQDUXWFNFOZVSRTKJPRE",

"PGGXRPNRVYSTMWCYSYYCQPEVIKEFFMZNIMKKASVWSRENZKYCXF",

"XTLSGYPSFADPOOEFXZBCOEJUVPVABOYGPOEYLFPBNPLJVRVIPY",

"AMYEHWQNQRQPMXUJJLOOVAOWUXWHMSNCBXCOKSFZKVATXDKNLY",

"JYHFIXJSWNKKUFNUXXZRZBMNMGQOOKETLYHNKOAUGZQRCDDIUT",

"EIOJWAYYZPVSCMPSAJLFVGUBFAAOVLZYLNTRKDCPWSRTESJWHD",

"IZCOBZCNFWLQIJTVDWVXHRCBLDVGYLWGBUSBMBORXTLHCSMPXO",

"HGMGNKEUFDXOTOGBGXPEYANFETCUKEPZSHKLJUGGGEKJDQZJEN",

"PEVQGXIEPJSRDZJAZUJL"}

Returns: 203

- -6of 6 votes
Need special expensive recommendations for article?

Howdy I am research understudy. I need to complete my exposition composing paper. I need one of a kind substance. I know composing work is exceptionally muddled errand. Paper composing is vital for all understudies now a day's understudies look for expositions on the web. It will be give great expositions for scholastic work and Project works for understudies. So I completely look on online best article composing administration. It is giving incredible potential outcomes of composing papers. Feel free to surf (https://www.collegepaperwritingservices.com)

- 0of 0 votes
Programming Exercise – FX Calculator

Your task is to create a console-based currency converter application.

Requirements

The application allows a user to convert an amount in a specific currency to the equivalent amount in another currency.

Your calculator should allow a user to enter an amount in any of the known currencies, and provide the equivalent amount in another currency.

Your calculator should parse console input like "<ccy1> <amount1> in <ccy2>", and provide a suitable response.

For example:

%> AUD 100.00 in USD

AUD 100.00 = USD 83.71

%> AUD 100.00 in AUD

AUD 100.00 = AUD 100.00

%> AUD 100.00 in DKK

AUD 100.00 = DKK 505.76

%> JPY 100 in USD

JPY 100 = USD 0.83

If the rate cannot be calculated, the program should alert the user:

%> KRW 1000.00 in FJD

Unable to find rate for KRW/FJD

When displaying amounts back to the user, they should be formatted with the precision given below:

AUD=2 decimal places

- 0of 0 votes
scenario: Many Ethernet switches are present, on which we want to run the test on. connection between several links to our traffic generator and various ports of the different switches is established.The physical ports we use may vary between the different switches.

Test: We need an easy way to reference port settings that apply to every switch, irrespective of the physical port to which the traffic generator is connected.

required to code in Java or python or tcl script.

asked in second round of cisco

- 0of 0 votes
For a linked List p1 ->p2 ->p(n-1)->p(n) shuffle it to be p(1) -> p(n) ->p(2) ->p(n-1)....p(n/2)

- 0of 0 votes
Given the Java 8 Function interface:

interface Function<T,R> {

R apply<T t>;

}

Provide code that will apply the composition of the following implementations and would have the type

Function<String, Integer>:

class GetBytes<String, byte[]> {

byte[] apply<String value> {

return value.getBytes<>;

}

}

class ArrayLength<byte[], Integer> {

Integer apply<byte[] value> {

return value.length;

}

}

If the input is “hello world” what would the expected result of the function be?

- 0of 0 votes
Function to find if the characters of the sample string is in the same order in the text string. They need not be

consecutive.

Eg.. TextString: Redmond, Washington

Sample string :Rdd Waitn

- 0of 0 votes
Discuss three strategies for financing working capital

- 0of 0 votes
Discuss why cash is considered as a life blood for any business

- 0of 0 votes
Explain what is meant by credit management

- 0of 0 votes
Print the lucky numbers which contains "4" and "7" from the series 4, 7, 44, 47, 74, 77

ex

input 5

o/p 74

- 0of 0 votes
Print the element in anti spiral order

for example

Matrix

1 2 3

4 5 6

7 8 9

o/p

5 6 9 8 7 4 1 2 3

- -2of 2 votes
A man just finished painting his house and needs something more. At the hardware store the clerk shows him what he wants and says "one is $1".

The man states I need 600 for $3. What did the man buy?

- -2of 2 votes
If a teenager and a half can eat a pizza and a half in a day and a half. How many pizza's can 9 teenager eat in 3 days?

- -1of 1 vote
What is the next number

-3 24 -168 1008 -5040

- -1of 1 vote
Physician : Symptoms

Detective: Clue

Mason: Brick

Dispatch: Taxicab

Pharmacist:Drugs

- -2of 2 votes
Weight: Scale as to

Volume: Sound

Image: Microscope

Distance: odometer

Calibration: Measurements

Inch:Feet

- 0of 0 votes
Band: Musician as

Team:Fans

Stage:Dancers

Family: Sisters

Cast: Actors

Circus: Jugglers

- 0of 0 votes
Biography:Life is as

Story:Imagination

Chronicle: Events

Memoir:Reader

Song:Composer

Pose:Poem

- 0of 0 votes
Renovate: Dilapidated is as

Sacrifice: fortified

Revere: Admirable

Revitalize: fatigued

Restore: Irreparable

Modify: Altered

- 0of 0 votes
Hearten: Courage is as

repay: Installment

demote: rank

educate: knowledge

agree: quarrel

punish: wrongdoing

- 0of 0 votes
Humanitarian: Philanthropy is as

Fan: Notoriety

Thief: Larceny

Donor: Gratitude

Expert: apprenticeship

Scholar: Plagiarism

- 0of 0 votes
I have two coins that add up to 55 cents. One of them is not a nickel.

What are the two coins?

- 0of 0 votes
Please post me full explanation(not only answer)

I want to know how it works.`#include<stdio.h> void main() { int x=1, y=8, z; z= ++y + ++x + ++x; printf("z=%d", z); }`

- 0of 0 votes
Find the output of the following program:

#include<stdio.h>

int main()

{

int x=10; int y;

{

y=x++;

}

printf("%d",x);

}

Answer: 11

doubt: why the answer is not 10.

- 0of 0 votes
Hey, everyone! I'm stuck trying to add my name, character by character over a certain amount of output lines. I have to use hail stone (which I've already figured out). It needs to look like this:

Please enter a Number: 53

J 132 is an odd number, so I make 3n + 1: 160

O 234 is an even number, so I take half: 80

H 154 is an even number, so I take half: 40

N 114 is an even number, so I take half: 20

(TAB) 94 is an even number, so I take half: 10

D 84 is an even number, so I take half: 5

O 84 is an odd number, so I make 3n + 1: 16

E 90 is an even number, so I take half: 8

82 is an even number, so I take half: 4

78 is an even number, so I take half: 2

76 is an even number, so I take half: 1

The process took 11 steps to reach 1`package question3; import java.util.Scanner; public class Question3 { public static void main(String[] args) { Scanner inputScanner = new Scanner(System.in); System.out.printf("Please enter a Number: "); try { int number = inputScanner.nextInt(); int steps = 0; while (number != 1) { if (number % 2 == 0) { System.out.println(number + " is an even number, so I take half: " + number / 2); number /= 2; } else { System.out.println(number + " is an odd number, so I make 3n + 1: " + (number * 3 + 1)); number = number * 3 + 1; } steps++; } String name = "JOHN\tDOE "; System.out.print(name.charAt (0) ); System.out.println("The process took " + steps + (steps < 2 ? " step" : " steps") + " to reach 1"); } catch (Exception e) { System.out.println("The input entered is not a number. Please run again."); } }`

}

- 0of 0 votes
Problem Statement

A group of scientists have broken down species DNA into sequences of integers. They determine that two species with the respective DNA sequences A and B are considered to be related if a non-decreasing sequence C of the same length can be found, such that Ci=Ai or Ci=Bi.

Given the DNA sequences for two species, help the scientists determine if they are related.

Input Format

The first line contains an integer, T, the number of test cases.

For each test case:

The first line contains an integer, N, the length of the DNA sequence.

The second line contains a sequence of space-separated integers describing species A.

The third line contains a sequence of space-separated integers describing species B.

Constraints:

1≤T≤5

1≤N≤105

0≤Ai, Bi≤1010

Output Format

On a new line for each test case, print YES if a non-decreasing sequence of the same length can be found (i.e.: species are related) or NO if it cannot.

3

3

1 2 3

4 4 4

3

3 2 1

6 5 4

2

1 0

10 2

Test Case 1: We could have C=1 2 4

Test Case 2: No increasing sequence C is possible.

Test Case 3: We could have C=1 2.