AceTheInterview
Jobs in Pune | Work better in teams | Socialize with friends | Submit Q&A | Tell a friend
Search site for 

Top 100 Interview Questions & Answers in a convenient and easy to read book!

“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”

– Ravi, California

Read more comments...

Interview Questions And Answers RSS Feed

Answers »

  1. Submitted By: J1gs4w — June 1, 2008
    -2 votes
      + -

    What’s there in this. Whenever you encounter a tab replace it with 4 spaces in the output file. Whenever you encounter a brace follow it with 4 spaces.

  2. Submitted By: Saket — May 18, 2009
    +1 votes
      + -

    Keep a variable called tab+spaces in your code. You also have to care about indentation when you encounter braces.

    So, replace all tabs by new line and tab_spaces (intially equal to 4).

    Once you encounter a bracket, then increment the tab_spaces by 4. When you encounter a closing bracket, decrement a tab_space by 4.

    Note that my assumption is that the code is complete and correct. In order to consider a situation when the code may not be correct, you can use a stack to keep track of opening and closing brackets.

  3. Leave an Answer/Comment

    To prove you're a person (not a spam script), type the security text shown in the picture. Click here to regenerate some new text.
    Click to hear an audio file of the anti-spam word

Our Sponsors
Our Sponsors
Contact Us | FAQ | Sitemap | Terms of Use | Privacy Policy | Tell a Friend

Copyright © 1999-2006 Jeeve Technologies LLC. All rights reserved.