📁 Sangam Dhakal - Portfolio v2.0 - Netscape Navigator 4.0
_
□
×

πŸ“š .NET Interview Questions

377 questions for senior .NET engineer interviews, each with a 30-second answer, the full answer, a deep dive, the follow-ups interviewers ask next, and real-world production problems.

Computer Basics

How computers execute code, number systems (binary, decimal, hexadecimal), bits and bytes, text encoding (ASCII, Unicode, UTF-8, UTF-16) and endianness.

  1. What actually happens between writing C# source code and the CPU executing it?

    The full journey of .NET code: Roslyn compiles C# to IL, the runtime loads the assembly, the JIT (with tiered compilation and Dynamic PGO) or an AOT compiler turns IL into machine code, and the CPU runs those instructions.

    Junior Theory Computer Basics Β· πŸ”— 2 follow-ups
  2. Explain binary, decimal and hexadecimal. How do you convert between them, and why do developers use hexadecimal so often?

    Positional number systems (base 2, 10 and 16), converting between them by hand and in C#, and why hex is the natural way to read bytes, memory addresses, colours, hashes and GUIDs.

    Beginner Theory Computer Basics Β· πŸ”— 2 follow-ups
  3. What are bits and bytes, how big are the .NET numeric types, and what happens when an int overflows?

    Bits, bytes and two's complement; the sizes and ranges of C# numeric types; unchecked versus checked overflow; and bitwise operations and flags enums.

    Junior Coding Computer Basics Β· πŸ”— 2 follow-ups
  4. What is character encoding? Explain ASCII and Unicode, and the difference between a character, a code point and a code unit.

    Why text needs an encoding, what ASCII covers and where it stops, how Unicode assigns code points, and how code points, code units, bytes and user-perceived characters (grapheme clusters) differ.

    Junior Theory Computer Basics Β· πŸ”— 2 follow-ups
  5. How do UTF-8 and UTF-16 differ, and why can string.Length give the wrong answer for user-visible characters in .NET?

    How UTF-8 and UTF-16 encode code points, surrogate pairs, why .NET strings are UTF-16 internally, when UTF-8 is used, and how to count, slice and limit text correctly with Rune and StringInfo.

    Mid-Level Theory Computer Basics Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  6. Customers report names like "José" in a CSV export opened in Excel, and an imported file shows "Jos�". How do you diagnose and fix these encoding problems?

    A practical debugging walkthrough for mojibake and replacement characters: reading the bytes in hex, identifying UTF-8 versus Windows-1252 and double encoding, the BOM and Excel, and fixing both export and import paths in .NET.

    Mid-Level Debugging Computer Basics Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  7. What is endianness, and how do you read and write multi-byte binary data correctly in .NET?

    Big-endian versus little-endian byte order, which platforms and protocols use which, network byte order, and the .NET APIs (BinaryPrimitives, BinaryReader, BitConverter, Guid) that handle byte order explicitly or implicitly.

    Mid-Level Theory Computer Basics Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world
  8. Review this C# method that builds a fixed-layout binary message for a partner system, including a customer name field limited to 32 bytes. What is wrong and how would you fix it?

    A code review that combines encoding and endianness: ASCII data loss, truncating by chars instead of bytes, splitting surrogate pairs, BitConverter's machine byte order, missing validation, and an allocation-free rewrite with BinaryPrimitives and UTF-8.

    Senior CodeReview Computer Basics Β· πŸ”— 2 follow-ups Β· πŸ›  1 real-world

🌐 Sangam's Webring

βͺ Previous 🏠 Main Next ⏩
πŸ’¬ Chat with me