Symantec Interview Question for Quality Assurance Engineers


Team: DLP
Country: United States
Interview Type: In-Person




Comment hidden because of low score. Click to expand.
2
of 2 vote

public static void listStructure(String path) {
		listStructure(new File(path));
	}

	public static void listStructure(File file) {
		if (file.isDirectory()) {
			for (File f : file.listFiles()) {
				if (f.isDirectory())
					System.out.println(f.getAbsolutePath());
				listStructure(f);
			}
		}
		if (file.isFile()) {
			System.out.println(file.getAbsolutePath());
		}
	}

- jerry January 26, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

Can it be as simple as iterating a tree using BFS ?
Consider Node is a folder

Node temp = root;
Queue queue = new Queue();
queue.add(temp);

while (!queue.isEmpty()) {
	temp = queue.get();
	if (temp != null) {
		System.out.println(temp.name)
 		Node[] childrens = queue.getChildrens();
		while (Node child : childrens) {
			queue.add(child);
		}
	}
}

- Viippy December 24, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

which programming language has been used here?

- Anonymous January 10, 2013 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

In Perl, on unix it is simple to list out the home directory and it's recursive directories and file using the "ls -ltR" command.

Run the command using `` operator (backtic)
++++++++++++
#!/usr/bin/perl

#!/usr/bin/perl

my @array = `ls -ltR /home`;

print " Dir structure \n @array \n";

+++++++++++++++++++

- Srilakshmi Vallalar October 18, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In Perl on windows to list out sub directories, Use "tree" command

my @array = `tree D:/Songs`;

print " Directory \n @array \n";

- Anonymous October 13, 2015 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

In Perl on Windows to list out directories use "tree"

my @array = `tree D:/Songs`;

print "Directory \n @array \n";

- krishna vaitla October 13, 2015 | Flag Reply


Add a Comment
Name:

Writing Code? Surround your code with {{{ and }}} to preserve whitespace.

Books

is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.

Learn More

Videos

CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.

Learn More

Resume Review

Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.

Learn More

Mock Interviews

Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.

Learn More