Visit our sponsor Five Planet Juices  
Home
Microsoft Interview Process
Microsoft HR Questions
Technical Questions
Puzzles/Riddles
Resume Tips and Template
Discuss
Question to Interviewer
Interview Tips
Term Of Use
Site Feedback


Test ATOI function

Test the following API:

 

int atoi(
   const char *string 
);

Parameters

string: String to be converted.

Return Value

Each function returns the double, int, __int64, or long value produced by interpreting the input characters as a number. The return value is 0 (for atoi, _atoi64, _wtoi, and _wtoi64), 0L (for atol and _wtol), or 0.0 (for atof and _wtof) if the input cannot be converted to a value of that type. The return value is undefined in case of overflow.

 

 


Comments:

Solution :)
By eMSFTAdmin on Thursday, March 22, 2007 (UMST)

TEST CASES:

Functional Testing:
1. Pass a string containing negative sign to the function, it should return the converted negative number.
2. Pass a number with a + sign in front of it, it should return a positive number back.
3. Pass a floating point number to the function, it should return the numbers till the decimal point .
4. Pass a string with alphabets in it, it should return the number till the pont where alphabets end.
5. Pass a big positive number, it should return the numeric equivalent of a number.
6. Pass a string containing all characters to the function, it shuold return 0;
7. Pass a string with special characters in the string like "*" or "," and ".". It should convert number only till the special character.

Boundary conditions check:
1. Pass an empty string to the function, it should return 0;
2. Pass 0 to the function, it should return a numeric 0.
3. Pass NULL to the string and the function should return 0.
4. Pass a huge positive number that exceeds integer boundary bounds, it should return the wrapped around number.
5. Pass a decimal point number starting with 0 like 0.0001 and it should return 0.

Localization: N/A

Security Testing:
1. Check the Input string passed to the function it should not be modified.
2. When multiple threads are invoked on high load neither the input nor the output should be garbled.

Performance Testing:
1. The function must be tested by invoking it using multiple threads and the response time must be observed.
The response time should be almost linear.
2. The function must be tested by invoking it using multiple threads and Memory usage should be observed, it should not occupy
large chunk of memory.

Load Testing:
1. Test the function with high number of threads, response must be correct all the time.
2. Test the function with a high number of threads and it should not bring down the application.

Stress Testing:
1. Test the function using low amount of resources i.e. available memory and CPU time. Its performance should not degrade drastically.

Stability Test:
1. After every call, the function should release all the resources occupied by it.

Reply to this Comment

Add Your Comment

New Articles
  • Combinations in a character array.
    Write a program that takes input a char array and outputs all the combinations of the characters in the character array.
    Example: consier char array {'a','b','c'}
    the output shouold be abc,cab,bac,acb,cba,bca that is all the combinations of characters 'a','b','c'.


  • N-Queen Problem.
    Write a Program to solve N-Queen Problem.

  • Reverse a string
    Reverse a string using recursive function

  •  

    Most Popular Articles
  • Crazy Guy On The Airplane
    A line of 100 airline passengers is waiting to board a plane. they each hold a ticket to one of the 100 seats on that flight.

  • What are your greatest weaknesses
    Beware - this is an eliminator question, designed to shorten the candidate list. Any admission of a weakness or fault will earn you an “A” for honesty, but an “F” for the interview.

  • Question: Tell me about yourself.
    Many candidates, unprepared for the question, skewer themselves by rambling, recapping their life story, delving into ancient work history or personal matters.

  •  

    New Posts

  • penis viagra online Tramadol
    Posted by BobeCrobChext on 2008年9月30日 (UMST)

  • Fast Tramadol delivery
    Posted by SurojattSit on 2008年9月30日 (UMST)

  • Tramadol - new Online
    Posted by SurojattSit on 2008年9月30日 (UMST)



  •