Giter VIP home page Giter VIP logo

cquest's Introduction

C interview questions

Simple and functional C interview questions. Essential concepts like signal handling, job queue, logging and multi-threading knowledge are required for implementing answers.

Structure

Answers are wrapped between // AX part N and // AX part N end where X is question number. All files are given to a interviewee with stripping answers.

Files:

  • main.c
  • jobs.c
  • jobs.h
  • debug.h
  • Makefile

Questions

  1. Add job_myjob_destroy function to free job context & rand_id in ctx1
  2. If rand_is is greater than UINT8 / 2 then replace it with another rand_id and let it run again.
  3. Add signal handler: when USR1 receive print all queue'd jobs, when SIGTERM OR SIGINT received free all queue and gradually exit. All unhandled signals should exit immediately.
  4. log_helper should print DEBUG_ID, filename and line info to LOG_FILE.
  5. Create multiple threads, pull and run jobs from the queue. Properly lock the queue, process jobs concurrently.
  6. Create a Makefile which will define a flag for printing logs to stdout instead of a file. Also add debug and release build options.

Build

LOG_STDOUT=y make

cquest's People

Contributors

alpatakan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.