Nivio Technologies Interview Question for Software Engineers


Country: United States
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
1
of 1 vote

The first one won't have any output since the stdout stream wasn't flushed by a newline (or a manual call).

In Java, the method called is println, so it's adding a newline at the end of the string, causing the stream to flush.

- francisvm January 31, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

but in normal hello word c++ program we does not need to add \n it print output automatically , then in this case why output is nothing

- nikesh joshi February 02, 2015 | Flag
Comment hidden because of low score. Click to expand.
1
of 1 vote

Because your stdout stream is flushed when the program exits.

In this case, the program won't exit normally since the while(true) is blocking it.

- francisvm February 02, 2015 | Flag
Comment hidden because of low score. Click to expand.
0
of 2 vote

Both program will print "Hello" 4 times and after that will run in infinite loop.

In java while loop or do while loop evaluates to boolean.
In C or C++ , 0 is false while any positive number is true.

- sumit January 31, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

the first code will produce the "He" then "hello" 4 times in single line without spaces and it run in infinite loop.

the second code will produce only "Hello" 4 times in four lines and it run in infinite loop.

- Moustafa Sayed February 04, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

1 program prints HeHelloHelloHelloHello in one line
2 program prints 4 times Hello;
Hello
Hello
Hello
Hello

- Som March 27, 2015 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More