Reviewed by Aditya Kumar Β· Last reviewed 2026-03-24
diff file1 file2 (line-by-line). diff -u (unified). diff -r dir1 dir2 (recursive). cmp (byte-by-byte; exit 0 if identical). comm -3 <(sort f1) <(sort f2) for sorted common lines. Large files: md5sum/sha256sum first to skip diff if identical. WHY: diff for review; checksums for...
diff file1 file2 (line-by-line). diff -u (unified). diff -r dir1 dir2 (recursive). cmp (byte-by-byte; exit 0 if identical). comm -3 <(sort f1) <(sort f2) for sorted common lines. Large files: md5sum/sha256sum first to skip diff if identical. WHY: diff for review; checksums for binary or quick equality. COST: diff on huge files is slow; checksum first.
Red Flag: diff on large binaries. Pro-Move: 'Checksum first for >100MB; diff only if different; we use diff -u in CI for config validation.'
According to DataEngPrep.tech, this is one of the most frequently asked General/Other interview questions, reported at 1 company. DataEngPrep.tech maintains an editor-reviewed database of 1,863 data engineering interview questions across 7 categories.