Technical Interview Questions for Software Engineering Roles: File Systems, Databases, and System Design

1. File Processing and Metadata Extraction

Task: Write a routine in C# to scan a specific directory (e.g., "D:\MedicalData\") containing DICOM files. For each file, extract the filename and patient metadata (Name, ID, Gender, Date of Birth, and Equipment). Assume the data is stored in a comma-separated format within the file for this simulation.


using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

public class PatientRecord
{
    public string FileName { get; set; }
    public string PatientName { get; set; }
    public string PatientID { get; set; }
    public string Gender { get; set; }
    public string DOB { get; set; }
    public string DeviceModel { get; set; }
}

public class DicomParser
{
    public List<PatientRecord> BatchProcessFiles(string directoryPath)
    {
        var records = new List<PatientRecord>();
        
        if (!Directory.Exists(directoryPath))
            return records;

        // Retrieve all files from the target path
        var files = Directory.GetFiles(directoryPath, "*.dcm");

        foreach (var filePath in files)
        {
            try
            {
                // Reading content - assuming a CSV-like structure for the exercise
                string rawContent = File.ReadAllText(filePath);
                string[] metadata = rawContent.Split(',');

                if (metadata.Length >= 5)
                {
                    records.Add(new PatientRecord
                    {
                        FileName = Path.GetFileName(filePath),
                        PatientName = metadata[0].Trim(),
                        PatientID = metadata[1].Trim(),
                        Gender = metadata[2].Trim(),
                        DOB = metadata[3].Trim(),
                        DeviceModel = metadata[4].Trim()
                    });
                }
            }
            catch (Exception ex)
            {
                // Log error for specific file processing failure
                Console.WriteLine($"Error parsing {filePath}: {ex.Message}");
            }
        }

        return records;
    }
}

2. Front-End Resource Customization via API

Task: Design a web interface that consumes a RESTful API returning XML data. The page should parse the XML and dynamically render resource details such as ID, Title, and Summary.


<html>
<head>
    <title>Resource Dashboard</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
    <script>
        $(document).ready(function() {
            const apiEndpoint = "http://api.example.com/resources/v2?group=main";

            $.ajax({
                url: apiEndpoint,
                method: "GET",
                dataType: "xml",
                success: function(xml) {
                    let container = $('#displayArea');
                    $(xml).find('entry').each(function() {
                        let entryId = $(this).find('id').text();
                        let entryTitle = $(this).find('title').text();
                        let entrySummary = $(this).find('summary').text();

                        let card = `<div class="item">
                            <h4>${entryTitle}</h4>
                            <p><strong>ID:</strong> ${entryId}</p>
                            <p>${entrySummary}</p>
                        </div>`;
                        container.append(card);
                    });
                },
                error: function(xhr) {
                    if (xhr.status === 401) {
                        alert("Unauthorized: Access Denied.");
                    } else {
                        alert("Error retrieving data. Status: " + xhr.status);
                    }
                }
            });
        });
    </script>
</head>
<body>
    <div id="displayArea"></div>
</body>
</html>

3. Database Normalization

Analyze the following table structure and suggest improvements for a more efficient design:

Currrent: (City*, Street*, ZipCode) -> Primary Key is (City, Street)

**Improvement Strategy:**The current design has redundancy (e.g., ZipCode is repeated for every street in the same city). It violates Third Normal Form (3NF) because the ZipCode might be transitively dependent on the City/Street combination.

Proposed Schema:

  • Cities Table: CityID (PK), CityName
  • ZipCodes Table: ZipID (PK), Code, CityID (FK)
  • Streets Table: StreetID (PK), StreetName, ZipID (FK)

4. SQL Data Synchronization

Task: Given two identical tables Client_Alpha and Client_Beta, write a stored procedure to insert records from Alpha to Beta if the ID does not exist in Beta, and update Beta's records if the ID already exists.

CREATE PROCEDURE SyncClientData
AS
BEGIN
    -- 1. Update existing records in Beta using data from Alpha
    UPDATE B
    SET B.Name = A.Name, 
        B.Address = A.Address
    FROM Client_Beta B
    INNER JOIN Client_Alpha A ON B.ID = A.ID;

    -- 2. Insert new records from Alpha into Beta
    INSERT INTO Client_Beta (ID, Name, Address)
    SELECT ID, Name, Address
    FROM Client_Alpha A
    WHERE NOT EXISTS (
        SELECT 1 FROM Client_Beta B WHERE B.ID = A.ID
    );
END;

5. Hierarchical File System Implementation

Task: Design a database schema to represent a directory tree and provide an algorithm to traverse it.

Schema Design:

  • Folders Table: FolderID (PK), FolderName, ParentFolderID (FK references Folders.FolderID)
  • Files Table: FileID (PK), FileName, FolderID (FK references Folders.FolderID)

Traversal Algorithm (Recursive Depth-First Search):

public void TraverseStructure(int folderId, int depth)
{
    // 1. Fetch current folder details
    var folder = context.Folders.Find(folderId);
    Console.WriteLine(new String('-', depth) + folder.FolderName);

    // 2. Print all files in this folder
    var files = context.Files.Where(f => f.FolderId == folderId);
    foreach(var file in files)
    {
        Console.WriteLine(new String(' ', depth + 2) + file.FileName);
    }

    // 3. Recurse into subfolders
    var subFolders = context.Folders.Where(f => f.ParentFolderId == folderId);
    foreach(var sub in subFolders)
    {
        TraverseStructure(sub.FolderID, depth + 2);
    }
}

6. Single Sign-On (SSO) Architecture

Principle: SSO allows a user to authenticate once and gain access to multiple independent software systems. It relies on a central identity provider (IdP) and a trust relationship between the IdP and service providers (SP).

**Proposed Solution:**Implement an OAuth2/OpenID Connect (OIDC) flow. 1. When a user accesses an application, they are redirected to the Auth Server. 2. After successful credentials verification, the Auth Server issues a JWT (JSON Web Token). 3. The application validates the JWT signature and extracts user claims. 4. For subsequent requests to other applications, the same token or session cookie is used to verify identity without re-prompting for credentials.

7. Software Engineering Lifecycle

Key phases of a standard software engineering project:

  1. Requirement Analysis: Defining what the system should do. Goal: Create a clear SRS (Software Requirement Specification).
  2. System Design: Defining architecture and tech stack. Goal: Blueprint for developers.
  3. Implementation (Coding): Translating design into code. Goal: Functional software modules.
  4. Integration & Testing: Verifying system behavior. Goal: Identifying and fixing bugs.
  5. Deployment & Maintenance: Releasing to production and handling updates. Goal: System stability and longeviyt.

Critical Path: Requirement Analysis and System Design are the most critical. Errors here propagate through all subsequent stages, leading to significant rework costs.

8. Professional Development and Conflict Resolution

Team Contributions: I maximize my impact by maintaining high code quality, adhering to deadlines, and proactively sharing knowledge with peers to unblock technical hurdles.

Conflict Resolution: When my technical opinion differs from a lead's, I focus on data-driven arguments. I present the pros and cons of both approaches (scalability, performance, maintenance cost). If the lead maintains their decision after considering my input, I commit to their direction to ensure team alignment and project momentum.

Tags: .NET C# sql database-design system-architecture

Posted on Thu, 24 Sep 2026 16:43:40 +0000 by unstable_geek