Credit Suisse Interview Question


Country: India
Interview Type: Phone Interview




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

if `wc -c filename` > 45 then cat filenname fi

- Jitendra September 20, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
1
of 1 vote

Use
find . -type f -exec wc -c {} \; | awk '{if ($1>45) print $2}'

- Abhishek September 24, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

find /location +45c -print

- Walid September 25, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

wc -m [filename] | awk '{ if ($1 > 10) print $2 }'

- HC October 06, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 votes

oops I mean 45 not 10.

- HC October 06, 2012 | Flag
Comment hidden because of low score. Click to expand.
0
of 0 vote

for d in `ls`
do
if [`wc -l $d >= 45]
then
cat $d
else
echo "$d contain less char"
fi
done

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

For a KSH Shell

#!/usr/bin/ksh
for i in `ls`
do
if [[ `wc -c $i | awk '{print $1}'` -gt 40 ]]
then
echo $i has more than 40 characters
else
echo $i has less than 40 characters
fi
done

- Praveen December 17, 2012 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

first u must know number of characters in a file means size of that file
so the ans
find . -type f -size +45

- Anonymous March 08, 2013 | Flag Reply
Comment hidden because of low score. Click to expand.
0
of 0 vote

for f in `ls -l | grep "^-" | awk '{print $8}'`
do
if [ `wc -c $f | awk '{print $1}'` -gt 45 ]
then
cat $f
else
echo $f has less than 45 chars
fi
done

- JAIN October 20, 2013 | 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