HCL America Interview Questions
- 0of 0 votes
AnswerWrite an algorithm to convert string "1234.56" to its float equivalent.
Solution:
- Rahul Telang November 02, 2010using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MSIntervewPreparation { class ConvertStringToFloat { static void Main(string[] args) { string str = "1234.56"; float num = 0.0F; float multiplier = 0.1F; bool isDecimalReached = false; for (int i = 0; i < str.Length; i++) { if (str[i] == '.') { isDecimalReached = true; continue; } if (!isDecimalReached) { num = (num * 10) + (str[i] - '0'); } else { num += (str[i] - '0') * multiplier; multiplier *= 0.1F; } } Console.WriteLine("Input String: " + str); Console.WriteLine("Float Number: {0} ", num); } } }
| Report Duplicate | Flag | PURGE
HCL America Solutions Architect String Manipulation - 0of 0 votes
AnswersWrite a function to convert "1234.56" into its float equivalent.
Solution:
- Rahul Telang November 02, 2010using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace MSIntervewPreparation { class ConvertStringToFloat { static void Main1(string[] args) { string str = "1234.56"; float num = 0.0F; float multiplier = 0.1F; bool isDecimalReached = false; for (int i = 0; i < str.Length; i++) { if (str[i] == '.') { isDecimalReached = true; continue; } if (!isDecimalReached) { num = (num * 10) + (str[i] - '0'); } else { num += (str[i] - '0') * multiplier; multiplier *= 0.1F; } } Console.WriteLine("Input String: " + str); Console.WriteLine("Float Number: {0} ", num); } } }
| Report Duplicate | Flag | PURGE
HCL America Solutions Architect String Manipulation - 0of 0 votes
AnswersWrite down the C code to remove the substring from the main string. This should be done recursively.
- someone September 26, 2009
e.g
main string = "hello xyydd"
sub string = "yd"
o/p = "hello x"
#1 recursion o/p = "hello xyd" //first "yd" removed but it formed new matching substring that has to be removed in next recursion
#2 o/p = "hello x"| Report Duplicate | Flag | PURGE
HCL America Software Engineer / Developer C - 0of 0 votes
AnswersMobile application with 3 screens.
- Sudhakar September 25, 2009
1.Login page.(contains username and password)
2.Register page.(first name,lastname,username,password,retype password,mobile etc)
3.Main page(textbox to enter phone number,textbox to send message,and submit button to send the message).
Requirements : Maximum time to send message = 2minutes.
Maximum time to get response = 2minutes
Maximum numbers of users to support = 1000
And only 20% of test automation.
Come up with all the testcases that you test this applications?
What are the performace testing you will do?
What are the security testing you will do?| Report Duplicate | Flag | PURGE
HCL America Software Engineer in Test Testing - 0of 0 votes
AnswersHow do you explain the _BASIC_ difference between Java and C++ to your grandmother in 3 simple sentences?
- LLOLer August 18, 2009| Report Duplicate | Flag | PURGE
HCL America Software Engineer / Developer C++ - 0of 0 votes
AnswersAmong different sorting algorithms which one is best and why?
- sudhakar August 10, 2009| Report Duplicate | Flag | PURGE
HCL America Software Engineer in Test Algorithm - 0of 0 votes
AnswersDesign oxford english dictionary.
- sudhakar August 10, 2009| Report Duplicate | Flag | PURGE
HCL America Software Engineer in Test Hash Table - 0of 0 votes
AnswersWrite a program that print numbers 1to 100 which are divided by 2 and 5.
- Sudhakar August 09, 2009| Report Duplicate | Flag | PURGE
HCL America Software Engineer in Test