Given an array of pairs of numbers, simplify the numbers. The pairs represent ranges, and the result is a simplified version of these pairs. So [1,5],[3,7] should result in [1,7].
Software Interview Questions
748,807 software interview questions shared by candidates
Interview question like that Q: 01 Given: 11. public static void parse(String str) { 12. try { 13. float f = Float.parseFloat(str); 14. } catch (NumberFormatException nfe) { 15. f = 0; 16. } finally { 17. System.out.println(f); 18. } 19. } 20. public static void main(String[] args) { 21. parse("invalid"); 22. } What is the result? A. 0.0 B. Compilation fails. C. A ParseException is thrown by the parse method at runtime. D. A NumberFormatException is thrown by the parse method at runtime. Answer: B
More of logical questions.
Write a function called eval, which takes a string and returns a boolean. This string is allowed 6 different characters: 0, 1, &, |, (, and ). Eval should evaluate the string as a boolean expression, where 0 is false, 1 is true, & is an and, and | is an or. An example string might look like "(0 | (1 | 0)) & (1 & ((1 | 0) & 0))"
Started by asking the usual: expectations, ambitions, why the company, then a surprisingly basic white board test about basic sql concepts and some basic recusrive algorithm The peer programming technical test was just a simple TDD excersive. The rest I can't tell, I was dismissed after TDD for reason explained bellow
Given a list of people's names, organize a beer exchange such that each person is randomly assigned someone else to give a beer to, and someone to receive a beer from. Caveat: The person cannot receive a beer from the same person to whom they are gifting one.
draw a reversed T pattern which would generate on dynamic series by giving odd input * * * * * @ @ @ @ Second Question is : * * * * * *
Try-catch block, handle class, matrix indexing in MATLAB. Declaring private methods in Python. A lot of importance was given to behavioral questions.
How would you store the configuration of a chess board at any point in the game?
What is the output of below program. var a = [1,2,3,4] for (var i=0; i<a.length; i++){ setTimeout(function(){ console.log(i) },1000) } ( My Ans : it will print 4 5 times as it will store the latest reference) Next They asked me : How can i print 1,2,3,4 by changing some code in above example
Viewing 2051 - 2060 interview questions