Find Interview Questions for Top Companies
Ques:- Code for permuting a given string.
Asked In :- Scanline VFX LA,
Right Answer:
```python
def permute(s, l, r):
if l == r:
print("".join(s))
else:
for i in range(l, r + 1):
s[l], s[i] = s[i], s[l] # swap
permute(s, l + 1, r)
s[l], s[i] = s[i], s[l] # backtrack

string = "ABC"
permute(list(string), 0, len(string) - 1)
```
Ques:- Does CGI create new security risks?
Asked In :- Agaram InfoTech,
Right Answer:
Yes, CGI can create new security risks, such as vulnerabilities to buffer overflows, injection attacks, and improper handling of user input, which can lead to unauthorized access or data breaches.
Ques:- What is the difference between object oriented and structured oriented programming?
Asked In :-
Right Answer:
Object-oriented programming (OOP) focuses on objects and classes, allowing for encapsulation, inheritance, and polymorphism, while structured programming emphasizes a linear top-down approach with functions and control structures, promoting a clear sequence of execution.
Ques:- What is a Web Designer?
Asked In :-
Right Answer:
A web designer is a professional who creates the visual layout and user experience of websites, focusing on elements like color, typography, images, and overall aesthetics to ensure the site is attractive and user-friendly.
Ques:- How can I stop my CGI script reading and writing files as “nobody”?
Right Answer:
To stop your CGI script from reading and writing files as "nobody," you can change the ownership of the files to the user that runs the CGI script or adjust the permissions of the files to allow access for the "nobody" user. Alternatively, you can configure your web server to run the CGI scripts under a different user account by using options like `suEXEC` or `mod_suexec` in Apache.
Ques:- Is CGI a script or a program?
Asked In :- the sweet shop,
Right Answer:
CGI is a standard for running programs, so it can be considered a program that interacts with web servers.
Ques:- What is CGI?
Asked In :-
Right Answer:
CGI, or Common Gateway Interface, is a standard protocol used to enable web servers to execute scripts and generate dynamic content by interfacing with external programs or scripts, typically written in languages like Perl, Python, or PHP.
Ques:- Can I identify users/sessions without password protection?
Asked In :- Scanline VFX LA,
Right Answer:
Yes, users/sessions can be identified without password protection using methods such as session tokens, cookies, IP addresses, or device fingerprints.
Ques:- Difference between CGI and JAVA?
Asked In :-
Right Answer:
CGI (Common Gateway Interface) is a standard for running external programs on a web server to generate dynamic web content, while Java is a programming language that can be used to create web applications, including those that utilize CGI. CGI is a protocol, whereas Java is a language used for development.
Ques:- Do I have to use Perl?
Asked In :- the sweet shop, sky,
Right Answer:
No, you do not have to use Perl; there are many other programming languages and tools available for CGI scripting.
Ques:- Is it a script or a program?
Asked In :- MBR Informatics,
Right Answer:
It depends on the context; a script is typically a small program written to automate tasks, while a program is a more complex application that performs a specific function.
Ques:- Can I run a CGI script without returning a new page to the browser?
Asked In :- the sweet shop,
Right Answer:
No, a CGI script must return a complete HTTP response, which typically includes a new page or content to the browser.
Ques:- Can I redirect users to another page?
Asked In :- Aspect Ratio,
Right Answer:
Yes, you can redirect users to another page using HTTP status codes (like 301 or 302) or by using client-side methods such as JavaScript's `window.location` or HTML's `<meta>` tag with the `http-equiv="refresh"` attribute.
Ques:- How can I run my CGI program 'live' in a debugger?
Asked In :- the sweet shop,
Right Answer:
To run your CGI program live in a debugger, you can use the following steps:

1. **Set up a local web server**: Use a server like Apache or Nginx that supports CGI.
2. **Configure the server**: Ensure that the server is configured to execute CGI scripts (usually in the `cgi-bin` directory).
3. **Use a debugging tool**: Use a debugger that supports remote debugging, such as GDB for C/C++ or pdb for Python.
4. **Start the debugger**: Launch your CGI script within the debugger, specifying the necessary environment variables.
5. **Access the script via a web browser**: Make a request to the CGI script through the browser, which will trigger the debugger.

This allows you to step through the code and inspect variables as the script runs.
Ques:- What is Scientific Visualization package?
Asked In :- Aspect Ratio,
Right Answer:
A Scientific Visualization package is a software tool that helps in creating visual representations of scientific data, allowing researchers to analyze and interpret complex datasets through graphs, charts, and 3D models.
Ques:- Do I need to be on Unix?
Asked In :-
Right Answer:
It depends on the specific requirements of the job or project. If the role involves working with Unix-based systems, then yes, you may need to be on Unix. Otherwise, it may not be necessary.
Ques:- Are there some interactive debugging tools and services available?
Asked In :- guardicore, sky,
Right Answer:
Yes, there are several interactive debugging tools and services available, such as GDB (GNU Debugger), Visual Studio Debugger, WinDbg, and online services like Sentry and LogRocket.
Ques:- How do I generate web pages from a program (CGI)? Are there libraries to make it easier?
Right Answer:
To generate web pages from a program using CGI, you can write a script in languages like Perl, Python, or Ruby that outputs HTML. The script should include the appropriate HTTP headers, such as `Content-Type: text/html`. Libraries like Flask (for Python) or CGI.pm (for Perl) can simplify the process by handling HTTP requests and responses more easily.
Ques:- When do I need to use CGI?
Asked In :- Scanline VFX LA, sky,
Right Answer:
You need to use CGI when you want to create dynamic web content that requires server-side processing, such as handling form submissions, generating web pages on the fly, or interacting with databases.
Ques:- What do I absolutely need to know in CGI?
Asked In :- Scanline VFX LA,
Right Answer:
You need to know how to handle user input securely, manage sessions, validate data, prevent common vulnerabilities (like SQL injection and cross-site scripting), and understand the server environment where your CGI scripts will run.


AmbitionBox Logo

What makes Takluu valuable for interview preparation?

1 Lakh+
Companies
6 Lakh+
Interview Questions
50K+
Job Profiles
20K+
Users