• David Emery (unregistered) in reply to Charles Duffy
    Charles Duffy:
    David Emery:
    The "open exclusive" is the -right way*- to do this. If /tmp is located on a different file system/drive than the destination, then the file move operation is not guaranteed atomic. You can have the same problem on the disk copy than you have on the download (although the latency is less, it's certainly not zero.)

    It's a move, not a copy. Moves within the same partition are atomic.

    Moreover, the tempfile-and-move approach (where, yes, you put your temporary file in the same directory or otherwise somewhere known to be on the same partition) is the generally accepted solution to this problem; if you don't know it, there's no way in hell I want you on my systems engineering team.

    Again, the problem the interviewer was looking for is the way every single UNIX developer with any kind of a clue does atomic file updates.

    Read what I and others have pointed out. mv is atomic If-and-ONLY-IF you're on the same partition.

    Before we got O_EXCL or advisory locking in Unix, the common trick was to use the fact that the kernel would execute a hardlink (ln) atomically to create a lockfile, e.g. ln filename.lock. The application would -poll for the absence- of filename.lock to determine that the file was unlocked and that the download was completed.

    The advantage of opening a file either exclusive or using advisory locking, is that it doesn't have to be a polling operation. It can be a blocking operation where the block/unblock is all managed by the OS (kernel and supporting library.)

    If you don't understand why polling in this situation is A Bad Thing, I don't want to be on your systems engineering team.*

    dave

    *sorry, but the original posting was (a) a bit insulting because it was (b) a bit uninformed and (c) failed to RTFPosting; and (d) I'm feeling cranky today.

  • (cs) in reply to wds
    wds:
    See I'd just have used a lockfile.
    Have you per any chance designed MS-Access?
  • (cs) in reply to klenow
    klenow:
    Is it just me, or does Jeremy sound like a bit of a jerk? He simply wouldn't let the guy use any solution that wasn't his pet solution. Seems the simplest solution is to have the Downloader activate the Watcher when it's done.
    You cross a dimensional portal and gets stuck in a world where interviewers are unable to use adaptive interviews "IE" those that change to turn whatever answer the interviewee provided automatically wrong. Now what do you do?
  • (cs) in reply to savar
    savar:
    imMute:

    File copies would still be a problem, but file moves (also known as renames) are extremely quick as long as the src/dst are on the same volume: the FS only moves the inode data. Hell, even windows handles this as well as *nix.

    But the way Linux works, the entire filesystem is represented as being contiguous, even when the physical storage isn't.

    All it would take is one "clever" sysadmin to put the temp directory on a separate partition and all of a sudden you've reintroduced the same race condition you had before -- except this time you're not even aware of it.

    The best idea is to use some sort of locking. Either using built-in operating system locking or just something as simple as dropping a lock file in the directory that both the Downloader and Watcher respect.

    Yes, I realize the Watcher isn't supposed to be modified... but stating that you can't modify the Watcher does make this an absurd scenario to begin with.

    if the two directories are in the same filesystem, it doesn't matter if they're in different disks. In fact, i can guarantee that they don't. Also, you have to assume that the system (the part you control) is correctly configured, so the file is downloaded to a staging dir, then moved. Allowing for malicious config makes the problem impossible.

    I already pounded your locking scheme, so never miind about that. Anyway, nfs locking isn't reliable.

  • (cs) in reply to David Emery
    David Emery:

    The advantage of opening a file either exclusive or using advisory locking, is that it doesn't have to be a polling operation. It can be a blocking operation where the block/unblock is all managed by the OS (kernel and supporting library.)

    If you don't understand why polling in this situation is A Bad Thing, I don't want to be on your systems engineering team.*

    dave

    *sorry, but the original posting was (a) a bit insulting because it was (b) a bit uninformed and (c) failed to RTFPosting; and (d) I'm feeling cranky today.

    Polling isn't a bad thing, depending on the interval - poll once per minute (files are downloaded a few times per day) and the fast fail case makes for almost no system load. Also, it's simple and predictable.

  • (cs) in reply to Mover And Copier
    Mover And Copier:
    The problem might be that when I'm told I may not modify the Watcher, how the heck am I supposed to know that I might be allowed to modify the Downloader?

    So you're given a problem with 2 entities. The person who gives you the problem says "Solve this problem without changing entity #1." You assume that you can't do anything to entity #2?

    The only rational thing I can assume is that changing entity #2 is the ONLY way to solve it or else this is a bullshit trick question.

  • Nicolas Verhaeghe (unregistered)

    Yes, I also passed many interviews with flying colors, after answering very basic questions.

    This comes from the fact that our industry attracts many wannabees who just don't have what it takes, or just spent years slacking in college and managed somehow to pass their exams by cramming but have little understanding of what it is we IT guys do.

    I even told an interviewer once that, really, these questions were very simple, to which he agreed and said that I'd be surprised at how bad most applicants are.

    An advice I always give is this: when you do not know, say you do not know, do not make anything up. Better: say that you do not know YET.

  • (cs) in reply to Someone You Know
    Someone You Know:
    Gorfblot:
    A diamond in the rough is something that looks to be of little value, but is actually worth quite a lot once some polishing has been done. IE, You talked with one of the Tier 1 helpdesk people and realized they had some talent and were quick to learn. You get them some further training, move them to a junior development position, and in a short time they become a major contributor to success- That's a diamond in the rough.

    I don't think "IE" means what you think it means.

    It looks like he's using it as the abbreviation for "id est," which essentially means "in other words..." Which is perfectly fine, as used.

    You use e.g. when you want to give specific examples, and i.e. when you want to elaborate on something.

  • Visual (unregistered) in reply to JamesQMurphy

    "“What about if the Downloader just wrote files to a temporary directory, and then moved the file to the appropriate directory when the download was complete.”"

    No experience with coding on NIX but that could still fault on windows.

    If you write a service/application that monitors a folder for filewrites you might try to process the file before it's fully copied there. Thread a loop for exclusive access on the file to prevent locks/errors.

  • Nicolas Verhaeghe (unregistered) in reply to Smash King
    Smash King:
    klenow:
    Is it just me, or does Jeremy sound like a bit of a jerk? He simply wouldn't let the guy use any solution that wasn't his pet solution. Seems the simplest solution is to have the Downloader activate the Watcher when it's done.
    You cross a dimensional portal and gets stuck in a world where interviewers are unable to use adaptive interviews "IE" those that change to turn whatever answer the interviewee provided automatically wrong. Now what do you do?

    I too could find FIVE different solutions, just as simple

    1-The watcher is activated by the downloader 2-The watcher and the downloader are one same application 3-While being downloaded, the file is named "tmp_[filename]" and then renamed "[filename]" and the watcher knows not to open files starting with "tmp_" 4-Downloader is scheduled to work at the top of the hour, Watcher scheduled to work at the bottom of the hour, and if you have a T1, what kind of a file would take more than 30 minutes to download?!? 5-Watcher is coded properly with TRY/CATCH clauses and you go from there...

    Why would you have a "watcher" spend it's time hogging processor time and memory 24/7 anyway?

    In my world, my SSIS packages fire on schedule and do their tasks sequentially.

    If the interviewer does not accept any other solution than is, this means only one thing: control freak. Take your stuff and say bye bye.

  • blindio (unregistered)

    Seems to me that this is a 3rd party application (the watcher) as it's not something we can change, yet it crashes on a pretty obvious scenario. I think the solution is to contact the vendor and tell them to fix their buggy POS software and send me a patch.

  • (cs) in reply to Visual
    Visual:
    "“What about if the Downloader just wrote files to a temporary directory, and then moved the file to the appropriate directory when the download was complete.”"

    No experience with coding on NIX but that could still fault on windows.

    If you write a service/application that monitors a folder for filewrites you might try to process the file before it's fully copied there.

    That's why you move the file.

  • Jules Winnfield (unregistered) in reply to brodie
    brodie:
    Someone You Know:
    Gorfblot:
    A diamond in the rough is something that looks to be of little value, but is actually worth quite a lot once some polishing has been done. IE, You talked with one of the Tier 1 helpdesk people and realized they had some talent and were quick to learn. You get them some further training, move them to a junior development position, and in a short time they become a major contributor to success- That's a diamond in the rough.

    I don't think "IE" means what you think it means.

    It looks like he's using it as the abbreviation for "id est," which essentially means "in other words..." Which is perfectly fine, as used.

    You use e.g. when you want to give specific examples, and i.e. when you want to elaborate on something.

    I use IE when I want to install malware.

  • Gorfblot (unregistered) in reply to KM
    KM:
    I'm pretty sure the actual point was that i.e. != e.g. http://www.wsu.edu/~brians/errors/e.g.html

    That is to say, you talked with one of the Tier 1 helpdesk people and realized they had some talent and were quick to learn…

    Naw, still sounds allright too me. Wereas if you replaced teh "That is" width "For Example", it'd sound awkward w/o some miner changes- at very least put the hole thing in present tense.

    Its ok, I can handle bean rong. Guess Im a diamond in the rogue.

  • (cs) in reply to Nicolas Verhaeghe
    Nicolas Verhaeghe:
    Smash King:
    klenow:
    Is it just me, or does Jeremy sound like a bit of a jerk? He simply wouldn't let the guy use any solution that wasn't his pet solution. Seems the simplest solution is to have the Downloader activate the Watcher when it's done.
    You cross a dimensional portal and gets stuck in a world where interviewers are unable to use adaptive interviews "IE" those that change to turn whatever answer the interviewee provided automatically wrong. Now what do you do?

    I too could find FIVE different solutions, just as simple

    1-The watcher is activated by the downloader 2-The watcher and the downloader are one same application 3-While being downloaded, the file is named "tmp_[filename]" and then renamed "[filename]" and the watcher knows not to open files starting with "tmp_" 4-Downloader is scheduled to work at the top of the hour, Watcher scheduled to work at the bottom of the hour, and if you have a T1, what kind of a file would take more than 30 minutes to download?!? 5-Watcher is coded properly with TRY/CATCH clauses and you go from there...

    4: no locking - that's insane. 5: try/catch doesn't work when the process dies

    Why would you have a "watcher" spend it's time hogging processor time and memory 24/7 anyway?

    sitting around watching a dir takes no appreciable cpu, and likely not much memory either.

  • allo (unregistered)

    The best solution would not need a change as a temporary directory. The Watcher would just wait for two files. Then it processes one and waits until the Downloader begins the next. When the Downloader stops, the Watcher would process the last file.

  • (cs) in reply to brodie
    brodie:
    Someone You Know:
    Gorfblot:
    A diamond in the rough is something that looks to be of little value, but is actually worth quite a lot once some polishing has been done. IE, You talked with one of the Tier 1 helpdesk people and realized they had some talent and were quick to learn. You get them some further training, move them to a junior development position, and in a short time they become a major contributor to success- That's a diamond in the rough.

    I don't think "IE" means what you think it means.

    It looks like he's using it as the abbreviation for "id est," which essentially means "in other words..." Which is perfectly fine, as used.

    You use e.g. when you want to give specific examples, and i.e. when you want to elaborate on something.

    A specific example like "You talked with one of the Tier 1 helpdesk people and realized they had some talent and were quick to learn. You get them some further training, move them to a junior development position, and in a short time they become a major contributor to success?"

    I.e. was wrong here. E.g. would have been the correct choice. Deal with it.

  • (cs) in reply to Rick
    Rick:
    adsfg:
    Branan:
    A file move is different from a file copy in Linux. A move involves changing one pointer in the filesystem, no information is actually "moved". So it's not actually a problem.
    What if you move from physical drive to another?
    Don't.

    Problem solved.

    Or if it's not an option: -Download file to \drive1\somefolder -Upon completion, have the downloader move the file to \drive2\tempfolder

    • Only then move the file to the destination folder

    The first move is not atomic but it doesn't matter because the watcher watches over the other directory. Problem solved anyway.

  • James R. Twine (unregistered)

    Ok - so the majority here believe that mv is an atomic operation if the src and dst are on the same filesystem (or partition?)...

    Does this hold true for ALL filesystems running under Linux/Unix? It might be that the directory is not running on ext2/ext3... What if it was a mounted FAT32 partition, or RiserFS, or UFS, or a SMB share?

    That is the problem with questions that have "only one right answer" IMHO -- they either omit important assumptions (i.e. the underlying filesystem supports atomic moves and the src/dst are on the same filesystem/partition), or are poorly conceived and disregard important implementation details like that that the really smart people think about. :)

  • Asiago Chow (unregistered)
    if the two directories are in the same filesystem, it doesn't matter if they're in different disks. In fact, i can guarantee that they don't.

    Not sure what you meant to say here. It does matter whether they are on the same disk or partition. I don't know what you can guarantee.

    Here's what they are talking about:

    echo "hello" > \mine\tmp\tmpfile
    mv \mine\tmp\tmpfile \mine
    
    
    

    Now imagine the filesystem was set up one of these ways:

    1:
    mkdir \mine
    mkdir \mine\tmp
    
    2:
    mkdir \mine
    mkdir \mine\tmp
    mount \dev\sda3 \mine\tmp
    
    3:
    mkdir \mine
    mount \dev\sda1 \mine
    mkdir \mine\tmp
    mount \dev\sdb1 \mine\tmp
    
    
    
    

    #1 is going to be effectively atomic. The other two are not.

    Also, you have to assume that the system (the part you control) is correctly configured, so the file is downloaded to a staging dir, then moved. Allowing for malicious config makes the problem impossible.

    It's not malicious config, it's a very common type of config in unixesq systems...and one which is normally hidden and inconsequential but could cause unstable behavior due to this shortcut. It doesn't necessarily make the problem impossible.

    The mv method works and I've used it. However, there are other methods which add functionality that might well be needed in the real world so his characterization of it as the "only real solution" was questionable either on the "only" or "real" front.

  • vman (unregistered) in reply to wds

    Of course, there's no real reason given to not have the downloader kick off the "watcher" (or processor in this case). Which could easily be set up so that watcher never starts before the downloaded file is ready.

  • mccoyn (unregistered)

    There’s really only one correct answer, and I try my best to guide candidates to get there.

    Jeremy isn't very good at guiding a candidate to the correct answer. His guidance was repeatedly 'you can't do that'. Rather than say "you can’t modify the Watcher" why not say "you can only modify the Downloader". This immediately gets the candidate out of the incorrect mindset of modifying the processor and into the correct mindset of modifying the downloader.

  • (cs) in reply to allo
    allo:
    The best solution would not need a change as a temporary directory. The Watcher would just wait for two files. Then it processes one and waits until the Downloader begins the next. When the Downloader stops, the Watcher would process the last file.

    I was going to suggest that but it has some of its own ugliness.

    1. The Watcher doesn't necessarily have a way of knowing which of the two files is fully downloaded and which is in progress. This is easy to workaround if the files are named sequentially.

    2. If the Watcher takes a long time to process a certain file and the next file is the "runt" of the bunch, you could end up with 3 (or more) files in the directory at the same time. Again, if the files are named sequentially... not a big problem.

    3. I don't think the Downloader has a way to notify that it has "stopped", and you can process the last file now. Otherwise it would probably have a way to notify that it has finished each file and we wouldn't need to worry about anything.

  • wds (unregistered) in reply to Smash King
    Smash King:
    wds:
    See I'd just have used a lockfile.
    Have you per any chance designed MS-Access?
    Heh no, but think about it. The recruiter said the watcher program couldn't be modified but only to guide the person to the right answer. So if you were able to modify the watcher program, there's two easy solutions. You can make the watcher program ignore certain files and then just rename them to files it does see or you can use a lockfile. Lockfile is the first I came up with reading the question (quite a common pattern, actually, think of pidfiles), renaming is probably a bit easier and more stable since there's no cleanup required if the downloader crashes.

    That being said, trying to start up some sort of IPC link for this was a bit overkill either way. Envisioning a problem when trying to put the temporary directory on different drives might be premature as well, but then that's the problem with these types of recruiting questions, you're working off of a set of assumptions and you never really know what they are.

  • Edward Royce (unregistered) in reply to Azeroth
    Azeroth:
    There is another simple solution with the downloader/watcher problem - downloader should open the file exclusively while it's being downloaded, this way watcher won't be able to access it until it's closed. This way it's not even required to move anything anywhere.

    That was my thought. Lock the file until fully downloaded and then have the downloader invoke the processing program.

    No mucking about with polling a file for it's lock status. No goofing around. No worries some idiot will see an empty directory and remove it in a "clean up" effort.

  • EatenByAGrue (unregistered) in reply to Jimmy Jones
    Jimmy Jones:
    Surely a better solution to the download problem is to add ".unfinished" to the file name then rename it when it's complete.

    This avoids the problem of some smartass putting the temporary folder on another disk and then you get expensive copy operations, run out of disk space when you try to move the file, etc.

    You're right, it is. And stop calling me Shirley.

  • Jasmine (unregistered)

    “Where the hell are you getting these people then? Any amateur could answer those questions.”

    I actually said something like that once, after being told I was the only person who answered a simple SQL question correctly. After three interviews and flying halfway across the USA (on their dime) for a fourth interview, I'm pretty sure that comment is why I'm not living in Phoenix right now.

    Also, from reading the comments, I'm wondering if anyone really has any practical experience with the download/pickup routine. Having worked for possibly the largest printing company in the world, I can tell you this directory-watching thing is pretty common, and on every system I've worked on, which includes Unix, Windows, and AS400 - the "move file when fully downloaded" procedure is the simplest and most reliable, and most other schemes are prone to problems you can't even imagine - things that I never thought could happen, such as whole file systems failing because of race conditions between processes. The interviewer has this one right - however, it's not the only simple solution, and it does require some experience to know that renaming schemes and such can lead to problems. If the intent is to see if the person can come up with simple ideas for simple problems, he could probably go with a simpler question that isn't so reliant on practical experience - like the one about the weight of a 747.

  • and Weeeeeeee! (unregistered) in reply to SoonerMatt
    SoonerMatt:
    Marc:
    Rename?
    Yeah I was thinking that too. Rather than make it move a 3 gb file (which could fail in itself), I would start the transaction as a .tmp file then remove the .tmp when it's completed.

    Yeah... kinda like Firefox!

  • (cs) in reply to Asiago Chow
    Asiago Chow:
    if the two directories are in the same filesystem, it doesn't matter if they're in different disks. In fact, i can guarantee that they don't.

    Not sure what you meant to say here. It does matter whether they are on the same disk or partition. I don't know what you can guarantee.

    No, it only matters that they are on the same filesystem. If you don't know what that means, go read a book.

    Here's what they are talking about:
    echo "hello" > \mine\tmp\tmpfile
    mv \mine\tmp\tmpfile \mine
    
    
    

    Now imagine the filesystem was set up one of these ways:

    1:
    mkdir \mine
    mkdir \mine\tmp
    
    2:
    mkdir \mine
    mkdir \mine\tmp
    mount \dev\sda3 \mine\tmp
    
    3:
    mkdir \mine
    mount \dev\sda1 \mine
    mkdir \mine\tmp
    mount \dev\sdb1 \mine\tmp
    
    
    
    

    #1 is going to be effectively atomic. The other two are not.

    #2 and #3 are not on the same filesystem.

    Also, you have to assume that the system (the part you control) is correctly configured, so the file is downloaded to a staging dir, then moved. Allowing for malicious config makes the problem impossible.

    It's not malicious config, it's a very common type of config in unixesq systems...and one which is normally hidden and inconsequential but could cause unstable behavior due to this shortcut. It doesn't necessarily make the problem impossible.

    The mv method works and I've used it. However, there are other methods which add functionality that might well be needed in the real world so his characterization of it as the "only real solution" was questionable either on the "only" or "real" front.

    Setting up the move so it goes across filesystems is a serious config error and part of what I was referring to as malicious behavior. The mv method works across filesystems now, but it didn't always work like that. Used to be, it would fail if the filesystems differed.

  • (cs) in reply to James R. Twine
    James R. Twine:
    Ok - so the majority here believe that mv is an atomic operation if the src and dst are on the same filesystem (or partition?)...

    Does this hold true for ALL filesystems running under Linux/Unix? It might be that the directory is not running on ext2/ext3... What if it was a mounted FAT32 partition, or RiserFS, or UFS, or a SMB share?

    That is the problem with questions that have "only one right answer" IMHO -- they either omit important assumptions (i.e. the underlying filesystem supports atomic moves and the src/dst are on the same filesystem/partition), or are poorly conceived and disregard important implementation details like that that the really smart people think about. :)

    It holds true for all sensible choices for a server filesystem. I assume sensible configuration and enforce it when possible, because allowing stupid things like fat32 on a server just encourages idiots.

  • (cs) in reply to Jasmine
    Jasmine:
    Also, from reading the comments, I'm wondering if anyone really has any practical experience with the download/pickup routine. Having worked for possibly the largest printing company in the world, I can tell you this directory-watching thing is pretty common, and on every system I've worked on, which includes Unix, Windows, and AS400 - the "move file when fully downloaded" procedure is the simplest and most reliable, and most other schemes are prone to problems you can't even imagine - things that I never thought could happen, such as whole file systems failing because of race conditions between processes. The interviewer has this one right - however, it's not the *only* simple solution, and it does require some experience to know that renaming schemes and such can lead to problems. If the intent is to see if the person can come up with simple ideas for simple problems, he could probably go with a simpler question that isn't so reliant on practical experience - like the one about the weight of a 747.

    I have experience with the whole download/pickup routing, and the way it worked was this:

    1. transfer a file to some staging dir
    2. add a .PICKUP or whatever zero size file after done
    3. other process sees .PICKUP file, does some logic with .PROCESSING and whatever, then starts processing the file
    4. other process finishes and moves file into an archive dir
    5. monitoring software watches dir also and alerts for various error cases, like stale files, .PROCESSING over a certain age, etc.

    this process is easy to understand and troubleshoot, and also to repair when it burps, which is handy when dealing with the one part of the IF that can't be easily modified remotely and must not break, even at 2am.

  • Duke of New York (unregistered)

    Shari would do well to rat out this company and employee by name somewhere (not necessarily here), because what's described is a rather blatant case of illegal employment discrimination.

  • sadwings (unregistered)

    ftp the file to /somedir/.filename.dat and rename it to /somedir/filename.dat after you are finished writing it.

  • El Jeffe (unregistered)

    Who watches the watcher...?

  • (cs) in reply to Duke of New York
    Duke of New York:
    Shari would do well to rat out this company and employee by name somewhere (not necessarily here), because what's described is a rather blatant case of illegal employment discrimination.

    Since when is being a Brown alum a protected class?

  • Marc (unregistered)

    You could give the watcher a low priority and starve CPU cycles indefinitely until you know the file has been downloaded.

    This is accomplished with two monkeys trained in Morse code. A monkey on the server side taps the file size to a monkey on the client side through a sophisticated can/string setup. When the file sizes are equal, the client side monkey can remove a banana from a bin placed on a balance scale. The downward pressure from the other side of the scale causes fluid motion in a hydraulic system. A lever arm connected to the hydraulic presses a button with four independent contacts. If 2 out of 4 contacts are detected, the priority of the watcher task is temporarily increased. The hydraulic system will include a pressure operated release valve to ensure the button is unpressed in a timely manner.

    The client side must constantly display a security application which logs file access. A video camera pointed at the display uses normalized cross correlation and unsupervised learning algorithms to detect additional file access in the security log. This results in the watcher being downgraded to the starvation priority until the redundant switch contacts are again activated.

    Periodically, both the client side monkey and the server side monkey must finish a game of Tic Tac Toe with a trained chicken to verify they are still paying attention/not dead. The game must end in a tie. If the game is not completed or the monkey loses, an alarm is sounded and the monkey is replaced. If the chicken loses, the chicken is replaced.

  • (cs) in reply to El Jeffe
    El Jeffe:
    Who watches the watcher...?

    host monitoring watches the dir and alerts when files sit around too long.

  • sfgsfdgdsfgdsfg (unregistered) in reply to Smash King
    Rick:
    adsfg:
    Branan:
    A file move is different from a file copy in Linux. A move involves changing one pointer in the filesystem, no information is actually "moved". So it's not actually a problem.
    What if you move from physical drive to another?
    Don't.

    Problem solved.

    Depends on how long you want to keep the file around. If it's download -> proces -> delete then the following can be applied:

    Assume: /final is partition A, /tmp is partion B.

    Download the file 'whatever' in /tmp, create a symbolic link in /final/ to /tmp/whatever process the file remove symbolic link remove real file

    Done.

  • Duke of New York (unregistered) in reply to Franz_Kafka
    Franz_Kafka:
    Since when is being a Brown alum a protected class?
    Are you serious?
    • The candidate's name (although changed) is "Shari."
    • The interviewer's behavior was consistent with someone intentionally stalling to avoid the interview.
    • He specifically said that she had a problem "even if qualified professionally," before the interview began. In employment discrimination, that's the equivalent of a smoking gun.
  • (cs) in reply to Duke of New York
    Duke of New York:
    Franz_Kafka:
    Since when is being a Brown alum a protected class?
    Are you serious?
    • The candidate's name (although changed) is "Shari."
    • The interviewer's behavior was consistent with someone intentionally stalling to avoid the interview.
    • He specifically said that she had a problem "even if qualified professionally," before the interview began. In employment discrimination, that's the equivalent of a smoking gun.

    So she's a woman and it's automatically sex discrimination? He took a long lunch and blew off an appointment because he's a self centered schmuck and mostly looked down on here for going to brown. The personality fit is a valid test, but in this case, the personality he wanted was 'sycophant'.

  • Honeyman (unregistered)

    “What about if the Downloader just wrote files to a temporary directory, and then moved the file to the appropriate directory when the download was complete.”

    What if the temporary directory is located on a different storage volume? You'll end up moving several gigabyte file from a volume to a volume, which is not that fast - isn't it why you explicitly mentioned "several gigabytes" so that this approach should be ignored? What if the volume with the temporary directory is smaller than the work dir? The download just fails if done into the temporary directory - while it would successfully work if done into the work dir. What if the the temporary directory is on the ramdisk? A nice side effect of your approach would be the complete system lock-up. What if your work directory is located on a different filesystem, which doesn't support several-Gb-long files? FAT-16 with its 4 Gb limit? Or what if the FS on your work directory doesn't support all the possible names which are allowed in the work dir? CP-1250 limited, while you need to download a file with Chinese hieroglyphs in the name? Or supports 8.3 names only? Finally - what if you don't have a temporary directory AT ALL? If it is an embedded solution - an ATM, a hardware switch or something? Have you heard of ADSL switches which have in-build Bittorrent clients?

    Too many "what if"s. Do you know Jeremy, what they mean? That you didn't mention anything of these in your problem preconditions. While you should have. Instead, you were changing the rules during the game, again and again. The proper software architect plays the rules given by the customer (i.e. YOU) and tries his best to cover all cases which are not defined explicitly. If he doesn't know, if he uses a Windows-based one-HDD-PC or a memory limited Linux/RISC-based ADSL router with no embedded HDD at all (but an SMB client), he assumes his worst. Mark it, Jeremy, nowhere in your questions you ever mentioned the conditions which make your own "solution" valid. While ALL of the solutions from your candidate are perfectly valid. His solutions are complex and valid. Your solution is simple and invalid. Sorry to say, Jeremy. You failed your own interview.

  • Val (unregistered)

    I'm amazed nobody has answered "chmod" yet, as "I Guess That Would Work, Too"

  • some_other_dave (unregistered) in reply to JamesQMurphy
    JamesQMurphy:
    Have you ever asked why you have high turnover?

    I suspect they already know exactly why they have high turnover, and the reason is something beyond their control. (I know it is where I worked recently...)

  • (cs) in reply to Marc
    Marc:
    You could build custom FPGA that intercepts packets on the the network and copies them to flash memory. The hardware can use a serial interface to indicate when the download is complete to a third program, 'The Mounter', which mounts the flash disk to the location the Watcher is expecting.

    The hardware can have a pool of flash memory disk areas, one being written to from the network, one mounted. Each flash memory area would only hold one file at a time.

    Since the Watcher is always running, I'm assuming it uses some sort of event handling system. An operating system hook to the event which indicated the Watcher is done processing and is now watching could be used to tell 'The Mounter' when its time to unmount a flash disk and mount the next one in the queue.

    Don't forget to mount it on a wooden table.
  • (cs) in reply to Val
    Val:
    I'm amazed nobody has answered "chmod" yet, as "I Guess That Would Work, Too"
    Someone did, on page 1, but they didn't say "chmod" explicitly.
  • (cs) in reply to Honeyman
    Honeyman:
    > “What about if the Downloader just wrote files to a temporary directory, and then moved the file to the appropriate directory when the download was complete.”

    What if the temporary directory is located on a different storage volume? You'll end up moving several gigabyte file from a volume to a volume, which is not that fast - isn't it why you explicitly mentioned "several gigabytes" so that this approach should be ignored?

    Don't do that.
    What if the volume with the temporary directory is smaller than the work dir? The download just fails if done into the temporary directory - while it would successfully work if done into the work dir. What if the the temporary directory is on the ramdisk? A nice side effect of your approach would be the complete system lock-up.

    What's your fixation on /tmp? you download to one dir, then move it over. your questions are the equivalent of asking 'what if you deleted all your source code and set yourself on fire?'. completely irrelevant.

    What if your work directory is located on a different filesystem, which doesn't support several-Gb-long files? FAT-16 with its 4 Gb limit? Or what if the FS on your work directory doesn't support all the possible names which are allowed in the work dir? CP-1250 limited, while you need to download a file with Chinese hieroglyphs in the name? Or supports 8.3 names only?

    That's stupid. Don't do it.

    Finally - what if you don't have a temporary directory AT ALL? If it is an embedded solution - an ATM, a hardware switch or something? Have you heard of ADSL switches which have in-build Bittorrent clients?

    Well if you can't download the file at all, then you're SOL.

    Too many "what if"s. Do you know Jeremy, what they mean? That you didn't mention anything of these in your problem preconditions. While you should have. Instead, you were changing the rules during the game, again and again. The proper software architect plays the rules given by the customer (i.e. YOU) and tries his best to cover all cases which are not defined explicitly. If he doesn't know, if he uses a Windows-based one-HDD-PC or a memory limited Linux/RISC-based ADSL router with no embedded HDD at all (but an SMB client), he assumes his worst. Mark it, Jeremy, nowhere in your questions you ever mentioned the conditions which make your own "solution" valid. While ALL of the solutions from your candidate are perfectly valid. His solutions are complex and valid. Your solution is simple and invalid. Sorry to say, Jeremy. You failed your own interview.

    his solutions were pretty bad - hack the kernel for the sake of a file downloader?

  • Duke of New York (unregistered) in reply to Franz_Kafka
    Franz_Kafka:
    So she's a woman and it's automatically sex discrimination? He took a long lunch and blew off an appointment because he's a self centered schmuck and mostly looked down on here for going to brown. The personality fit is a valid test, but in this case, the personality he wanted was 'sycophant'.
    What "personality fit"? The interviewer was talking about some "personal level problem" that he had somehow discovered before even doing the interview.

    This interviewer did several things that HR people specifically tell you in interview training never to do, because they are difficult to explain in court as something other than dscrimination. If the company has an EEO policy, he violated it, regardless of his reasons.

  • (cs) in reply to Marc
    Marc:
    You could give the watcher a low priority and starve CPU cycles indefinitely until you know the file has been downloaded.

    This is accomplished with two monkeys trained in Morse code. A monkey on the server side taps the file size to a monkey on the client side through a sophisticated can/string setup. When the file sizes are equal, the client side monkey can remove a banana from a bin placed on a balance scale. The downward pressure from the other side of the scale causes fluid motion in a hydraulic system. A lever arm connected to the hydraulic presses a button with four independent contacts. If 2 out of 4 contacts are detected, the priority of the watcher task is temporarily increased. The hydraulic system will include a pressure operated release valve to ensure the button is unpressed in a timely manner.

    The client side must constantly display a security application which logs file access. A video camera pointed at the display uses normalized cross correlation and unsupervised learning algorithms to detect additional file access in the security log. This results in the watcher being downgraded to the starvation priority until the redundant switch contacts are again activated.

    Periodically, both the client side monkey and the server side monkey must finish a game of Tic Tac Toe with a trained chicken to verify they are still paying attention/not dead. The game must end in a tie. If the game is not completed or the monkey loses, an alarm is sounded and the monkey is replaced. If the chicken loses, the chicken is replaced.

    Just don't forget to mount different scratch monkeys on the client and server.

  • Tim (unregistered)

    One time I was interviewing people for this job. One of the candidates was completely unqualified. I mean, he went to BROWN. ALL of our other candidates came from top notch schools, like Harvard or MIT. So about 30 minutes after the interview was supposed to go to lunch.

    When I got back, I made him wait another 15 minutes. By then he seemed a little pissed, so I asked him why. He had just got mad and left! Can you believe it? He should be giving me sexual favors! I have a PHD from Harvard!

  • (cs) in reply to Duke of New York
    Duke of New York:
    Franz_Kafka:
    So she's a woman and it's automatically sex discrimination? He took a long lunch and blew off an appointment because he's a self centered schmuck and mostly looked down on here for going to brown. The personality fit is a valid test, but in this case, the personality he wanted was 'sycophant'.
    What "personality fit"? The interviewer was talking about some "personal level problem" that he had somehow discovered before even doing the interview.

    This interviewer did several things that HR people specifically tell you in interview training never to do, because they are difficult to explain in court as something other than dscrimination. If the company has an EEO policy, he violated it, regardless of his reasons.

    He interpreted her objection to getting blown off for nearly an hour as a personality problem. If I were that guy (I'm not) and I got sued, I would stand up in court and say "Sorry your Honor, but I'm a complete asshole. I treat men and women equally poorly".

Leave a comment on “A Problem at the Personal Level & More”

Log In or post as a guest

Replying to comment #:

« Return to Article